Artix Linux Forum

Artix Linux => System => Topic started by: andrewcz on 07 December 2018, 05:46:59

Title: Runit with mongodb
Post by: andrewcz on 07 December 2018, 05:46:59
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

Title: Re: Runit with mongodb
Post by: Everyone on 07 December 2018, 15:50:05
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 (https://wiki.artixlinux.org/Main/Runit) and Runit homepage (http://smarden.org/runit/) for more information.
Title: Re: Runit with mongodb
Post by: konimex on 10 December 2018, 15:00:40
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.
Title: Re: Runit with mongodb
Post by: YvesSaintYuran on 03 October 2020, 14:14:10
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 (https://wiki.artixlinux.org/Main/Runit) and Runit homepage (http://smarden.org/runit/) 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
Title: Re: Runit with mongodb
Post by: ndowens on 03 October 2020, 16:23:09
Try using mysql-runit as mongodb is suppose to be a drop in replacement
Title: Re: Runit with mongodb
Post by: Dudemanguy on 03 October 2020, 16:42:11
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.
Title: Re: Runit with mongodb
Post by: ndowens on 03 October 2020, 21:15:49
No that's for mariadb. This is different.
Woops, yeah was thinking of that one :D