You are not logged in.

#1 2018-08-31 11:13:22

rendaw
Member
Registered: 2016-02-17
Posts: 6

[Solved] ttyS0 regenerated with wrong group

So my headless system boots with ttyS0 working fine, I have agetty attached and am connected via serial cable and telnet from another host.  I ctrl+d out of the session and don't get the login prompt, reconnecting telnet does nothing.  The logs for the agetty show:

Aug 31 20:02:23 ... systemd[1]: Started Serial Getty on ttyS0.
Aug 31 20:02:23 ... agetty[780]: /dev/ttyS0: not a tty
$ ls -l /dev/ttyS*
crw--w---- 1 root tty  4, 64 Aug 31 19:49 /dev/ttyS0
crw-rw---- 1 root uucp 4, 65 Aug 31 19:49 /dev/ttyS1
crw-rw---- 1 root uucp 4, 66 Aug 31 19:49 /dev/ttyS2
crw-rw---- 1 root uucp 4, 67 Aug 31 19:49 /dev/ttyS3

The only thing that appears in dmesg (at all, since booting finished) is an audit log from when I logged in.  Doing chgrp to uucp on it doesn't let agetty work, and the group switched back by the time I checked.

I tried this:

$ sudo udevadm control --log-priority=info
$ sudo udevadm trigger

hoping to regenerate the device, but there were no new messages in dmesg afterward and the group remains tty.  This is where my knowledge breaks down.  I tried deleting ttyS0 + ttyS1, but udevadm trigger won't create new device nodes.

Does anyone have any ideas for what I could try next?  Given the log messages it sounds like the wrong driver is generating the device, which might also explain why the uucp udev rule isn't being run?  But then, it's somehow still getting put in the tty group.

I'm using the kernel options `console=tty0 console=ttyS0,115200n8`.  I see boot and shutdown messages fine, strangely enough.

It's a lean vanilla system that I installed today.  I've barely modified any config files (fstab, sshd_config, ssmtp.conf, ddclient.conf, locale.gen/conf, localtime/hostname/hosts).  Rebooting fixes the issue for a bit, then

Last edited by rendaw (2018-08-31 16:13:05)

Offline

#2 2018-08-31 11:51:52

rendaw
Member
Registered: 2016-02-17
Posts: 6

Re: [Solved] ttyS0 regenerated with wrong group

Well now I see that for some reason "service-getty@ttyS0.service" was also started somehow.  I haven't enabled it - it says

● serial-getty@ttyS0.service - Serial Getty on ttyS0
   Loaded: loaded (/usr/lib/systemd/system/serial-getty@.service; enabled-runtime; vendor preset: disabled)

Disabling it seems to have stopped my agetty serial tty service from dumping errors, and I'm reconnecting fine.  Perhaps that also explained some strange prompt duplication I was seeing before too... The ttyS0 dev node group is still tty, but at least it doesn't seem to be breaking anything.

Anyway, I'm not sure what "enabled-runtime" means or why the extra service was starting but I wanted to post this before wasting anyone's time.  Back to digging through documentation and trying random stuff.

Last edited by rendaw (2018-08-31 11:56:03)

Offline

#3 2018-08-31 16:12:51

rendaw
Member
Registered: 2016-02-17
Posts: 6

Re: [Solved] ttyS0 regenerated with wrong group

Ack, logged out while typing a reply.

Long story short, this getty-generator service automatically starts (serial-)getty@'s for everything defined in the boot kernel console= options.  "enabled-runtime" means that - it's automatically started, but not by systemd so you can't disable it with "systemctl disable".

I ended up making an override for the serial-getty@ unit rather than using my custom service, which seems to be working okay.

Offline

Board footer

Powered by FluxBB