Running a serial login terminal under systemd

TL;DR:

$ sudo systemctl edit serial-getty@ttyUSB0
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -- \\u' 115200 %I $TERM
StandardInput=null
StandardOutput=journal
TTYPath=
TTYReset=no
TTYVHangup=no

From the other node:

$ tio /dev/ttyUSB0

I have a MINI PC in the comm area which hosts a few useful services at home. I got tired of how unstable the Raspberry Pi is, so replaced it with something that is almost as power efficient, but runs orders of magnitude faster. With support for both an SSD and an NVMe I can have software RAID for extra reliability.

The problem is that the onboard network (something based on RTL8111) insists on running at 100M and keeps flapping up and down. Got tired of troubleshooting it so got a USB network adapter which runs at 1G and is much more stable. Recently I noticed that the link would die, and as I have no way of getting into the machine easily to troubleshoot, I decided to give it a serial console.

Got a male USB to serial converter, and another female USB to serial converter for the other node. What I thought should be a matter of `sudo systemctl enable --now serial-getty@ttyUSB0` did not work. Following most online advice to change the `ExecStart` also did not work. It seems that a recent change to systemd to manage the serial port and connect the agetty process to it is not working as expected, so my fix is to revert it to the previous behavior. Just put the `TTY` related settings back to their defaults in the override drop-in and that's it.

Comments

Popular posts from this blog

FreeIPA cluster with containers

ADSL Router Model CT-5367 user and pass (VIVACOM)

Installing Gentoo with full disk encryption