On 2/16/2015 3:56 PM, Colin Booth wrote:
If you are running the sv check within a dependent service's run
script that was spawned first, the script will fail and runsv will
respawn it, with the call eventually succeeding once the required
service is up.
If you're calling this from a daemon script that is outside of the
general supervision framework, you'll need to write a simple wait loop
in shell to wrap the sv call similar to what Case suggested.
A third option is to loop the list of "child" dependencies and perform
the check for each one. If a check returns a failure, then fail the
"parent" script and let the supervisor restart it. You can then have
./finish inject a quick message into the log about the failure.