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 15843 invoked from network); 24 Oct 2020 05:26:01 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 24 Oct 2020 05:26:01 -0000 Received: (qmail 19941 invoked by uid 89); 24 Oct 2020 05:26:22 -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 19934 invoked from network); 24 Oct 2020 05:26:22 -0000 Date: Sat, 24 Oct 2020 05:25:53 +0000 From: Colin Booth To: supervision@list.skarnet.org Subject: Re: Can you use s6-rc with the sysvinit PID1? Message-ID: <20201024052553.GC15636@cathexis.xen.prgmr.com> References: <20201023124847.66962dcb@mydesk.domain.cxm> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201023124847.66962dcb@mydesk.domain.cxm> User-Agent: Mutt/1.10.1 (2018-07-13) On Fri, Oct 23, 2020 at 12:48:47PM -0400, Steve Litt wrote: > Hi all, > > If I use sysvinit's PID1, is it possible for me to use s6-rc by > declaring an s6-rc program in /etc/inittab? > > 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? > > Thanks, > > SteveT > Yes. In your /etc/inittab call a script that backgrounds the rc call hanging on some event. Here's an execline fragment that'll do what you want, though it could obviously be made a lot better by taking advantage of the native readyness notification that s6-svscan provides instead of sleeping for a second. background { foreground { sleep 1 } foreground { s6-rc-init /path/to/scandir } s6-rc change up } s6-svscan /path/to/scandir Jam that into the startup script that you use for booting your supervision tree and you'll be good to go. -- Colin Booth