From f75445e56cb92d951a251eb52b19450e3e692cf0 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Wed, 21 Feb 2018 14:25:36 +0100 Subject: [PATCH] systemd/serial-log@: Do not fail, if serial port is not working Currently, the service shows up as failed on systems where the serial console is not working. As this is expected on several of our systems, do not list the service unit as failed. ``` $ ls -l /dev/ttyS1 crw-rw---- 1 root dialout 4, 65 Feb 21 13:10 /dev/ttyS1 $ sudo /usr/bin/stty -F /dev/ttyS1 115200 -echo /usr/bin/stty: /dev/ttyS1: Input/output error ``` --- misc_systemd_units/serial-log@.service | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc_systemd_units/serial-log@.service b/misc_systemd_units/serial-log@.service index 5f0c878a..41782aaa 100644 --- a/misc_systemd_units/serial-log@.service +++ b/misc_systemd_units/serial-log@.service @@ -2,8 +2,7 @@ Description=TTY logger [Service] -ExecStartPre=/usr/bin/stty -F /dev/%I 115200 -echo -ExecStart=-/usr/bin/sh -c "/usr/bin/cat /dev/%I >> /var/log/%I.log 2>&1" +ExecStart=-/usr/bin/sh -c "/usr/bin/stty -F /dev/%I 115200 -echo && /usr/bin/cat /dev/%I >> /var/log/%I.log 2>&1" Type=idle Restart=always RestartSec=0