diff --git a/mkosi.conf b/mkosi.conf index d6bf53ee46..0f2705f5fc 100644 --- a/mkosi.conf +++ b/mkosi.conf @@ -37,6 +37,7 @@ KernelCommandLine=systemd.crash_shell SYSTEMD_ENABLE_LOG_CONTEXT=yes [Host] +Credentials=journal.storage=persistent @Incremental=yes @RuntimeBuildSources=yes @QemuSmp=2 diff --git a/mkosi.images/system/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf b/mkosi.images/system/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf deleted file mode 100644 index 2f953290d3..0000000000 --- a/mkosi.images/system/mkosi.extra/usr/lib/systemd/journald.conf.d/50-persistent.conf +++ /dev/null @@ -1,8 +0,0 @@ -# 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 diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py index 2d2fba25eb..1e003342df 100755 --- a/test/integration-test-wrapper.py +++ b/test/integration-test-wrapper.py @@ -110,6 +110,7 @@ def main(): f"SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-{args.test_number}.units:/usr/lib/systemd/tests/testdata/units:", f"systemd.unit={test_unit}", ]), + '--credential', f"journal.storage={'persistent' if sys.stderr.isatty() else 'runtime'}" , *args.mkosi_args, 'qemu', *(['-no-reboot'] if not sys.stderr.isatty() else [])