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:
#!/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:
#!/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:
ln -s /etc/runit/sv/mongodb /run/runit/service/mongodb
Consult the Artix wiki and Runit homepage for more information.