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

From: Alyssa Ross <hi_at_alyssa.is>
Date: Fri, 23 Sep 2022 16:44:53 +0000

John W Higgins <wishdev_at_gmail.com> writes:

> 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.

I think there's a correctness problem with this approach. An
s6-supervise process supervises its direct child, which is supposed to
be the daemon under supervision. But in this case it would be the
shell, so s6 doesn't know the daemon's PID, and so can't signal it. If
s6 tries to stop the service, it will signal the shell, which won't
necessarily do the right thing and stop the application. An s6 service
needs to ensure that the service is stopped if s6-supervise's direct
child dies.

Received on Fri Sep 23 2022 - 18:44:53 CEST

This archive was generated by hypermail 2.4.0 : Fri Sep 23 2022 - 22:38:48 CEST