summaryrefslogtreecommitdiffstats
path: root/units
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-05-24 23:09:52 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-05-25 20:11:24 +0200
commit7ae27cefd7340072aed83f391d788f2e7e14dce7 (patch)
treee2f807335ebf9c2e60d22f700d8676c1b52015d9 /units
parentjournald: always unset flushed flag when the runtime journal is opened (diff)
downloadsystemd-7ae27cefd7340072aed83f391d788f2e7e14dce7.tar.xz
systemd-7ae27cefd7340072aed83f391d788f2e7e14dce7.zip
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.
Diffstat (limited to 'units')
-rw-r--r--units/systemd-journal-flush.service3
1 files changed, 3 insertions, 0 deletions
diff --git a/units/systemd-journal-flush.service b/units/systemd-journal-flush.service
index 13c3985ed3..bd098e697b 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