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 -
[andrewcz@andrewcz-pc ~]$
[andrewcz@andrewcz-pc ~]$ sudo sv start mongodb
[sudo] password for andrewcz:
fail: mongodb: unable to change to service directory: file does not exist
[andrewcz@andrewcz-pc ~]$ sv status mongodb
fail: mongodb: unable to change to service directory: file does not exist
[andrewcz@andrewcz-pc ~]$
i am not sure how to provision the service
Thank you in advance.
Andrew
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/mongodband 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/logwith 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/mongodbdirectory, 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 (https://wiki.artixlinux.org/Main/Runit) and Runit homepage (http://smarden.org/runit/) for more information.
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.
░▒▓ │ ~ ▓▒░ ln -s /etc/runit/sv/mongodb /run/runit/service/mongodb ░▒▓ ✔ │ 07:11:42 ▓▒░
ln: failed to create symbolic link '/run/runit/service/mongodb': No such file or directory
Try using mysql-runit as mongodb is suppose to be a drop in replacement
No that's for mariadb. This is different.
Unfortunately, you're a bit out of luck here. Mongodb moved to some weird proprietary license sometime last year I believe. It was removed from Arch and Artix's repos completely after that. If you want an init script for it, you'll have to write it yourself.
Woops, yeah was thinking of that one :D