1828225 Members
3564 Online
109975 Solutions
New Discussion

serial console on redhat

 
SOLVED
Go to solution
K.C. Chan
Trusted Contributor

serial console on redhat

All,
I am trying to implement serial console on redhat. But I am having a bit of problem when trying to select boot up options in grub when connected via serial line "cu -s 115200 -l /dev/ttyS0", here's the output of it:
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.

It just stops here, pressing any key will not help, until enter is press; which booted the defualt kernel. This is what I have in inittab file:
s0::respawn:/sbin/mgetty -s 115200 ttyS0 linux

Any idea? Thanks.
Reputation of a thousand years can be determined by the conduct of an hour
8 REPLIES 8
Stuart Browne
Honored Contributor

Re: serial console on redhat

Have you read:

http://www.gnu.org/software/grub/manual/html_mono/grub.html.gz#Serial%20terminal

I'm picking this will help.
One long-haired git at your service...
K.C. Chan
Trusted Contributor

Re: serial console on redhat

Stuart, yes. I have read something similar to that. It is for the most part working. But the part where you can select which kernel to boot besides that default is not working. This is never display. The process seems to hang at "Press any key to continue.", Until enter is press and the default kernel is booted. I am thinking it has to do with TERM type, like my Eterm which I used to connected via serial line is "linux". Maybe it is expecting a vt100 terminal? Any idea? Thanks.
Reputation of a thousand years can be determined by the conduct of an hour
Stuart Browne
Honored Contributor

Re: serial console on redhat

No. ETerm most certainly can do 'vt100' emulation. A great deal of terminal emulations are based upon it, or atleast understand them.

I'm assuming you told Grumb that the baud rate is 115200 (you're not getting garbage, but english), so I'm left assuming that the grub on the machine is compiled saying '--disable-serial'.

*looks into the RH grub src rpm*

...
...

nope.. that leaves it enabled.

So that leaves me out cold.. Sorry.
One long-haired git at your service...
Stuart Browne
Honored Contributor

Re: serial console on redhat

And a 10s google search shows:

http://mail.gnu.org/archive/html/bug-grub/2002-01/msg00108.html

(search: grub serial "Press any key to continue.")

http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/configure-boot-loader-grub.html

might also be of help.
One long-haired git at your service...
Tom Ward_1
Honored Contributor

Re: serial console on redhat

Perhaps you're going too fast. I have an old PC as a linux server and found it couldn't handle 115220, but it does work ok at 57600.

from /boot/grub/grub.conf
#boot=/dev/hda
#serial --unit=0 --speed=11520 --word=8 --parity=no --stop=1 too fast for grub
serial --unit=0 --speed=57600 --word=8 --parity=no --stop=1
#serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1 too slow
#terminal --timeout=5 serial console
terminal serial console
timeout=5
default=0
fallback=1
title Red Hat Linux 7.3SMP (2.4.20-20.7smp)
root (hd0,0)
kernel /vmlinuz-2.4.20-20.7smp ro root=/dev/hda2 hdc=ide-scsi text console=ttyS0
,57600,vt102
initrd /initrd-2.4.20-20.7smp.img
( I know I need to update the kernel)

from /etc/inittab
##co:2345:respawn:/sbin/agetty ttyS0 115200 vt102
co:2345:respawn:/sbin/agetty -h -t 60 ttyS0 57600 vt102

This works fine for me. Good luck,
Tom
K.C. Chan
Trusted Contributor

Re: serial console on redhat

All, this is not working as I expected. Here's what I have tried so far, file "/etc/grub.conf", tried various speed 9600,57600,115200:
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal --timeout=5 serial console
title Red Hat Linux (2.4.18-27.7.x)
root (hd0,0)
kernel /vmlinuz-2.4.18-27.7.x ro root=/dev/hda5 text console=tty0 consol
e=ttyS0 linux
initrd /initrd-2.4.18-27.7.x.img
title Red Hat Linux (2.4.18-27.7.x) Single User Mode
root (hd0,0)
kernel /vmlinuz-2.4.18-27.7.x ro root=/dev/hda5 console=tty0 console=tty
S0,115200n8 s

file: /etc/inittab
co::respawn:/sbin/mgetty -s 9600 ttyS0 linux

file: mgetty.config, which I don't think it's using.
port ttyS0
debug 4
direct y
ignore-carrier true
login prompt @ console login:
speed 9600
toggle-dtr n


Any idea, why I can not select the listed kernel of choice from the grub boot list? Thanks.
Reputation of a thousand years can be determined by the conduct of an hour
Tom Ward_1
Honored Contributor
Solution

Re: serial console on redhat

I see one thing that's not right.
Try removing
splashimage=(hd0,0)/grub/splash.xpm.gz

You don't want a splash image on your serial console. I hope that fixes it. If not please followup.

Regards,
Tom
K.C. Chan
Trusted Contributor

Re: serial console on redhat

kudos to you Tom, you hit it on the spot. It was the splash image that is causing me headache.

Thanks to all of you for your help.
Reputation of a thousand years can be determined by the conduct of an hour