From 13ffc60749df0ca7c76cfcac317b41a05679b364 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 27 Apr 2023 17:23:18 +0200 Subject: pid1: add "soft-reboot" reboot method This adds a new mechanism for rebooting, a form of "userspace reboot" hereby dubbed "soft-reboot". It will stop all services as in a usual shutdown, possibly transition into a new root fs and then issue a fresh initial transaction. The kernel is not replaced. File descriptors can be passed over, thus opening the door for leaving certain resources around between such reboots. Usecase: this is an extremely quick way to reset userspace fully when updating image based systems, without going through a full hardware/firmware/boot loader/kernel/initrd cycle. It minimizes "grayout time" for OS updates. (In particular when combined with kernel live patching) --- units/soft-reboot.target | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 units/soft-reboot.target (limited to 'units/soft-reboot.target') diff --git a/units/soft-reboot.target b/units/soft-reboot.target new file mode 100644 index 0000000000..6a6c772875 --- /dev/null +++ b/units/soft-reboot.target @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Reboot System Userspace +Documentation=man:systemd.special(7) +DefaultDependencies=no +Requires=systemd-soft-reboot.service +After=systemd-soft-reboot.service +AllowIsolate=yes +JobTimeoutSec=30min +JobTimeoutAction=soft-reboot-force -- cgit v1.2.3