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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28276 invoked from network); 17 Nov 2023 22:20:51 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 17 Nov 2023 22:20:51 -0000 Received: (qmail 43656 invoked by uid 89); 17 Nov 2023 22:21:14 -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 43647 invoked from network); 17 Nov 2023 22:21:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=telent.net; s=mail; t=1700259645; bh=g79j29Ku2qAvjh/PmStkc0ArdJVxADeD67vYXWAq9FU=; h=From:To:Subject:Date; b=Da2oEi2/b6wC8cjnW7WinJqA+OIRUwHgaKVRjs0ZsdyjoMNwQpVrfy1Nff0SOQyMR Hkq07kQ4Rwma6iqNjwziSqXXZBBeMrji6JFqa+1OqKqkQsuMcnzHKgl+9UsQ6DpS8d 9FmWMHkaVsyygeIItHF6aSgylaFV2C2CJU6lJ0P4= From: dan@telent.net To: supervision@list.skarnet.org Subject: restarting s6-svscan (as pid 1) Date: Fri, 17 Nov 2023 22:20:32 +0000 Message-ID: <871qco81jj.fsf@telent.net> MIME-Version: 1.0 Content-Type: text/plain 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