getty
PURPOSE
Sets the characteristics of ports.
SYNOPSIS
getty [ -d ] portname
DESCRIPTION
The init process runs the getty command for each portname
enabled for login. Its primary function is to set the
characteristics of the port specified by portname. Port
characteristics include:
o Bi-directional 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 upper-
case, 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 /etc/ports, see AIX
Operating System Technical Reference. For the logmodes
and runmodes parameter settings, see "stty.") When getty
is invoked, it first opens the specified port. However,
if carrier detection (modem control) is available on the
port, getty cannot open the port until the carrier is
present. Once the port is opened, getty 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 getty 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.
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 getty 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 /bin/login, runs in the same process as
getty not as its child.
Any additional arguments entered after the login name are
passed to the logger program. The login command inter-
prets 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, getty 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 /etc/ports will provide faster
output with less system load.
SPECIAL PURPOSE OPTIONS: If there is a timeout keyword
in the ports file, getty 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, then instead of displaying the herald and gath-
ering 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 spawned when a connection is made
from the outside world. As a special case, if you
specify:
program = HOLD
the runmodes, owner, and protection of the port are set
and getty holds the port open indefinitely, thereby pre-
venting the port modes from reverting to their open-
default settings. This is useful, for 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,
getty displays the name of the program that would have
been run.
-r Makes the port available for shared (bi-directional)
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 uucp to determine the status
of the line. If the lock fails (because some other
process is using the line), getty waits until the lock
file is removed, exits, and init spawns a new getty to
attempt the locking process again.
-u Makes the port available for shared (bi-directional)
use without displaying the login herald. This flag is
used for direct lines or lines that have intelligent
modems that need to return immediately on opening a
port. 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 tests a new port definition for /dev/tty5 by simu-
lating the login sequence of this device at your work
station.
FILES
/etc/locks
/etc/ports
/bin/login
/bin/setmaps
RELATED INFORMATION
The following commands: "login," "init," and "stty."
The tty and ports files in AIX Operating System Technical
Reference.
The "Overview of International Character Support" in Man-
aging the AIX Operating System.