supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* restarting s6-svscan (as pid 1)
@ 2023-11-17 22:20 dan
  2023-11-17 22:38 ` adam
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: dan @ 2023-11-17 22:20 UTC (permalink / raw)
  To: supervision


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)

I was thinking I could use the .svscan/finish script to check for the
existence of the "maintenance mode" ramfs, remount it onto /
and then `exec /bin/init` as its last action, though it seems a bit
cheesy to have a file called `finish` that actually sometimes performs
`single-user-mode` instead. Would that work?

Perhaps a more general use case for re-execing pid 1 would be after OS
upgrades as an alternative to rebooting - though other than wanting to
preserve uptime for bragging rights I can't see any real advantage...

Any thoughts?


Daniel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-19  1:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-17 22:20 restarting s6-svscan (as pid 1) dan
2023-11-17 22:38 ` adam
2023-11-17 22:45 ` Steve Litt
2023-11-18  0:58 ` Laurent Bercot
2023-11-19  0:31   ` Daniel Barlow
2023-11-19  1:46     ` Laurent Bercot

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).