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 9514 invoked from network); 2 Aug 2021 19:39:50 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 2 Aug 2021 19:39:50 -0000 Received: (qmail 17082 invoked by uid 89); 2 Aug 2021 19:40:14 -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 17075 invoked from network); 2 Aug 2021 19:40:14 -0000 From: "Laurent Bercot" To: "Steve Litt" , supervision@list.skarnet.org Subject: Re: S6 Queries Date: Mon, 02 Aug 2021 19:39:47 +0000 Message-Id: In-Reply-To: <20210802140732.316b9f4d@mydesk.domain.cxm> References: <20210802140732.316b9f4d@mydesk.domain.cxm> Reply-To: "Laurent Bercot" User-Agent: eM_Client/8.2.1473.0 Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddriedvgdduvdelucetufdoteggodftvfcurfhrohhfihhlvgemucfpfgfogfftkfevteeunffgpdfqfgfvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjghfrhgfgggtgfesthhqredttderjeenucfhrhhomhepfdfnrghurhgvnhhtuceuvghrtghothdfuceoshhkrgdqshhuphgvrhhvihhsihhonhesshhkrghrnhgvthdrohhrgheqnecuggftrfgrthhtvghrnhepvdfgveffueelgedvkedtffetgedvieeifeektefgueehffehleehjefhveeuieejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuth >I thought the way to do what the OP asked is: > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >#!/bin/sh >s6-svc -u myrequirement || exit 1 >exec mydaemon -myarg1 -myarg2 >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D This is not a good idea in a s6-rc installation, because it sends raw s6 commands, which may mess with the service state as viewed by s6-rc. Also, it sends control commands to a service from another service's run script, which is bad form in general: it is unintuitive that starting the mydaemon service also causes the myrequirement service to be started. Dependencies should be handled at the service manager level, not at the process supervision level. Of course, you can do that in a pinch for small s6-only installations, where you have no proper dependency engine, but that does not seem to be what the OP is asking. And even then, this does not implement After=3D because s6-svc -u returns instantly. This only implements Wants=3D. To implement After=3D, you would need something like s6-svc -uwU instead, which is not good because it adds the myrequirement readiness delay to the mydaemon readiness delay, so if mydaemon has strict readiness timeouts, it can make it fail. All in all, it's better to avoid controlling another service in a run script: there's always an annoying corner case somewhere. Dependency management is best handled by the external tool that is explicitly supposed to do it: the service manager. -- Laurent