So the way it works is basically you run runsvdir on a service directory, and then runsvdir will use runsv on each of the folders inside that. the sv command is used for stop/start/restarting like "sv stop <name>" "sv restart <name>" etc.
You can see this page for how it's recommended to use runit with other init systems http://smarden.org/runit/useinit.html via inittab or /etc/rc.local (but probably rc.services for us). This page mentions a file called runsvdir-start which void's runit package does not include. But its just a small shell script!
Code: Select all
#!/bin/sh
PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
exec env - PATH=$PATH \
runsvdir -P /service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
To your other questions!
Q: does vpm try to run runsvdir? what happens if it is absent?
A: no it doesnt. runsvdir is something the init system does to manage a service directory and that is about it. The way runit enables new services is just by symlinking from one folder (the folder with all possible services) into another folder (the folder with all enabled services) and then the already-running runsvdir will see them and turn them on. So if runsvdir is absent nothing explodes.
Q: have you encountered problems due to the absence of runsvdir?
Q: are there many void packages with runit service scripts?
A: The answer to these are sort of the same. Basically there are some packages with services to manage daemons. A lot are the sort of things you would run on a server- like nginx and mysql. BUT some are services that are good to have on a desktop. For example, the void package for tailscale (a meshnet vpn service) uses a runit service to launch tailscaled. Other examples I have personally used on desktop systems are tor, lm_sensors' and thinkfans' fan control services, syncthing, tlp (power saving tool), virtualbox, and wireguard. So it is nice to have the services working for these in my opinion. I also like to run a lot of my own runit scripts so I like to have it working anyway.
Q: are all void runit service scripts "safe" to run in VoidPup?
A: I think some are and some are not. While i like services I also know it can be annoying if software is running in the background just because you installed it. Stuff like tailscale, tlp, syncthing, or thinkfan only make sense to install if you have the service turned on but other things like tor or hiawatha maybe you don't want the service on by default. I don't remember if void defaults to enabling services on install or if it leaves them disabled by default. I need to download all the packages with runit scripts and see what they do.
If everything defaults to disabled then whether it's safe is not a big concern. But if some default to enabled, then maybe a better option would be to make a separate voidpup runit service folder and use runsvdir on that. That way we make sure the only things running are things turned on on purpose.
Q: runsvdir is just one app in the runit package - are any other parts of runit needed?
A: Yeah some other parts are but I do not remember specifically which parts can be discarded when you are not using it as an init system.
From reading the official docs at http://smarden.org/runit/, I know you need
- sv
- runsvdir
- runsvchdir
- runsv
- chpst (used by most of the runit services for changing user / privileges if needed)
I know that some services also use svlogd to write their logs into /var/log including syncthing. So it's probably best to have that too. I have not tested deleting the other things to make 100% sure this is all that is needed!