Re: Can you use s6-rc with the sysvinit PID1?

From: Colin Booth <colin_at_heliocat.net>
Date: Sat, 24 Oct 2020 05:25:53 +0000

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
Received on Sat Oct 24 2020 - 05:25:53 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC