Skip to content

Commit

Permalink
systemd/serial-log@: Do not fail, if serial port is not working
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
pmenzel committed Feb 21, 2018
1 parent d50a30f commit f75445e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions misc_systemd_units/serial-log@.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f75445e

Please sign in to comment.