Skip to main content
Topic: Runit with mongodb  (Read 93 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Runit with mongodb

Hi All,
I have just switched over from a systemd distro and just trying to get my bearings.
i am trying to run a mongodb service and i am getting the following -

[[email protected] ~]$
[[email protected] ~]$ sudo sv start mongodb
[sudo] password for andrewcz:
fail: mongodb: unable to change to service directory: file does not exist
[[email protected] ~]$ sv status mongodb
fail: mongodb: unable to change to service directory: file does not exist
[[email protected] ~]$

i am not sure how to provision the service
Thank you in advance.
Andrew


Re: Runit with mongodb

Reply #1
Usually for packages providing a service a proper runit package is available i.e. for nginx that would be nginx-runit. However for mongodb this does not seem to be the case yet. Basically you will need at the very least to create the directory
/etc/runit/sv/mongodb
and an executable run file inside with this content:
Code: [Select]
#!/bin/bash
exec mongod [your run options] 2>$1
If you don't have any logging tools running and would like to have logging, then you also need to create directory
/etc/runit/sv/mongodb/log
with an executable run file inside with this content:
Code: [Select]
#!/bin/bash
[ ! -d /var/log/mongodb ] && mkdir -p /var/log/mongodb
exec svlogd /var/log/mongodb
This will write log files of mongod process to
/var/log/mongodb
directory, which will be created if non-existent.

For the created service to be available it needs to be enabled first:
Code: [Select]
ln -s /etc/runit/sv/mongodb /run/runit/service/mongodb

Consult the Artix wiki and Runit homepage for more information.

Re: Runit with mongodb

Reply #2
Sorry for the inconvenience!
Since I had finals, I can't do it. Hopefully we can add new package for MongoDB's runit service scripts no later than this weekend.
the runit guy on artix