From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5530 invoked from network); 18 Nov 2023 00:58:25 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 18 Nov 2023 00:58:25 -0000 Received: (qmail 47525 invoked by uid 89); 18 Nov 2023 00:58:50 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 47518 invoked from network); 18 Nov 2023 00:58:49 -0000 From: "Laurent Bercot" 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 Message-Id: In-Reply-To: <871qco81jj.fsf@telent.net> References: <871qco81jj.fsf@telent.net> Reply-To: "Laurent Bercot" User-Agent: eM_Client/9.2.2093.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable >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=20 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