From 05c53d25786bb2683f1ceeaa6bf3ee5fbea52a97 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 29 Jun 2021 14:10:59 -0400 Subject: [PATCH] overlay/05core: Set systemd LogColor=false We deploy on servers. The ANSI colors codes in the console output often end up in e.g. log files where they both make the logs hard to read *and* they make log files invalid UTF-8. This file needs to be created in both the real root and the initramfs, so extend our `99journald-conf` to be `99systemd-conf`. --- .../00-journal-log-forwarding.conf | 0 .../dracut/modules.d/99systemd-conf/10-coreos-nocolor.conf | 6 ++++++ .../{99journal-conf => 99systemd-conf}/module-setup.sh | 3 +++ .../usr/lib/systemd/system.conf.d/10-coreos-nocolor.conf | 6 ++++++ 4 files changed, 15 insertions(+) rename overlay.d/05core/usr/lib/dracut/modules.d/{99journal-conf => 99systemd-conf}/00-journal-log-forwarding.conf (100%) create mode 100644 overlay.d/05core/usr/lib/dracut/modules.d/99systemd-conf/10-coreos-nocolor.conf rename overlay.d/05core/usr/lib/dracut/modules.d/{99journal-conf => 99systemd-conf}/module-setup.sh (65%) create mode 100644 overlay.d/05core/usr/lib/systemd/system.conf.d/10-coreos-nocolor.conf diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/99journal-conf/00-journal-log-forwarding.conf b/overlay.d/05core/usr/lib/dracut/modules.d/99systemd-conf/00-journal-log-forwarding.conf similarity index 100% rename from overlay.d/05core/usr/lib/dracut/modules.d/99journal-conf/00-journal-log-forwarding.conf rename to overlay.d/05core/usr/lib/dracut/modules.d/99systemd-conf/00-journal-log-forwarding.conf diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/99systemd-conf/10-coreos-nocolor.conf b/overlay.d/05core/usr/lib/dracut/modules.d/99systemd-conf/10-coreos-nocolor.conf new file mode 100644 index 0000000000..e750ac813c --- /dev/null +++ b/overlay.d/05core/usr/lib/dracut/modules.d/99systemd-conf/10-coreos-nocolor.conf @@ -0,0 +1,6 @@ +# We deploy on servers. The ANSI colors codes in the console +# output often end up in e.g. log files where they both +# make the logs hard to read *and* they make log files +# invalid UTF-8. +[Manager] +LogColor=false diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/99journal-conf/module-setup.sh b/overlay.d/05core/usr/lib/dracut/modules.d/99systemd-conf/module-setup.sh similarity index 65% rename from overlay.d/05core/usr/lib/dracut/modules.d/99journal-conf/module-setup.sh rename to overlay.d/05core/usr/lib/dracut/modules.d/99systemd-conf/module-setup.sh index e6626b2899..8955515cb1 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/99journal-conf/module-setup.sh +++ b/overlay.d/05core/usr/lib/dracut/modules.d/99systemd-conf/module-setup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Configuration for systemd in the initramfs. # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh @@ -7,6 +8,8 @@ depends() { } install() { + inst_simple "$moddir/10-coreos-nocolor.conf" \ + "/etc/systemd/system.conf.d/00-coreos-nocolor.conf" inst_simple "$moddir/00-journal-log-forwarding.conf" \ "/etc/systemd/journald.conf.d/00-journal-log-forwarding.conf" } diff --git a/overlay.d/05core/usr/lib/systemd/system.conf.d/10-coreos-nocolor.conf b/overlay.d/05core/usr/lib/systemd/system.conf.d/10-coreos-nocolor.conf new file mode 100644 index 0000000000..e750ac813c --- /dev/null +++ b/overlay.d/05core/usr/lib/systemd/system.conf.d/10-coreos-nocolor.conf @@ -0,0 +1,6 @@ +# We deploy on servers. The ANSI colors codes in the console +# output often end up in e.g. log files where they both +# make the logs hard to read *and* they make log files +# invalid UTF-8. +[Manager] +LogColor=false