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 26488 invoked from network); 23 Oct 2020 17:04:07 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 23 Oct 2020 17:04:07 -0000 Received: (qmail 5954 invoked by uid 89); 23 Oct 2020 17:04:33 -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 5947 invoked from network); 23 Oct 2020 17:04:33 -0000 From: "Laurent Bercot" To: "Steve Litt" , supervision@list.skarnet.org Subject: Re: Can you use s6-rc with the sysvinit PID1? Date: Fri, 23 Oct 2020 17:04:07 +0000 Message-Id: In-Reply-To: <20201023124847.66962dcb@mydesk.domain.cxm> References: <20201023124847.66962dcb@mydesk.domain.cxm> Reply-To: "Laurent Bercot" User-Agent: eM_Client/8.0.3385.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: gggruggvucftvghtrhhoucdtuddrgedujedrkedtgddutdekucetufdoteggodftvfcurfhrohhfihhlvgemucfpfgfogfftkfevteeunffgpdfqfgfvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjghfrhgfgggtgfesthhqredttderjeenucfhrhhomhepfdfnrghurhgvnhhtuceuvghrtghothdfuceoshhkrgdqshhuphgvrhhvihhsihhonhesshhkrghrnhgvthdrohhrgheqnecuggftrfgrthhtvghrnhepkeffleehgfejuefgleefhfetudffjeeghedthffgveetteevtdefgeeggfeuheffnecuffhomhgrihhnpehfohigkhhithdruhhsnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuth >If I use sysvinit's PID1, is it possible for me to use s6-rc by >declaring an s6-rc program in /etc/inittab? Yes. You have to tell /etc/inittab to launch a s6 supervision tree first, then s6-rc-init, then s6-rc -u change top (if "top" is the bundle containing all the services you need), as one-time services. There is an example with OpenRC in Ad=C3=A9lie: a sysvinit init, that controls a s6 supervision tree then runs an openrc service manager. =20 https://code.foxkit.us/adelie/packages/-/blob/master/system/sysvinit/initta= b-2.88 (The s6-svscanboot code is in the same directory in the repository.) If you remove the 'openrc sysinit' and 'openrc boot' lines, and change the 'openrc $runlevel' lines below to 's6-rc change=20 $runlevel' invocations, then you will have a s6-rc managed system running on top of sysvinit. However, it's much more work to convert a set of init scripts to s6-rc than it is to switch from sysvinit to s6-linux-init, so you may just as well switch to s6-linux-init first and spare yourself some unnecessary work and some ugly init code. ;) >Also, and this is offtopic, is there a way to tell sysvinit not to run >the programs in /etc/rc.d/rc3.d or whatever? This would make it trivial >to switch between an sysvinit initted system and an s6-rc/s6 supervised >system just by commenting in or out the inittab entry and switching >sysvinit to looop /etc/rc.d/rc3.d? You can just comment out the lines you don't want in /etc/inittab. However, controlling init via a file is awkward and fragile, and you may find yourself performing a lot of scripting (and making your system unbootable and having to recover via init=3D/bin/sh once or twice), which is another reason why s6-svscan makes a better pid 1. -- Laurent