From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11580 invoked from network); 26 Sep 2022 23:00:54 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 26 Sep 2022 23:00:54 -0000 Received: (qmail 10745 invoked by uid 89); 26 Sep 2022 23:01:17 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 10738 invoked from network); 26 Sep 2022 23:01:16 -0000 Date: Mon, 26 Sep 2022 23:00:48 +0000 From: Colin Booth To: supervision@list.skarnet.org Subject: Re: "Back off" setting for crashing services with s6+openrc? Message-ID: References: <76856b27-1653-4e3c-28a5-737b63dea1f0@fourc.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 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