supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Colin Booth <colin@heliocat.net>
To: supervision@list.skarnet.org
Subject: Re: Can you use s6-rc with the sysvinit PID1?
Date: Sat, 24 Oct 2020 05:25:53 +0000
Message-ID: <20201024052553.GC15636@cathexis.xen.prgmr.com> (raw)
In-Reply-To: <20201023124847.66962dcb@mydesk.domain.cxm>

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

      parent reply	other threads:[~2020-10-24  5:26 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
2020-10-24  5:25 ` Colin Booth [this message]

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=20201024052553.GC15636@cathexis.xen.prgmr.com \
    --to=colin@heliocat.net \
    --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

supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/supervision

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 supervision supervision/ http://inbox.vuxu.org/supervision \
		subscribe@list.skarnet.org
	public-inbox-index supervision

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.supervision.general


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git