DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 13th May 2008
michaelk michaelk is offline
New User
 
Join Date: May 2008
Posts: 9
Thanked 0 Times in 0 Posts
Unhappy getty dies on serial console?

Hi Everyone

I have a small but extremely annoying problem.

when connecting to to my freebsd serial console if I hit the <Enter> key then the getty will die?!
(or sometimes hang...and I'm not able not log in anymore )

If I type "root" directly (or any other username) instead I will the get the password prompt and everything works fine.

Once I'm logged in through the serial connection then also everything works fine.

On my linux box if I hit enter I just get the login prompt displayed again.

Anyone having similar problem? Any hints why the getty just dies?
(It's not being restarted by init either I have restart it manually from the command line)

Thanks in advance

Michael

Quote:
# grep ttyd0 /etc/ttys
ttyd0 "/usr/libexec/getty std.9600" vt100 on secure

# ps aux | grep getty
root 75105 0.0 0.2 3156 1068 d0 Is+ 7:59PM 0:00.01 /usr/libexec/getty std.9600 ttyd0
root 1132 0.0 0.2 3156 1068 v0 Is+ 1:08PM 0:00.01 /usr/libexec/getty Pc ttyv0
My freebsd box is connected (using a null modem cable) to a linux box so I can log in to the console using kermit. I've also tested using minicom, putty & securecrt...I get the same behavior.

Quote:
# kermit -c
Connecting to /dev/ttyS1, speed 9600
Escape character: Ctrl-Q (ASCII 17, DC1): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
root <<<< IF I PRESS ENTER HERE INSTEAD OF TYPING "root"
Password:
Last login: Mon May 12 19:52:06 on ttyd0
Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.

FreeBSD 7.0-RELEASE (GENERIC) #0: Sun Feb 24 19:59:52 UTC 2008
[root@itchy ~]# exit
logout

FreeBSD/i386 (itchy.homeip.net) (ttyd0)

login:
Closing /dev/ttyS1...OK

# stty -a
speed 9600 baud; 0 rows; 0 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
-echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl clocal -cstopb -crtscts -dsrflow
-dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
eol2 = <undef>; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U;
lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q;
status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;

# cat .kermrc
set line /dev/ttyS1
set speed 9600
set terminal bytesize 8
set parity none
set stop-bits 1
set flow-control none
set file type binary
set carrier-watch off
set modem type none
set escape-character ^Q
Reply With Quote
  #2   (View Single Post)  
Old 13th May 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,135
Thanked 182 Times in 149 Posts
Default

Can you find any error messages about the dying getty in the log files?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 13th May 2008
michaelk michaelk is offline
New User
 
Join Date: May 2008
Posts: 9
Thanked 0 Times in 0 Posts
Default

The only message I get is sometimes in /var/log/messages:

getty[81323]: login_tty /dev/ttyd0: Device not configured

But I don't know if it's related...it might just be me trying to start another
getty from the command line..otherwise I don't get any messages or core files...

Is there some way to get getty to be more verbose?

//Michael
Reply With Quote
  #4   (View Single Post)  
Old 13th May 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,135
Thanked 182 Times in 149 Posts
Default

The error message mentions /dev/ttyd0, which is a so-called call-in port. From http://www.freebsd.org/doc/en_US.ISO...ok/serial.html
Quote:
In FreeBSD, you access each serial port through an entry in the /dev directory. There are two different kinds of entries:
  • Call-in ports are named /dev/ttydN where N is the port number, starting from zero. Generally, you use the call-in port for terminals. Call-in ports require that the serial line assert the data carrier detect (DCD) signal to work correctly.

  • Call-out ports are named /dev/cuadN. You usually do not use the call-out port for terminals, just for modems. You may use the call-out port if the serial cable or the terminal does not support the carrier detect signal.

Note: Call-out ports are named /dev/cuaaN in FreeBSD 5.X and older.

If you have connected a terminal to the first serial port (COM1 in MS-DOS®), then you will use /dev/ttyd0 to refer to the terminal. If the terminal is on the second serial port (also known as COM2), use /dev/ttyd1, and so forth.
Can you try another cable? Does the same problem occur when you use another FreeBSD box as terminal (using tip or cu?

Or try to use 3wire.9600 instead of std.9600 in the "/etc/ttys" file as recommended in the FreeBSD handbook (24.3.3 Troubleshooting Your Connection)
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #5   (View Single Post)  
Old 14th May 2008
michaelk michaelk is offline
New User
 
Join Date: May 2008
Posts: 9
Thanked 0 Times in 0 Posts
Default

I tried both 3wire.9600 and std.9600 but without success...

The cable I'm using is a standard null modem cable bought in the store
which worked fine om my linux box.

Note that I only have trouble during the login phase:

Quote:
# kermit -c
Connecting to /dev/ttyS1, speed 9600
Escape character: Ctrl-Q (ASCII 17, DC1): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
root
Password:
Last login: Wed May 14 19:49:32 on ttyd0
May 14 19:54:42 itchy login: ROOT LOGIN (root) ON ttyd0
Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.

FreeBSD 7.0-RELEASE (GENERIC) #0: Sun Feb 24 19:59:52 UTC 2008
You have new mail.
[root@itchy ~]# exit
log
FreeBSD/i386 (itchy.homeip.net) (ttyd0)

login: root << IF I press ENTER HERE before typing "root"
Password:
Last login: Wed May 14 19:54:42 on ttyd0
Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.

FreeBSD 7.0-RELEASE (GENERIC) #0: Sun Feb 24 19:59:52 UTC 2008
You have new mail.
[root@itchy ~]#
On my linux box if I happen to press "enter" I will just get a new
login prompt but here the getty/login hangs and get unresponsive.

Once I'm logged in everything works fine...Thats why I suspect
getty or login....I'll try to get hold of multimeter tomorrow to check
the cable physically.

//Michael
Reply With Quote
  #6   (View Single Post)  
Old 14th May 2008
michaelk michaelk is offline
New User
 
Join Date: May 2008
Posts: 9
Thanked 0 Times in 0 Posts
Default

Just tried to connect from serial2 to serial1 on my freebsd using cu
and get exactly the same behavior..

This starts to drive me crazy

//Michael
Reply With Quote
  #7   (View Single Post)  
Old 14th May 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,135
Thanked 182 Times in 149 Posts
Default

I only use a serial console from OpenBSD to OpenBSD. Never experienced problems like you.

Did you have this problem on a previous version of FBSD or is just 7.0 ?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #8   (View Single Post)  
Old 15th May 2008
michaelk michaelk is offline
New User
 
Join Date: May 2008
Posts: 9
Thanked 0 Times in 0 Posts
Default

I did not use serial console in previous versions...and at the moment I only have
one freebsd machine (7.0).

I tried the getty from freebsd 6.3 but it's the same behavior....

I begin to suspect that it's either the cable (tried 2 different null modem cables) or
the login program which really is the problem..

//Michael

Last edited by michaelk; 15th May 2008 at 07:31 AM.
Reply With Quote
  #9   (View Single Post)  
Old 17th May 2008
michaelk michaelk is offline
New User
 
Join Date: May 2008
Posts: 9
Thanked 0 Times in 0 Posts
Default

I did some more testing and this seems hardware related.

I installed freebsd on old HP vectra and there it works...
while on my compaq deskpro (also old) it doesn't work

On the machine the it works I have:

sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A, console

While on the machine that it doesn't I have:

sio0: <Standard PC COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A, console

Same settings on both machines...

I also managed to find a work around...When the login hangs
I can press ^D (ctrl-D => eof ) twice which will respawn a new
getty and enables me to log in.
(so I'm not stuck any more )

//Michael
Reply With Quote
Old 18th May 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,135
Thanked 182 Times in 149 Posts
Default

In earlier times a motherboard had a physical 16550 serial chip. Later the serial chip was integrated in a separate I/O chip. Maybe the serial emulation of the problematic motherboard is not completely following the 16550 specs, and hence gives problems.

But at least you now have found a work-around.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Reply

Tags
serial console getty

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
init: can't exec getty after power failure mtx FreeBSD General 0 20th January 2009 10:14 AM
Controlling a RS-232 Serial Console from a Shell Script ishikawanakano Programming 0 9th January 2009 10:00 PM
Setting up the serial console PeterSteele FreeBSD General 6 3rd November 2008 04:42 PM
Serial connections JMJ_coder General software and network 9 25th July 2008 03:28 PM
cyrus-sasl2 dies chavez243 FreeBSD Ports and Packages 9 10th May 2008 03:01 PM


All times are GMT. The time now is 06:49 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick