From d8f4ea875752263a423f2e242176aa7d4c449f6e Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Thu, 3 Dec 2020 23:11:49 -0500 Subject: [PATCH] 99emergency-timeout: fix log display from failed units MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit timeout.sh was getting confused by systemctl output that looked like this: ● ignition-disks.service loaded failed failed Ignition (disks) The result was output like this: Displaying logs from failed units: ● Invalid unit name "●" escaped as "\xe2\x97\x8f" (maybe you should use systemd-escape?). -- Logs begin at Fri 2020-12-04 04:09:20 UTC, end at Fri 2020-12-04 04:09:33 UTC. -- -- No entries -- Press Enter for emergency shell or wait 5 minutes for reboot. --- .../usr/lib/dracut/modules.d/99emergency-timeout/timeout.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/99emergency-timeout/timeout.sh b/overlay.d/05core/usr/lib/dracut/modules.d/99emergency-timeout/timeout.sh index 935935433c..85fb3d761d 100644 --- a/overlay.d/05core/usr/lib/dracut/modules.d/99emergency-timeout/timeout.sh +++ b/overlay.d/05core/usr/lib/dracut/modules.d/99emergency-timeout/timeout.sh @@ -29,7 +29,7 @@ _prompt_for_timeout() { if [[ -e /.emergency-shell-confirmed ]]; then return fi - failed=$(systemctl --failed --no-legend | cut -f 1 -d ' ') + failed=$(systemctl --failed --no-legend --plain | cut -f 1 -d ' ') if [ -n "${failed}" ]; then # Something failed, suppress kernel logs so that it's more likely # the useful bits from the journal are available.