On 08/02/2015 09:12, Colin Booth wrote:
> To get the functionality you want the dependent service should, as
> part of its runscript, do something like 'sv status $otherservice |
> grep "run"' to see if runsv considers the service to be running
> followed by a call to 'sv check $service' to see if the service is
> available.
Note, however, that there's a race condition: the service can die
between the instant when the status is read and the instant when
readiness is checked.
Avoiding that race condition isn't very simple - that's the whole point
of the libftrig mechanism in s6, and of the complexity of the s6-svwait
and s6-svlisten1 programs. But even without a notification mechanism or
precise state tracking, it would make sense for sv check (which is a
"readiness polling" mechanism) to exit nonzero when the service is down,
so it is never reported as ready when it isn't.
--
Laurent
Received on Sun Feb 08 2015 - 08:54:23 UTC