The officially official Devuan Forum!

You are not logged in.

#1 2020-05-13 23:45:44

Registered: 2019-01-30
Posts: 5  

MongoDB issues

Hi, I need to install MongoDB Community Edition, so I've tryed to follow the instruction provided here : … on-debian/

actually everything installed flawless, until I try to install the service (the docs even mention that both systemd and system V init) are supported so I went stright forward with doing: service mongod start and I get "mongod: unrecognized service", any clue how to solve this? anybody ever tryed to install and run successfully MongoDB? (I am on Devuan 3.0)


#2 2020-05-14 00:43:09

Registered: 2018-02-04
Posts: 146  

Re: MongoDB issues

You can go find the names of the services on your system:

ls -al /etc/init.d

This will show you the files in the directory where the service scripts are stored. If mongodb supports sysvinit, it will probably place the service file there. Maybe it's named mongodb.

I just checked a random deb file from the mongodb site, and that version only provided a systemd unit.

$ dpkg-deb --contents mongodb-org-unstable-server_4.3.6_amd64.deb | grep -iE 'systemd|init|rc'
drwxr-xr-x root/root         0 2013-12-19 00:41 ./lib/systemd/
drwxr-xr-x root/root         0 2013-12-19 00:41 ./lib/systemd/system/
-rw-r--r-- root/root       716 2013-12-19 00:41 ./lib/systemd/system/mongod.service

The packages are geared towards debian, of course, which uses systemd.

So it looks like you will have to adapt an init script to run your daemon. You could investigate using the sysd2v script ( that will try to read the unit file and write you a template for an init script.

But also perhaps an old-school init script from the interwebs might be adapted too:

On second thought, you should try using the init script from the rpm that is built for CentOS 6.

mkdir -p tmp ; cd tmp
rpm2cpio < ../mongodb-org-unstable-server-4.3.6-1.el6.x86_64.rpm | cpio -idmv

To run the above commands you will need to install rpm2cpio and cpio packages.
Then, inside the tmp/etc/init.d directory you will have the init script! It might need adjusting for a devuan (debian-family) distro, so I can look through it if you're not ready for that. Once you're satisfied the init script calls the right binaries and uses the right paths, place it in /etc/init.d and then:

update-rc.d mongod defaults

Last edited by bgstack15 (2020-05-14 00:59:41)

This space intentionally left blank.


#3 2020-05-14 13:12:17

Registered: 2019-01-30
Posts: 5  

Re: MongoDB issues

I tryed the procedure you suggested, I've installed mongodb-org-unstable-server-4.3.6-1.el6.x86_64.rpm and I tryed use the mongod inside
/tmp/etc/init.d/mongod and placed it in /etc/init.d, but its not working, some edit are needed but I am not really good at it, some stuff I seen that indeed seems wrong for devuan but as i don't know redhat I dunno in which matter it should be changed.. for example:

# chkconfig: 35 85 15
# description: Mongo is a scalable, document-oriented database.
# processname: mongod
# config: /etc/mongod.conf

. /etc/rc.d/init.d/functions <----- this line

# All variables set before this point can be overridden by users, by
# setting them directly in the SYSCONFIG file. Use this to explicitly
# override these values, at your own risk.
if [ -f "$SYSCONFIG" ]; then
    . "$SYSCONFIG"

this procedure also won't work either, and there could be more, but I don't know how to fix it propery, sorry.

Last edited by Jokah (2020-05-14 13:12:45)


#4 2020-05-14 16:56:07

Registered: 2019-01-30
Posts: 5  

Re: MongoDB issues

I could solve it, I found and used this init: … ian/init.d


Board footer