Serial console

From PrgmrWiki

Edit /grub/menu.lst so that it outputs to the serial console:


serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout 10 serial console
(the new servers required terminal --dumb serial... we should figure out why.)
  • note, without the terminal --timeout 10 if you just do terminal serial console it sits forever with 'press any key to continue' see, in this case serial is serial and console is vga/keyboard... so you can put 'terminal serial' and it will just go but 'terminal serial console' means serial or console --timeout value means 'default to the first option' so 'terminal --timeout 10 console serial' would do the same thing only defaulting to vga console if no key was pressed in 10 seconds.

in the same file, tell xen and the dom0 os kernel about the serial console


title CentOS (2.6.18-53.1.21.el5xen)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.18-53.1.21.el5xen ro root=/dev/md0 console=ttyS0,115200n8
        module /boot/initrd-2.6.18-53.1.21.el5xen.img

edit /etc/inittab to add

co:2345:respawn:/sbin/agetty ttyS0 115200 vt100-nav


or so.

Careful not to forget to add ttyS0 to /etc/securetty, else you wont be able to login

ttyS0


I wire a null modem from com1 on the main server to a serial port on another server (right now I use a buddy system with other Xen servers, so I add USB serial dongles, thus ttyUSB0)

on another box, I run cu -l /dev/ttyUSB0 within a Screen session with logging enabled. this means when a Dom0 panics, I can go back and see what happened. Screen also has serial support builtin. It is handy to make the hostname of the connected box be the title of the window with -t and set "multiuser on" in the screenrc so hopefully other users can connect to the screen console while it has the device (I don't know if this really works). -L sets logging and the logfile is ~/screenlog.windownumber. screen -L -t [hostname] /dev/ttyUSB0 115200,cs8