Serial Port Problems (Solved)
david.robillard at gmail.com
Fri Mar 16 15:16:50 UTC 2007
> On Thu, 2007-03-01 at 15:27 -0600, Dan D Niles wrote:
>> If I disconnect and come back later
>> (sometimes), or if I hit return without entering a login name (always)
>> it starts spitting out junk like:
> I found a solution, although I'm not sure why it works.
> When you just hit enter getty goes back to the beginning of its loop.
> This also happens if you enter a name starting with "-" or consisting of
> just spaces. These also causes the output to become garbled.
> At the beginning of the loop it calls setttymode(0). If I insert a
> sleep(1) before this call, everything works correctly. If I insert the
> sleep after that, the output still gets garbled.
> Like I said, I don't know why it works, but it does.
> I don't think a short delay is unreasonable after entering invalid or no
> information. I am going to submit a PR with a patch.
I have the same behavior as you do on some machines here. But I
originally thought it was caused by the (old) serial port card I used
to build a serial console server.
The card is an EasyIO PCI 8-port card from Stallion Technologies as
suggested by Gregory Bond's article "Console Server" from
(BTW, don't buy this card today because it's driver was not ported
from FreeBSD 4.x to neither 5.x nor 6.x.)
That being said, I checked /usr/src/libexec/getty/main.c to find out
how to recreate your fix. But I'm not a huge C programmer, so I tried
other ways to solve this.
That brought me to gettytab(5) which says that the "de" field controls
the "delay secs and flush input before writing first prompt" as the
man page puts it.
So I changed a test machine's gettytab default entry from:
And restarted (not sure if a reboot is necessary here?). I had to
fiddle a bit with the delay, but it did help.
UNIX systems administrator & Oracle DBA
CISSP, RHCE & Sun Certified Security Administrator
Montreal: +1 514 966 0122
More information about the freebsd-questions