Subject: Re: Interesting getty problem.
To: gabriel rosenkoetter <gr@eclipsed.net>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: port-macppc
Date: 09/27/1999 12:56:14
On Mon, 27 Sep 1999, gabriel rosenkoetter wrote:

> So I happened to notice that getty was sitting at the top of my
> processor usage with vaguely 90% before it decided it had an excessive
> running time, killed itself, and started over again. Kept my load above
> 1, which was a lot of fun. Really. I swear.

That's bad!

> Looking things over, I found that the getty that was misbehaving was
> called as "/usr/libexec/getty std.9600 ttyE0".
> 
> I shrugged, commented ttyE0 in /etc/ttys, and did a kill -HUP 1, and
> my problem went away.

Good!

> Skimming my authlog, this has been happening since the last time I
> rebooted having first gone into MacOS, which I have to do using a
> serial terminal (damn broken OF in 7500s gets reset to serial console
> if you let the mac ROMs boot). So I had the serial cable plugged in at
> the time, so init listened to it and initialized /dev/ttyE0. Great.

But ttyE0 is the video console! tty0[01] are the serial ports!

> Then I unplugged the serial cable and moved the other mac I'd moved
> into the closet where I keep the NetBSD box back out again. And getty
> kept trying to use the port. Bad.
> 
> At least, that's my theory right now.

Did you have both /dev/console and /dev/ttyE0 enabled? That would explain
all the problems you describe. /dev/console points to whatever is the real
console, and so it'll move when you flip from serial to video console. But
ttyE0 and tty0[01] all stay fixed, and disapear if the relevant hardware's
not present.

Having both ttyE0 and /dev/console on will cause problems as one of the
two will open the device, and then the other won't be able to as it'll be
busy.

> Looking more closely at /etc/ttys, I opted to uncomment the ttyE0 line
> and just switch status from on to off, and another HUP to init proved
> that this was okay (getty didn't start sucking up processor again).
> 
> Am I breaking anything by doing this? Is there some reason that getty
> freaked out, other than that one shouldn't go hot-unplugging serial
> consoles?

Having both /dev/console and the real console device as on in /etc/ttys is
not good, because it exhibits the behavior you've seen. :-)

Take care,

Bill