Re: s6: something like runit's ./check script

From: Buck Evan <buck_at_yelp.com>
Date: Wed, 2 Sep 2015 16:55:06 -0700

That seems like a lot of brain surgery for this essential feature.
My users are CSS experts.
I think I'll spawn such a background process from my framework by default
if ./check exists.

I suppose you have no inkling of making ./check an s6 feature?

On Wed, Sep 2, 2015 at 3:07 PM, Laurent Bercot <ska-supervision_at_skarnet.org>
wrote:

> On 02/09/2015 23:14, Buck Evan wrote:
>
>> Given a daemon that doesn't have a readyfile feature, I'd like to write a
>> `check` script and hook it up to s6's readiness notification
>> <http://skarnet.org/software/s6/notifywhenup.html>.
>>
>
> echo 3 > notification-fd
>
> mv run run.real
>
> cat > run <<EOF
> #!/command/execlineb -P
> background -d
> {
> fdmove 1 3
> forx -x 0 dummy { 1 2 3 4 5 6 7 }
> ifelse { ./check } { echo }
> foreground { sleep 1 }
> exit 1
> }
> fdclose 3
> ./run.real
> EOF
>
> chmod 755 run
>
> Untested, but that should report readiness if ./check succeeds
> within 7 attempts at running it, with 1 second between attempts.
> How it works is left as an exercise to the reader. %-P
>
> --
> Laurent
>
>
Received on Wed Sep 02 2015 - 23:55:06 UTC

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