]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: stop systemd-journald before systemd-soft-reboot.service 32975/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 22 May 2024 15:03:42 +0000 (00:03 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 22 May 2024 15:08:14 +0000 (00:08 +0900)
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

index 2b340f4ea7128bedc026cd2c3a4de383d796dac3..96362f5730ac754f04c37df22fc3d272060ef72b 100644 (file)
@@ -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