summaryrefslogtreecommitdiff
path: root/units/systemd-journal-flush.service
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-05-21 10:53:25 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-05-22 15:58:40 +0900
commitfe7f113c1331e11af4e9f815d7305c8b1b332312 (patch)
tree1fe72022a3fdf5b60abacc31f8412ecca1b5bc2f /units/systemd-journal-flush.service
parent05576809194754989f88f83c7104341c35944546 (diff)
downloadsystemd-fe7f113c1331e11af4e9f815d7305c8b1b332312.tar.gz
units: skip some units in the initrd
I'm working on building initramfs images directly from normal packages, and it doesn't make sense for those units to be started. Pristine system rpms need to behave correctly as much as possible also in the initrd, and those units are enabled by the rpms. There usually isn't enough time for the timer to actually fire, but starting it gives a line on the console and generally looks confusing and sloppy. Flushing the journal means that its actually lost, since the real /var is not available yet. Another approach would be not enable those units, but right now they are statically enabled, and changing that would be more work, and doesn't really seem necessary, since the condition checks are very quick. Checking for /etc/initrd-release is the standard condition that the initrd units use, so let's do the same here.
Diffstat (limited to 'units/systemd-journal-flush.service')
-rw-r--r--units/systemd-journal-flush.service1
1 files changed, 1 insertions, 0 deletions
diff --git a/units/systemd-journal-flush.service b/units/systemd-journal-flush.service
index 1a71592b93..6423f6ea80 100644
--- a/units/systemd-journal-flush.service
+++ b/units/systemd-journal-flush.service
@@ -15,6 +15,7 @@ Requires=systemd-journald.service
After=systemd-journald.service systemd-remount-fs.service
Before=systemd-tmpfiles-setup.service
RequiresMountsFor=/var/log/journal
+ConditionPathExists=!/etc/initrd-release
[Service]
ExecStart=journalctl --flush