Skip to content

Commit

Permalink
misc_systetmd_units: Add service unit for logging over serial console
Browse files Browse the repository at this point in the history
This service unit file was added to the system in June to be able to log Linux
Kernel crashes. Put it under version control.

```
$ ls -l --full-time /etc/systemd/system/serial-log@.service
-rw-r--r-- 1 root system 254 2017-06-23 10:24:55.000000000 +0200 /etc/systemd/system/serial-log@.service
```
  • Loading branch information
pmenzel committed Feb 21, 2018
1 parent cf564b5 commit d50a30f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ install_exec make-automaps/make-automaps "$DESTDIR$usr_sbindir/make-aut
install_data misc_systemd_units/automount.service "$DESTDIR$systemdunitdir/automount.service"
install_data misc_systemd_units/gdm.service "$DESTDIR$systemdunitdir/gdm.service"
install_data misc_systemd_units/lazy-umount-nfs.service "$DESTDIR$systemdunitdir/lazy-umount-nfs.service"
install_data misc_systemd_units/serial-log@.service "$DESTDIR$systemdunitdir/serial-log@.service"
install_exec mxgrub/mxgrub "$DESTDIR$usr_sbindir/mxgrub"
install_exec mxnetctl/mxnetctl "$DESTDIR$usr_sbindir/mxnetctl"
install_exec mxrouter/mxrouterctl "$DESTDIR$usr_sbindir/mxrouterctl"
Expand Down
13 changes: 13 additions & 0 deletions misc_systemd_units/serial-log@.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
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"
Type=idle
Restart=always
RestartSec=0
UtmpIdentifier=%I

[Install]
WantedBy=basic.target

0 comments on commit d50a30f

Please sign in to comment.