runit
runit copied to clipboard
sv shutdown fails, even while sv stop works
The "sv shutdown" command does not work as expected, even while the "sv stop" command does. See the screenshot below:
Not only does the "sv shutdown" command return an error, but the service is still running. Note that the service was apparently stopped and then restarted (the process ID of the /usr/local/bin/houseportal application is different).
The "sv exit" command behaves in the same odd way, which is not surprising since the man page indicates that shutdown is based on exit..
I just downloaded, installed (and updated, as per the installation manual) void-live-x86_64-20230628-base.iso.
Even weirder, if the service is stopped, then using "sv exit" restarts it. See screenshot:
The runsv
program is what supervises a service. It can be spawned directly or through runsvdir
, which spawns and supervises runsv
processes for all services found in the service directory.
When using sv <stop|down>
, the corresponding runsv
process receives the signal to end the service it supervises, updates the status of the service, and continue listening for further signals (these are documented in the runsv
manual page).
The sv
command only ever send control signals to individual runsv processes. When the signal requires that the runsv
process itself terminates, it does so. However, if it was started by runsvdir
, it will be automatically restarted, which will restart the service if its default state is not down
.