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

From: Oliver Schad <oliver.schad_at_automatic-server.com>
Date: Sat, 24 Sep 2022 14:33:15 +0200

On Thu, 22 Sep 2022 13:21:46 -0700
John W Higgins <wishdev_at_gmail.com> 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.

You could propably outsource the backoff mechanism, which can handle
some statistics.

Something like that:
https://pastebin.com/aH3EDGLG

You would use it in your run script as:

exec with_backoff my_daemon

Best Regards
Oli

-- 
Automatic-Server AG •••••
Oliver Schad
Geschäftsführer
Hardstr. 46
9434 Au | Schweiz
www.automatic-server.com | oliver.schad_at_automatic-server.com
Tel: +41 71 511 31 11 | Mobile: +41 76 330 03 47

Received on Sat Sep 24 2022 - 14:33:15 CEST

This archive was generated by hypermail 2.4.0 : Sat Sep 24 2022 - 14:34:04 CEST