Re: runit and "sv check" for dependencies

From: James Byrne <>
Date: Mon, 26 Jan 2015 12:24:55 +0000

Hi Wayne,

Thanks for the reply, and apologies for taking so long to respond to
your comment.

On 16/01/15 15:48, Wayne Marshall wrote:
> The "sv check" paradigm is a bit wrong-headed in its approach to
> dependency handling. It forces a service to block and wait for its
> dependency. To the rest of the world, that service will then seem like
> it is up and running normally, when in fact it may only be waiting for
> an unmet dependency.
> The better paradigm for dependency checking is this: for a service
> with any unmet dependency, fail immediately.
> The supervisor itself will then automatically take care of trying to
> restart the service at periodic intervals, until the dependency check
> for that service succeeds.
> The perpok(8) utility for dependency checking is included in the perp
> distribution and described here:
I understand that exiting immediately is the correct thing to do; I
wanted to use 'sv check' to do this. My idea was to use something like
'sv -w0 check myservice1', thus causing the run script to exit
immediately if 'myservice1' was not running. The current behaviour of
'sv check' means that this does not work, because it can return exit
code 0 when the service is down. My suggested patch alters the behaviour
so that 'sv check' will only return exit code 0 if the service is running.

I am not planning to introduce additional packages like perp - I wanted
to achieve the effect just using the 'runit' tools.

Going back to my original question, is there any reason why I should not
make this change? Have I
misunderstood what "sv check" is supposed to do? Is there a reason for
its current behaviour?


Received on Mon Jan 26 2015 - 12:24:55 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC