Ubuntu Server 12 not spawning a serial ttyS0 when running on Xen
- by segfaultreloaded
I have this problem on more than one host, so the specific hardware is not an issue.
Bare metal Ubuntu 12 is not creating a login process on the only serial port, in the default configuration. The serial port works correctly with the firmware. It works correctly with Grub2. I have even connected the serial line to 2 different external client boxes, so the problem is neither the hardware nor the remote client.
When finally booted, the system fails to create the login process.
root@xenpro3:~# ps ax | grep tty
1229 tty4 Ss+ 0:00 /sbin/getty -8 38400 tty4
1233 tty5 Ss+ 0:00 /sbin/getty -8 38400 tty5
1239 tty2 Ss+ 0:00 /sbin/getty -8 38400 tty2
1241 tty3 Ss+ 0:00 /sbin/getty -8 38400 tty3
1245 tty6 Ss+ 0:00 /sbin/getty -8 38400 tty6
1403 tty1 Ss+ 0:00 /sbin/getty -8 38400 tty1
1996 pts/0 S+ 0:00 grep --color=auto tty
root@xenpro3:~# dmesg | grep tty
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.2.0-30-generic root=/dev/mapper/xenpro3-root ro console=ttyS0,115200n8
[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.2.0-30-generic root=/dev/mapper/xenpro3-root ro console=ttyS0,115200n8
[ 0.000000] console [ttyS0] enabled
[ 2.160986] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 2.203396] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[ 2.263296] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 2.323102] 00:09: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
root@xenpro3:~# uname -a
Linux xenpro3 3.2.0-30-generic #48-Ubuntu SMP Fri Aug 24 16:52:48 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
root@xenpro3:~#
I have tried putting a ttyS0.conf file in /etc/initab, which solves the problem bare metal but I still cannot get the serial port to work when booting Ubuntu on top of Xen, as domain 0. My serial line output looks like this, when booting Xen
/dev/ttyS0 at 0x03f8 (irq = 4) is a 16550A
* Exporting directories for NFS kernel daemon... [ OK ]
* Starting NFS kernel daemon [ OK ]
SSL tunnels disabled, see /etc/default/stunnel4
[ 18.654627] XENBUS: Unable to read cpu state
[ 18.659631] XENBUS: Unable to read cpu state
[ 18.664398] XENBUS: Unable to read cpu state
[ 18.669248] XENBUS: Unable to read cpu state
* Starting Xen daemons
[ OK ]
mountall: Disconnected from Plymouth
At this point, the serial line is no longer connected to a process. Xen itself is running just fine. Dmesg gives me a long list of
[ 120.236841] init: ttyS0 main process ended, respawning
[ 120.239717] ttyS0: LSR safety check engaged!
[ 130.240265] init: ttyS0 main process (1631) terminated with status 1
[ 130.240294] init: ttyS0 main process ended, respawning
[ 130.242970] ttyS0: LSR safety check engaged!
which is no surprise because I see
root@xenpro3:~# ls -l /dev/ttyS?
crw-rw---- 1 root tty 4, 64 Nov 7 14:04 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 Nov 7 14:04 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 Nov 7 14:04 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 Nov 7 14:04 /dev/ttyS3
crw-rw---- 1 root dialout 4, 68 Nov 7 14:04 /dev/ttyS4
crw-rw---- 1 root dialout 4, 69 Nov 7 14:04 /dev/ttyS5
crw-rw---- 1 root dialout 4, 70 Nov 7 14:04 /dev/ttyS6
crw-rw---- 1 root dialout 4, 71 Nov 7 14:04 /dev/ttyS7
crw-rw---- 1 root dialout 4, 72 Nov 7 14:04 /dev/ttyS8
crw-rw---- 1 root dialout 4, 73 Nov 7 14:04 /dev/ttyS9
If I manually change the group of /dev/ttyS0 to dialout, it gets changed back. I have made no changes to the default udev rules, so I cannot see where this problem is coming from.
Sincerely,
John