From 139b6fb16f9a3699db55a4eb66426df165a4bcf8 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 22 May 2023 13:33:01 +0200 Subject: [PATCH] mkosi: Make sure persistent journal storage is enabled We ship with empty /var, so /var/log/journal does not exist, which means journald does not do persistent logging. Let's fix that by setting the config to explicitly enable persistent logging. --- .../usr/lib/systemd/journald.conf.d/50-persistent.conf | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 mkosi.presets/20-final/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf diff --git a/mkosi.presets/20-final/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf b/mkosi.presets/20-final/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf new file mode 100644 index 00000000000..2f953290d36 --- /dev/null +++ b/mkosi.presets/20-final/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +# We only ship /usr in the image so /var/log/journal won't exist on boot which means systemd-journald won't +# persist any logs as the default Storage= setting is "auto". We can't create /var/log/journal using tmpfiles +# as systemd-journal-flush.service runs before systemd-tmpfiles-setup.service so instead we explicitly set +# Storage= to persistent to have systemd-journald create /var/log/journal itself. +[Journal] +Storage=persistent