Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getty(8) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

login

init, telinit

pstart, penable, pshare, pdelay

stty, STTY

tty

ports



GETTY(8,C)                  AIX Commands Reference                   GETTY(8,C)



-------------------------------------------------------------------------------
getty



PURPOSE

Sets the characteristics of ports.

SYNTAX


       +--------------+
       | +--- -d ---+ |
getty ---|  one of  |---- portname --|
         |  +----+  |
         +--| -r |--+
            | -u |
            +----+


DESCRIPTION

The init process runs the getty command for each portname enabled for login.
This command's primary function is to set the characteristics of the port
specified by portname.  Port characteristics include:

  o Bidirectional use (tty line can be used in both directions)
  o Line speed (baud rate)
  o Parity
  o Carriage return, tab, new-line, and form feed delays
  o Character set mapping, such as lowercase to uppercase, carriage return to
    new-line translation, and tab expansion
  o Extended character support
  o Character erase and line erase editing characters
  o Local or remote echo
  o Screen length for paging.

The getty command obtains these settings by reading the port attributes
specified in the /etc/ports configuration file and by observing the behavior of
the port itself.  (For details regarding the format of the /etc/ports file, see
AIX Operating System Technical Reference.  For the logmodes and runmodes
parameter settings, see "stty, STTY.") When the getty command is invoked, it
first opens the specified port.  However, if carrier detection (modem control)
is available on the port, the getty command cannot open the port until the
carrier is present.  Once the port is opened, the command sets the work station
attributes according to the first speed, logmodes, parity, erase, kill and
other parameters in the ports file and writes the herald message herald to the
port.  Then the getty command reads a login name from the port.  If the login
name contains extended characters, they are translated to the single ASCII
characters most resembling them.




Processed November 8, 1990        GETTY(8,C)                                  1





GETTY(8,C)                  AIX Commands Reference                   GETTY(8,C)



If a framing error occurs while reading, either because a user generates a
BREAK signal from the work station or because the line speed is not the same as
that of the transmitting work station, the port parameters are reset to the
next combination specified in the ports file.  Once the getty command reads a
login name, it resets the work station modes according to the runmodes
parameter, turns on carriage-return-to-new-line mapping if the login name was
ended by a carriage return, turns on lowercase-to-uppercase mapping if the
alphabetic characters in the login name were all uppercase, and executes the
program specified by the logger parameter.  That program, defaulting to the
file /bin/login, runs in the same process as the getty command not as its child
process.

Any additional arguments entered after the login name are passed to the logger
program.  The login command interprets these as shell variable settings and
places them in the environment.

On dial-in ports, it is often desirable to set no parity generation or checking
as a default, but to permit the user to select parity as an option.  For
example, the following line in the /etc/ports file:

  parity = none,odd+inpck,even+inpck

accepts logins with any parity, but if a user generates BREAK before typing a
login name, the getty command sets the port to generate odd parity and to check
incoming characters for odd parity, while two BREAKs generate and check for
even parity.  Similarly, the line:

  speed=1200,300

works with 1200 baud, reverting to 300 baud when a BREAK is received before the
login name.  The default runmodes parameter, which must appear on one line in
the ports file, is generally satisfactory.  However, for work stations that
have built-in tabs to every eight character positions and do not require tab
delays, eliminating the "tab3" from the default in the /etc/ports file provides
faster output with less system load.

SPECIAL PURPOSE OPTIONS:  If there is a timeout keyword in the ports file, the
getty command waits only the specified number of seconds for a response to the
herald before advancing to the next port settings or, after all the settings
are exhausted, exiting.  If there is a program keyword for the port, instead of
displaying the herald and gathering a login name, it executes the specified
program immediately.  This feature is a general mechanism for supporting
special service ports such as network mail demons that need to be created when
a connection is made from the external world.  As a special case, if you
specify:

  program = HOLD

the runmodes, owner, and protection parameters of the port are set and the
getty command holds the port open indefinitely, thereby preventing the port
modes from reverting to their open-default settings.  This is useful, for




Processed November 8, 1990        GETTY(8,C)                                  2





GETTY(8,C)                  AIX Commands Reference                   GETTY(8,C)



example, in setting the modes on serial printer ports when it is inconvenient
or impossible to have the programs that use them do so.

FLAGS

-d Uses standard input as the work station for which parameters are to be set
   according to those governing portname.  Instead of executing a logger or a
   program, the getty command displays the name of the program that would have
   been run.

-u Makes the port available for shared (bidirectional) use.  With this flag
   getty attempts to create a lock file in /etc/locks with the name of the
   device.  This file can then be used by the uucp command to determine the
   status of the line.  If the lock fails (because some other process is using
   the line), the getty command waits until the lock file is removed and exits.
   The init command creates a new getty to attempt the locking process again.

-r Makes the port available for shared (bidirectional) use.  This is the same
   as the -u flag; however, the login herald is not displayed until at least
   one character is read from the port.  This flag is used for direct lines or
   lines that have intelligent modems.  This prevents getty from talking to a
   getty on the remote system or modem.

EXAMPLE

To test a new /etc/ports entry:

  getty -d /dev/tty5

This command tests a new port definition for "/dev/tty5" by simulating the
login sequence of this device at your work station.

FILES

/etc/locks      Directory containing lock files.
/etc/ports      System terminal port characteristics.
/bin/login      Program to log you in to system.
/bin/setmaps    Sets terminal maps.

RELATED INFORMATION

See the following commands:  "login,"  "init, telinit,"  "pstart, penable,
pshare, pdelay," and "stty, STTY."

See the tty and ports files in AIX Operating System Technical Reference.

See "Introduction to International Character Support" in Managing the AIX
Operating System.







Processed November 8, 1990        GETTY(8,C)                                  3



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026