From 7ae27cefd7340072aed83f391d788f2e7e14dce7 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 25 May 2024 06:09:52 +0900 Subject: [PATCH] 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. --- units/systemd-journal-flush.service | 3 +++ 1 file changed, 3 insertions(+) diff --git a/units/systemd-journal-flush.service b/units/systemd-journal-flush.service index 13c3985ed3c..bd098e697b1 100644 --- a/units/systemd-journal-flush.service +++ b/units/systemd-journal-flush.service @@ -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 -- 2.47.3