Subject: ttys(5)
To: Port-SPARC <Port-SPARC@NetBSD.org>
From: Don Yuniskis <auryn@gci-net.com>
List: port-sparc
Date: 11/26/2001 22:34:04
Greetings and Illuminations!
     OK, I think I asked this before but must not
have received an answer (that fit my needs?)...  :-(
I'm trying to sort out how to *practically* use
ttya.  I have two different scenarios that I
would like to address -- largely similar.

     Boxes run headless here, for the most part.

     I want to attach a serial terminal to ttya
that I can use as the console from time to time.
This implies adding a line like:
  console "/usr/libexec/getty std.19200" vt320 on secure
to ttys(5).  (the "terminal" is best described as
a vt320 -- it is definitely "secure" and I obviously
*want* to be able to login as root!)
     There are other times when I want to be able to
attach a monitor/keyboard and use *that* as the "console".
This implies using:
  console "/usr/libexec/getty suncons" sun on secure

     Of course, the monitor misbehaves when TERMCAP
is "vt320".  And, the terminal misbehaves when TERMCAP
is "sun".  The obvious solution is to use "unknown"
for this.
    Is there, perhaps, a way in .profile to look at the
source of the actual "console" (i.e. kbd/fb vs. ttya)
and set TERMCAP accordingly?

    Next -- the tougher question!

    I want to put a modem on "ttya".  Operating headless,
this would let me access the "console" remotely -- in the
event that I had to bring the system down and then back up
in single user, etc. remotely.  (don't fuss over the
"security" issues -- I've got those addressed already!)
    To accommodate this, ttys(5) needs a line like:
  console "/usr/libexec/getty std.19200" unknown on secure
if operating headless.  The "console" is not available
via this modem if running with a keyboard/monitor (since
the console automatically moves to those devices instead)

    But, if operating *with* a monitor/keyboard, then ttya
is basically "inaccessible" in either of these scenarios!
So, for example, I couldn't sit down at the keyboard/monitor
and use the modem to dial out *or* accept (non-console)
dialins, etc.
    If I add a ttys(5) entry like:
  ttya "/usr/libexec/getty std.19200" unknown on secure
this allows the port to operate when I have a monitor attached
but raises hell when I run headless!

    And, since ttyb can't (?) serve as the console, there
is no way to use it to solve the problem (??)

    It seems that the "problem" lies in the fact that
"console" means one thing when operating headless and
something else when operating with a keyboard/monitor.
And, that ttya likewise means two different things...
    Is there a way to workaround this?  Or, is there
some inherent flaw in my request (i.e. wanting strawberries
but only BLUE ones...)

Thx,
--don