summaryrefslogtreecommitdiffstats
path: root/units/systemd-soft-reboot.service
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-04-27 17:23:18 +0200
committerLennart Poettering <lennart@poettering.net>2023-06-02 16:49:38 +0200
commit13ffc60749df0ca7c76cfcac317b41a05679b364 (patch)
tree4d6950e83bf28fcc39b04f9d37816993187b6a89 /units/systemd-soft-reboot.service
parentMerge pull request #27849 from DaanDeMeyer/sign-pcr (diff)
downloadsystemd-13ffc60749df0ca7c76cfcac317b41a05679b364.tar.xz
systemd-13ffc60749df0ca7c76cfcac317b41a05679b364.zip
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)
Diffstat (limited to 'units/systemd-soft-reboot.service')
-rw-r--r--units/systemd-soft-reboot.service16
1 files changed, 16 insertions, 0 deletions
diff --git a/units/systemd-soft-reboot.service b/units/systemd-soft-reboot.service
new file mode 100644
index 0000000000..35ba3a9fc4
--- /dev/null
+++ b/units/systemd-soft-reboot.service
@@ -0,0 +1,16 @@
+# 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-soft-reboot.service(8)
+DefaultDependencies=no
+Requires=shutdown.target umount.target final.target
+After=shutdown.target umount.target final.target
+SuccessAction=soft-reboot-force