Re: patch: sv check should wait when svrun is not ready

From: Crest <crest_at_rlwinm.de>
Date: Tue, 10 Feb 2015 10:53:35 +0100

On 10.02.2015 02:55, Buck Evan wrote:
> Essentially, if `sv check` is run too soon after `runsv` (or runit for that
> matter), it will immediately fail without waiting for runsv to come up. In
> my particular use case, runit is running inside a (detached) docker, and
> I'm using `sv check` to wait for my dockerized service to be ready, which I
> think is a good use case for `sv check`. Without this patch, I'm forced to
> write some code which re-runs `sv check` if it fails before $SVWAIT
> seconds, which sounds awfully like the behavior of sv-check itself.
I use something like this in my ./run scripts:

NAME='foo'
DEPS='baz baz'

export SVWAIT=1
while ! sv start $DEPS >/dev/null
do
     echo "Waiting for $DEPS required by $NAME."
done
unset SVWAIT

Don't use this unless your service has a ./check script because it
blocks the service until the dependencies are met.
Received on Tue Feb 10 2015 - 09:53:35 UTC

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