void-linux / runit

The init system for Void Linux.
https://voidlinux.org
169 stars 22 forks source link

sv shutdown fails, even while sv stop works #27

Open pascal-fb-martin opened 1 year ago

pascal-fb-martin commented 1 year ago

The "sv shutdown" command does not work as expected, even while the "sv stop" command does. See the screenshot below:

image

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.

pascal-fb-martin commented 1 year ago

Even weirder, if the service is stopped, then using "sv exit" restarts it. See screenshot:

image

0x5c commented 1 year ago

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.