unit: also stop systemd-journal-flush.service on soft-reboot

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.
This commit is contained in:
Yu Watanabe 2024-05-25 06:09:52 +09:00
parent 3148edb254
commit 7ae27cefd7

View 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