From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from alyss.skarnet.org (alyss.skarnet.org [95.142.172.232]) by inbox.vuxu.org (Postfix) with SMTP id 2EAF628F20 for ; Tue, 28 May 2024 07:36:46 +0200 (CEST) Received: (qmail 34371 invoked by uid 89); 28 May 2024 05:37:11 -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 34361 invoked from network); 28 May 2024 05:37:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=westernsemico.com; s=default; h=Message-ID:Date:To:From:Subject:References: In-Reply-To:Content-Transfer-Encoding:MIME-Version:Content-Type:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UasN9mArRcmj0bY8wVRwc21UO5+TeKIT4uf+oY/gIhw=; b=DqzbE/QfoHphqgmkQUDj+sXBPC GgO8+Vbixs+vaVidyZ30Fb3L7R6Naaze/hPxIUqzLFOisyiQEhdz0gWcXpUUU58HWakaqpNpHhmSM ylGclnrJfKL5r0zVp8tsuCbshQZipn5/E08fD5qDZEc4xWG6wsm3IScf1AG9SxQEJG8FZUDzeCr3m Ngund2SNUR8XneFDzjGdv61gXakyrgTi9ccd4Qyr2R+NnAdh7KHpOfuy+pBzXX3MKKVZOWwBbvp6i gqVGjUT0AGqcuCuLWUJcTnyzJussx3pGdgXGJv7XKPaZZHpwH3Oss6xhM3Q1jaQeSX+LAlG0vCkxV WPGGAN2A==; Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <1716661664.18967.ezmlm@list.skarnet.org> Subject: Re: s6 daemon restart feature enhancement suggestion From: adam@westernsemico.com To: Laurent Bercot , supervision Date: Mon, 27 May 2024 22:36:38 -0700 Message-ID: <171687459873.14083.13122148492532801514@localhost> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server220.web-hosting.com X-AntiAbuse: Original Domain - list.skarnet.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - westernsemico.com X-Get-Message-Sender-Via: server220.web-hosting.com: authenticated_id: westwhdn/from_h X-Authenticated-Sender: server220.web-hosting.com: adam@westernsemico.com X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched Quoting Laurent Bercot (2024-05-26 12:53:39) > If you are building a distribution aimed at supporting several kinds > of hardware, I suggest adding flexibility at the *source database* > level, and building the compiled database at system configuration time If at all possible, do this. > (or, in extreme cases, at boot time, though I do not recommend that if > you can avoid it, since you lose the static bootability guarantee). I believe there is also a third approach which is sort of a middle-ground: = all oneshots and longruns are compiled statically, but the contents of bundles = are determined at boot time. Think of it by analogy to the Linux kernel: distr= os nowadays build every single module under the sun -- no matter how obscure -= - but only a few ever get loaded. I believe that s6-rc-bundle is the tool used to edit the bundles: https://www.skarnet.org/software/s6-rc/s6-rc-bundle.html I haven't actually tried this myself, but perhaps it might help. Changing = the contents of bundles seems like a much less-violent action to take at boot t= ime, with fewer possible failure modes. If you go this route, there is a fork in the road. Assuming you're using s6-linux-init, - The easy route: in a perfect world you'd do this boot-time detection from within `rc.init`, before invoking `s6-rc start $DEFAULT_BUNDLE`. Unfortunately at that point you probably don't have anything mounted read-write (except /run), haven't started your hotplug daemon (e.g. mdevd= ), and haven't done a coldplug yet. So the easy route might not work. - The hard route: remember that s6-rc's locks are *not* reentrant! You will have to think very carefully about what locks are held with s6-rc-bundle = is called, and whether or not to use its `-b` flag. Don't try to use s6-rc = tools from within a oneshot. - a