# What killed my serial console? [Solved]

## Doogman

This has me completely stumped.

I have a headless home server that I recently made a long-overdue switch to the AMD64 tree at the beginning of the month.  The switchover went great!  Since I don't have a monitor connected and this is a server board with redirect, a serial console is very handy.  BIOS, GRUB, kernel messages and serial login console were all working perfectly with my laptop through a Keyspan adaptor.  I even had memtest86+ working on serial.  :Smile:   Life was good.

Fast-forward to a few days ago when I discovered I couldn't log-in via the serial console.  No login-prompt, nothing.  Same kernel as the beginning of the month when it was working fine, but I did do a few portage syncs and updates.  I think something in one of those updates broke my serial console.

Here's where I'm at now: BIOS, GRUB, kernel & boot messages and memtest86+ all work fine via serial, but agetty dies immediately with this error:

Apr 19 17:04:09 godzilla init: Id "s0" respawning too fast: disabled for 5 minutes

I get the above message in my log every 5.

Here's the line in inittab:

s0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100

Which has been working fine for years on this computer.

setserial -g /dev/ttyS[01]

/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4

/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3

If I try this from the command prompt:

godzilla ~ # /sbin/agetty 115200 ttyS0 vt100

Eventually it dies with this error in the log:

Apr 19 17:15:43 godzilla agetty[3790]: ttyS0: tcgetattr: Input/output error

And then after that:

setserial -g /dev/ttyS[01]

Cannot get serial info: Input/output error

/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3

But it's actually working fine.  If I then shutdown the server, the boot messages display on the console.

My x86 tree desktop has a working serial port, so just for fun I activated the serial console on that and got the same error message:

Apr 19 17:23:54 [init] Id "s0" respawning too fast: disabled for 5 minutes

Anyone else seeing this?Last edited by Doogman on Wed Apr 20, 2011 11:54 pm; edited 1 time in total

----------

## Doogman

I figured out the problem... IT WAS THE FRIGGIN CABLE!  Actually, two of them.

About a month ago I bought a longer null modem cable for the server.  It works fine on one side of this computer, but I found if you wiggle the connector a bit and place it near the power cord it creates the problem with agetty.  While the cable worked fine enough for normal terminal operation, as I didn't notice any text corruption, apparently agetty at startup is _far_ more sensitive to a noise causing it to throw a fit like I described in the previous post.  Why agetty notices this noise at startup and yet I don't see any random character corruption being displayed on the serial console is beyond me.

I dug-out an old null modem cable and found that works fine:  no agetty startup errors at all using this cable.  It's shorter and has both DB9 & DB25 connectors on each end which makes it a kinda of pain to use which is why a bought the longer cable to begin with.  I guess that's what I get for trying to use a "low bid" cable.  

The solution to the agetty errors on my desktop is even more hilarious.  I always have used a small serial extension cable for my desktop computer so I don't have to dig around the tangle of wires in the back.  When I tested agetty, I didn't bother checking this cable and I got the same errors as the server.  The solution was to untangle the cable from the rest of the spaghetti of wires in the back of the computer.  With the serial extension cable coiled-up by itself, agetty starts-up fine on this computer as well.  It amazes me that this cable works fine with a PIC programmer, scanner and such, but agetty is so super-sensitive to noise.

So, if you have problems:

Pull all cables

"kill -HUP 1" to restart ttys.

Look for agetty process on ttyS0.

You might need to restart the computer.

By the way. the noisy cable works fine when plugged-in _after_ agetty is already started.

That was a lot of work for a simple problem.  Now I'm off to see if one can still buy a decent quality serial cable these days.

----------

