From 9c4670db3cb1635a5e171060371e04bf0686c5d6 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 30 Nov 2024 04:31:45 +0900 Subject: [PATCH] mkosi: move setting for journald to mkosi.extra --- .../systemd-journald.service.d/10-stdout-tty.conf | 8 ++++++++ mkosi.sanitizers/mkosi.postinst | 11 ----------- 2 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 mkosi.sanitizers/mkosi.extra/etc/systemd/system/systemd-journald.service.d/10-stdout-tty.conf diff --git a/mkosi.sanitizers/mkosi.extra/etc/systemd/system/systemd-journald.service.d/10-stdout-tty.conf b/mkosi.sanitizers/mkosi.extra/etc/systemd/system/systemd-journald.service.d/10-stdout-tty.conf new file mode 100644 index 0000000000000..c6a2681e3f0c2 --- /dev/null +++ b/mkosi.sanitizers/mkosi.extra/etc/systemd/system/systemd-journald.service.d/10-stdout-tty.conf @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +[Service] +# Sanitizers log to stderr by default. However, journald's stderr is connected +# to /dev/null, so we lose all the sanitizer logs. To rectify that, let's +# connect journald's stdout to kmsg so that the sanitizer failures end up in the +# journal. +StandardOutput=kmsg diff --git a/mkosi.sanitizers/mkosi.postinst b/mkosi.sanitizers/mkosi.postinst index a6b529a4d6cb0..e83d05c6bc92f 100755 --- a/mkosi.sanitizers/mkosi.postinst +++ b/mkosi.sanitizers/mkosi.postinst @@ -9,17 +9,6 @@ if [[ ! -f "$BUILDROOT/$LIBSYSTEMD" ]]; then exit 0 fi -# Sanitizers log to stderr by default. However, journald's stderr is connected to /dev/null, so we lose -# all the sanitizer logs. To rectify that, let's connect journald's stdout to kmsg so that the sanitizer -# failures end up in the journal. -if [[ -f "$BUILDROOT"/usr/lib/systemd/system/systemd-journald.service ]]; then - mkdir -p "$BUILDROOT"/etc/systemd/system/systemd-journald.service.d - cat >"$BUILDROOT"/etc/systemd/system/systemd-journald.service.d/10-stdout-tty.conf <