bash-vsv
bash-vsv copied to clipboard
Command to link and unlink services
Currently, vsv can be used to do all service management operations, with the exception of linking and unlinking services. Those two operations have to be done manually, and this is very prone to errors (creating bogus links, deleting a file/directory instead of the link, etc).
A command to do those in vsv would make it easier and probably safer to link services.
This could looks like vsv (link|unlink) <service>, and maybe with flags to specific the directory to use.
It would also be possible to write completions for services with a command like that.
Would definitely love to see this.
Besides the convenience of linking new services, this would also serve another purpose due to a quirk in runit - if you add a logging service to a service, runit will not look for it until either:
- The system reboots
- The link to the service disappears for 5 seconds or more, and is then re-linked
As you can imagine, trying to enable a new logger in runit can be pretty annoying, since it doesn't check for newly-added log scripts. Setting a service as "down" or disabling it with the "down" file is not sufficient. Runit only processes the log directory when adding a new service, but it only does that when the link to that service is "new" (as a sidenote, a patch to runit to correct this behavior would be great).