systemctl: automatically softreboot/kexec if set up on reboot

Automatically softreboot if the nextroot has been set up with an OS
tree, or automatically kexec if a kernel has been loaded with kexec
--load.

Add SYSTEMCTL_SKIP_AUTO_KEXEC and SYSTEMCTL_SKIP_AUTO_SOFT_REBOOT to
skip the automated switchover.
This commit is contained in:
Luca Boccassi
2023-10-20 11:45:37 +01:00
parent 017e8094f6
commit 665a3d6d15
9 changed files with 54 additions and 19 deletions
+3 -2
View File
@@ -133,9 +133,10 @@ elif [ -f /run/testsuite82.touch ]; then
# Restart the unit that is not supposed to survive
systemd-run --collect --service-type=exec --unit=testsuite-82-nosurvive.service sleep infinity
# Now issue the soft reboot. We should be right back soon.
# Now issue the soft reboot. We should be right back soon. Given /run/nextroot exists, we should
# automatically do a softreboot instead of normal reboot.
touch /run/testsuite82.touch2
systemctl --no-block soft-reboot
systemctl --no-block reboot
# Now block until the soft-boot killing spree kills us
exec sleep infinity