]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
unit: also stop systemd-journal-flush.service on soft-reboot
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 24 May 2024 21:09:52 +0000 (06:09 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 25 May 2024 18:11:24 +0000 (03:11 +0900)
After soft-reboot, /var/log/journal may be initially read-only,
and becomes writable a bit later. In such case, runtime journal is
initially opened by journald. Hence, we need to flush to /var when it is
ready.

units/systemd-journal-flush.service

index 13c3985ed3c3521c20a531aa93c593e124aed332..bd098e697b174d7939ac0a5f4243d93810e74075 100644 (file)
@@ -20,6 +20,9 @@ Wants=systemd-journald.service
 After=systemd-journald.service
 RequiresMountsFor=/var/log/journal
 
+Before=soft-reboot.target systemd-soft-reboot.service
+Conflicts=soft-reboot.target
+
 [Service]
 ExecStart=journalctl --flush
 ExecStop=journalctl --smart-relinquish-var