Re: restarting s6-svscan (as pid 1)

From: Laurent Bercot <ska-supervision_at_skarnet.org>
Date: Sat, 18 Nov 2023 00:58:22 +0000

>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
Received on Sat Nov 18 2023 - 01:58:22 CET

This archive was generated by hypermail 2.4.0 : Sat Nov 18 2023 - 01:58:53 CET