I'm trying to set up serial console on CentOS 6.2.
I've been able to get a login console, but if I try to enable grub and the kernel log showing on the serial port, grub keeps being terminated every few seconds.
This is my current config:
/etc/init/serial-ttyS1.conf
:
# This service maintains a getty on /dev/ttyS1.
start on stopped rc RUNLEVEL=[2345]
stop on starting runlevel [016]
respawn
exec /sbin/agetty /dev/ttyS1 115200 vt100-nav
/boot/grub/grub.conf
:
#boot=/dev/sda
default=0
timeout=5
#splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
serial --unit=1 --speed=19200
terminal --timeout=8 console serial
title CentOS (2.6.32-220.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=jp106 rd_LVM_LV=VolGroup/lv_root quiet rd_NO_DM console=tty0 console=ttyS1,19200n8
initrd /initramfs-2.6.32-220.el6.x86_64.img
Note the two console
flags at the end of the kernel command switches (console=tty0 console=ttyS1,19200n8
). If they are removed, the problem doens't manifest itself any more, but I also lose grub and the boot log in the serial console.
Here is a sample from /var/log/messages
:
Aug 27 14:14:24 ovesh-centos-62 init: serial-ttyS1 main process ended, respawning
Aug 27 14:14:25 ovesh-centos-62 init: serial (ttyS1) main process (1614) terminated with status 1
Aug 27 14:14:25 ovesh-centos-62 init: serial (ttyS1) main process ended, respawning
Aug 27 14:14:26 ovesh-centos-62 init: serial (ttyS1) main process ended, respawning
Aug 27 14:15:25 ovesh-centos-62 init: serial-ttyS1 main process ended, respawning
Aug 27 14:15:35 ovesh-centos-62 init: serial (ttyS1) main process (1731) terminated with status 1
Aug 27 14:15:35 ovesh-centos-62 init: serial (ttyS1) main process ended, respawning
NOTE: I've seen other people getting "respawning too fast" messages in their log, but this is not the case here.