"Waiting for $DEPS" loop (was: [patch: sv check should wait when svrun is not ready])

From: Buck Evan <buck_at_yelp.com>
Date: Tue, 10 Feb 2015 09:20:07 -0800

Out of curiosity though, why the loop? I would expect setting a higher
svwait and a single sv-start to have the same effect.

--phone is hard.
On Feb 10, 2015 1:53 AM, "Crest" <crest_at_rlwinm.de> wrote:

>
> 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 - 17:20:07 UTC

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