Re: "Back off" setting for crashing services with s6+openrc?

From: Colin Booth <colin_at_heliocat.net>
Date: Mon, 26 Sep 2022 23:00:48 +0000

On Thu, Sep 22, 2022 at 01:21:46PM -0700, John W Higgins wrote:
> Good Day,
>
> On Thu, Sep 22, 2022 at 1:13 PM Tor Rune Skoglund <trs_at_fourc.eu> wrote:
> ...
>
> > As a generic question, is there any setting with this s6+openrc config
> > that would make s6 "back off" a configurable number of seconds before
> > doing the restart?
> >
> >
> Does something as simple as changing your run script to be something like
>
> run_my_crashing_app || sleep 10
>
> Work? The run script will sit there for 10 seconds if your app fails. Not
> built in - but should accomplish the task pretty easily.
>
> John W Higgins
Put the backoff in the finish script. The API is to run finish with the
exit code and signal (if appropriate) as $1 and $2 respectively. With
that information you can have finish make decisions about if it should
delay restarting, set the service down in the face of a permanent error,
or so on. Note that by default finish has a five second deadline so if
you want to delay a restart for ten seconds you'll need to increase that
deadline with a timeout-finish file.

-- 
Colin Booth
Received on Tue Sep 27 2022 - 01:00:48 CEST

This archive was generated by hypermail 2.4.0 : Tue Sep 27 2022 - 01:01:20 CEST