Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
What is the server hardware? Console to serial port redirection can be quirky. –  Mark Wagner Sep 5 '12 at 0:37
    
I've simulated it on a VirtualBox guest as well, so I don't think it's hardware related. –  Ovesh Sep 5 '12 at 0:57

2 Answers 2

up vote 1 down vote accepted
+100

Try to find where the error occures.

Disable serial everywhere, except grub config. Can you see grub menu on serial port while booting?

Boot without any serial console options and try to launch agetty /dev/ttyS0 115200 -a root. Does this command fail? Can you login on serial port when this command is running?

Then try the same test with agetty /dev/ttyS0 115200 vt100-nav

share|improve this answer
    
I haven't had time to debug this yet, but thanks for the answer. I'll report further once I have more data. –  Ovesh Sep 6 '12 at 7:01
    
OK, that turned out to be very helpful. Turns out you don't need to add the config for /etc/init/serial-ttyS1.conf to get a shell. Passing a console argument to the kernel (e.g., console=ttyS1,19200n8) is enough. So I'm guessing there were two processes constantly trying to start agetty (maybe killing each other?), which caused it to keep failing. –  Ovesh Sep 7 '12 at 5:02

As I mentioned in one of the comments:

Turns out you don't need to add the config for /etc/init/serial-ttyS1.conf to get a shell.

Passing a console argument to the kernel (e.g., console=ttyS1,19200n8) is enough.

So I'm guessing there were two processes constantly trying to start agetty (maybe killing each other?), which caused it to keep failing.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.