units: do not soft-reboot before soft-reboot.target reached

Otherwise, at the time systemd-soft-reboot.service succeeds,
services which has Conflicts= and Before=soft-reboot.target may
not be stopped yet, and may be SIGKILLed.

Especially, systemd-journald.service has the dependencies, thus
journal may be corrupted. See #32223.

Follow-up for 13ffc60749.

Fixes #32834.
This commit is contained in:
Yu Watanabe 2024-05-17 11:38:16 +09:00
parent 11a55b15bf
commit 4263d7617f
2 changed files with 4 additions and 3 deletions

View file

@ -11,8 +11,10 @@
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
After=systemd-soft-reboot.service
Before=systemd-soft-reboot.service
AllowIsolate=yes
JobTimeoutSec=30min
JobTimeoutAction=soft-reboot-force

View file

@ -11,6 +11,5 @@
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
Requires=soft-reboot.target
SuccessAction=soft-reboot-force