supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Laurent Bercot" <ska-supervision@skarnet.org>
To: "Steve Litt" <slitt@troubleshooters.com>, supervision@list.skarnet.org
Subject: Re: Can you use s6-rc with the sysvinit PID1?
Date: Fri, 23 Oct 2020 17:04:07 +0000	[thread overview]
Message-ID: <em64ee17d7-4a2d-4dba-900b-ba25e1165ab1@elzian> (raw)
In-Reply-To: <20201023124847.66962dcb@mydesk.domain.cxm>

>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


  reply	other threads:[~2020-10-23 17:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 16:48 Steve Litt
2020-10-23 17:04 ` Laurent Bercot [this message]
2020-10-24  5:25 ` Colin Booth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=em64ee17d7-4a2d-4dba-900b-ba25e1165ab1@elzian \
    --to=ska-supervision@skarnet.org \
    --cc=slitt@troubleshooters.com \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).