From 03a41c41eedf6e45c312b3fcc6f5822e0aa43871 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 22 May 2024 23:53:13 +0900 Subject: [PATCH 1/3] Revert "units: do not soft-reboot before soft-reboot.target reached" This reverts commit 4263d7617f0e6ea741e227db223ac6085479165f. Still I think this is the way to go. But the change was merged after -rc2, and still discussion is continued. So, at least now let's revert it, and do that after v256-final is released if approved. --- units/soft-reboot.target | 4 +--- units/systemd-soft-reboot.service | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/units/soft-reboot.target b/units/soft-reboot.target index 4bca192454..6a6c772875 100644 --- a/units/soft-reboot.target +++ b/units/soft-reboot.target @@ -11,10 +11,8 @@ Description=Reboot System Userspace Documentation=man:systemd.special(7) DefaultDependencies=no -Requires=shutdown.target umount.target final.target -After=shutdown.target umount.target final.target Requires=systemd-soft-reboot.service -Before=systemd-soft-reboot.service +After=systemd-soft-reboot.service AllowIsolate=yes JobTimeoutSec=30min JobTimeoutAction=soft-reboot-force diff --git a/units/systemd-soft-reboot.service b/units/systemd-soft-reboot.service index da9f463821..35ba3a9fc4 100644 --- a/units/systemd-soft-reboot.service +++ b/units/systemd-soft-reboot.service @@ -11,5 +11,6 @@ Description=Reboot System Userspace Documentation=man:systemd-soft-reboot.service(8) DefaultDependencies=no -Requires=soft-reboot.target +Requires=shutdown.target umount.target final.target +After=shutdown.target umount.target final.target SuccessAction=soft-reboot-force From a328b24edde9c6fa79b0a4852ed2133f6b3562d8 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 22 May 2024 23:59:32 +0900 Subject: [PATCH 2/3] man: swap the order of soft-reboot.service and .target Follow-up for the previous revert commit. --- man/bootup.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/bootup.xml b/man/bootup.xml index cf237dba52..c942bab344 100644 --- a/man/bootup.xml +++ b/man/bootup.xml @@ -324,11 +324,11 @@ systemd-reboot.service | | | | v | v | poweroff.target | systemd-kexec.service | v | | - halt.target | soft-reboot.target + halt.target | systemd-soft-reboot.service v | kexec.target | v - systemd-soft-reboot.service + soft-reboot.target Commonly used system shutdown targets are emphasized. From 37143fdf5a354123a9dca46ca690e7792d30bee9 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 23 May 2024 00:03:42 +0900 Subject: [PATCH 3/3] units: stop systemd-journald before systemd-soft-reboot.service Typically, soft-reboot.target is never reached. So, without this change, systemd-journald may be killed by PID1 on soft-reboot, and may cause journal corruption. --- units/systemd-journald.service.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in index 2b340f4ea7..96362f5730 100644 --- a/units/systemd-journald.service.in +++ b/units/systemd-journald.service.in @@ -17,7 +17,10 @@ Before=sysinit.target # To avoid journald SIGKILLed during soft-reboot and corrupting journals. # See https://github.com/systemd/systemd/issues/30195 -Before=soft-reboot.target +# Note, typically soft-reboot.target will be never reached, +# and systemd-soft-reboot.service will trigger soft-reboot. +# Hence, this must be stopped before systemd-soft-reboot.service. +Before=soft-reboot.target systemd-soft-reboot.service Conflicts=soft-reboot.target # Mount and swap units need the journal socket units. If they were removed by