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: dan@telent.net, supervision@list.skarnet.org
Subject: Re: restarting s6-svscan (as pid 1)
Date: Sat, 18 Nov 2023 00:58:22 +0000	[thread overview]
Message-ID: <em4359e08d-9fb7-4801-86b3-cfafb0e09eb6@37ff2605.com> (raw)
In-Reply-To: <871qco81jj.fsf@telent.net>

>This may be a weird question, maybe: is there any way to persuade
>s6-svscan (as pid 1) to restart _without_ doing a full hardware reboot?
>The use case I have in mind is: starting from a regular running system,
>I want to create a small "recovery" system in a ramdisk and switch to it
>with pivot_root so that the real root filesystem can be unmounted and
>manipulated. (This is instead of "just" doing a full reboot into an
>initramfs: the device has limited storage space and keeping a couple
>of MB around permanently just for "maintenance mode" doesn't seem like a
>great use of it)

  As Adam said, this is exactly what .s6-svscan/finish is for. If your
setup somehow requires s6-svscan to exec into something else before
you shut the machine down, .s6-svscan/finish is the hook you have to
make it work.
  Don't let the naming stop you. The way to get strong supervision with
BSD init is to list your services in /etc/ttys. You can't get any
cheesier than that.

  That said, I'm not sure your goal is as valuable as you think it is.
If you have a running system, by definition, it's running. It has 
booted,
and you have access to its rootfs and all the tools on it; there is
nothing to gain by doing something fragile such as exec'ing into
another pid 1 and pivot_rooting. Unless I've missed something, the
amount of space you'll need for your maintenance system will be the
exact same whether you switch to it from your production system or from
cold booting.

--
  Laurent


  parent reply	other threads:[~2023-11-18  0:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17 22:20 dan
2023-11-17 22:38 ` adam
2023-11-17 22:45 ` Steve Litt
2023-11-18  0:58 ` Laurent Bercot [this message]
2023-11-19  0:31   ` Daniel Barlow
2023-11-19  1:46     ` Laurent Bercot

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=em4359e08d-9fb7-4801-86b3-cfafb0e09eb6@37ff2605.com \
    --to=ska-supervision@skarnet.org \
    --cc=dan@telent.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
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).