Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
serial-log: Do not fail when tty is unavailable
I don't like the fact, that on most systems `systemctl status` shows the state as degraded and that we have irrelevant entries in the journal, just because we don't have a functioning ttyS1 available. Regard serial.log\@ as a "best effort" service, which continuously tries to work with the device and just waits a bit on failure. Use an external command for the loop instead of abusing the service restart feature of systemd for that.
- Loading branch information
Showing
3 changed files
with
17 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#! /bin/bash | ||
|
||
(($#==1)) || { echo "usage: $0 device-name" >&2; exit 1; } | ||
|
||
devnam="$1" | ||
|
||
while true; do | ||
until /usr/bin/stty -F "/dev/$devnam" 115200 -echo 2>/dev/null; do | ||
sleep 60 | ||
done | ||
until cat "/dev/$devnam" >> /var/log/$devnam.log 2>&1;do | ||
sleep 1 | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters