Skip to main content
Topic: Runit with mongodb  (Read 1724 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 -

[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


 

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.
now only the dinit guy in artix

Re: Runit with mongodb

Reply #3
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.

░▒▓   │   ~ ▓▒░ 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

Re: Runit with mongodb

Reply #4
Try using mysql-runit as mongodb is suppose to be a drop in replacement

Re: Runit with mongodb

Reply #5
Try using mysql-runit as mongodb is suppose to be a drop in replacement

No that's for mariadb. This is different.

ln: failed to create symbolic link '/run/runit/service/mongodb': No such file or directory


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.