Fighting with serial
Early entry so I can get this bit about serial console out of the way.
So I was fighting with RH8 serial console today. Here’s my /etc/grub.conf:
serial --unit=0 --speed=9600 terminal console serial default=0 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz password --md5 ... title Red Hat Linux (2.4.18-17.8.0) root (hd0,0) kernel /vmlinuz-2.4.18-17.8.0 ro root=/dev/md2 hdc=2434,255,63 console=tty0 console=ttyS0,9600 initrd /initrd-2.4.18-17.8.0.img
(Note that I wrapped the kernel line for readability.) Then at
the end of /etc/inittab I’ve got:
S0:12345:respawn:/sbin/agetty 9600 /dev/console vt100
Now initially, per the mingetty(8) man page, I used mgetty. I was using mgetty like so:
S0:12345:respawn:/sbin/mgetty -s 9600 -r -x 9 ttyS0
Hint to Red Hat 8.0 (Psyche) users: don’t use mgetty for serial console. Use agetty instead. agetty comes in the util-linux package which you already have; mgetty you might not, as it comes in its own package. To describe the symptoms that led me to this condition: mgetty would give me the login prompt, but when it went to execute /bin/login, I would cease to get any output on the serial terminal. I could strace login, or mgetty after login died, and I’d see the keystrokes coming through, but they weren’t getting to my serial terminal apparently. Also, an strace of login would show:
ioctl(0, SNDCTL_TMR_CONTINUE, {B9600 opost isig icanon echo ...})
= -1 EINTR (Interrupted system call)
SNDCTL_TMR_CONTINUE is actually TCSETSF, BTW, per
ioctl_list(2). mgetty’s info page describes seemingly the same
problem and provides a solution or two. Here’s excerpts:
mgetty works, /bin/login hangs