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

From: Laurent Bercot <ska-supervision_at_skarnet.org>
Date: Fri, 23 Oct 2020 17:04:07 +0000

>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élie: a sysvinit init, that
controls a s6 supervision tree then runs an openrc service manager.
  
https://code.foxkit.us/adelie/packages/-/blob/master/system/sysvinit/inittab-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
$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=/bin/sh once or
twice), which is another reason why s6-svscan makes a better pid 1.

--
  Laurent
Received on Fri Oct 23 2020 - 17:04:07 UTC

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