Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getty(1M) — Interactive 3.2r4.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ct(1C)

init(1M)

login(1)

uugetty(1M)

ioctl(2)

gettydefs(4)

inittab(4)

tty(7)

getty(1M)  —  

NAME

getty − set terminal type, modes, speed, and line discipline

SYNOPSIS

/etc/getty [ −f ] [ −h ] [ −t timeout ] [ −m maparg ] [−C] [−X] [−S] [−Rn] line [ speed [ type [ linedisc ] ] ] [ −i issue_file ] /etc/getty −c file

DESCRIPTION

The getty command is a program that is invoked by init(1M). It is the second process in the series (init-getty-login-shell) that ultimately connects a user with the UNIX System.  It can only be executed by the super-user; that is, a process with the user- ID of root.  Initially, getty prints the /etc/issue file, unless an alternate issue file is specified with −i issue_file. Next, getty prints the login message field for the entry it is using from /etc/gettydefs.  getty reads the user’s login name and invokes the login(1) command with the user’s name as the argument. While reading the name, getty attempts to adapt the system to the speed and type of terminal being used.  It does this by using the options and arguments specified. 

The −f option specifies that getty should delay two seconds after detecting a carrier, then flush all input before issuing the login prompt.  This is most useful for discarding extraneous output produced by an intelligent modem. 

The −m option specifies that the ttymap(1) command is to be run with the argument maparg. ttymap sets the terminal character mappings.  Multiple argument words can be passed to ttymap by enclosing them in quotes.  ttymap is run immediately before the prompt for the user loginname.

If a user logs into a tty typing their login name in all caps, the system will automatically translate the uppercase characters to lowercase and set the tty flags to indicate that the terminal is only capable of uppercase letters.  The −C option overrides this translation and leaves the login name in uppercase characters. 

The −X option forces XON/XOFF processing for the tty.  If IXON is not specified for the tty definition in /etc/gettydefs, invoking the −X option forces XON/XOFF processing.  This is equivalent to specifying IXON in /etc/gettydefs for that tty. 

The −S option forces ISTRIP to be on for the tty.  Like the −X option, this is equivalent to specifying ISTRIP in the /etc/gettydefs entry for that tty. 

The −Rn option allows specifying how many times getty tries to lock /etc/wtmp.  When spawning a new tty, getty tries to lock /etc/wtmp every second for n times before failing.  If the −Rn option is not used, the default is 10. 

Line is the name of a tty line in /dev to which getty is to attach itself.  getty uses this string as the name of a file in the /dev directory to open for reading and writing.  Unless getty is invoked with the −h flag, getty will force a hangup on the line by setting the speed to zero before setting the speed to the default or specified speed.  The −t flag plus timeout (in seconds) specifies that getty should exit if the open on the line succeeds and no one types anything in the specified number of seconds. 

Speed, the optional second argument, is a label to a speed and tty definition in the file /etc/gettydefs.  This definition tells getty at what speed to initially run, what the login message should look like, what the initial tty settings are, and what speed to try next should the user indicate that the speed is inappropriate (by typing a <break> character).  The default speed is 300 baud. 

Type, the optional third argument, is a character string describing to getty what type of terminal is connected to the line in question.  getty recognizes the following types:

nonedefault
ds40-1DATASPEED terminal 40/1
tektronix,tekTEKTRONIX
vt61Digital Equipment vt61
vt100Digital Equipment vt100
hp45Hewlett-Packard 45
c100Concept 100

The default terminal is none; i.e., any crt or normal terminal unknown to the system.  Also, for terminal type to have any meaning, the virtual terminal handlers must be compiled into the operating system.  They are available, but not compiled in the default condition. 

Linedisc, the optional fourth argument, is a character string describing which line discipline to use in communicating with the terminal. Again, the hooks for line disciplines are available in the operating system, but there is only one presently available, the default line discipline LDISC0. 

When given no optional arguments, getty sets the speed of the interface to 300 baud, specifies that raw mode is to be used (awaken on every character), that echo is to be suppressed, either parity allowed, new-line characters will be converted to carriage return-line feed, and tab expansion performed on the standard output.  It types the login message before reading the user’s name a character at a time.  If a null character (or framing error) is received, it is assumed to be the result of the user pushing the “break” key.  This will cause getty to attempt the next speed in the series.  The series that getty tries is determined by what it finds in /etc/gettydefs. 

After the user’s name has been typed in, it is terminated by a new-line or carriage-return character.  The latter results in the system being set to treat carriage returns appropriately (see ioctl(2)).

The user’s name is scanned to see if it contains any lower case alphabetic characters; if not, and if the name is non-empty, the system is told to map any future upper case characters into the corresponding lower case characters. 

Finally, login is exec’d with the user’s name as an argument.  Additional arguments may be typed after the login name.  These are passed to login, which will place them in the environment (see login(1)).

A check option is provided.  When getty is invoked with the −c option and file, it scans the file as if it were scanning /etc/gettydefs and prints out the results to the standard output.  If there are any unrecognized modes or improperly constructed entries, it reports these.  If the entries are correct, it prints out the values of the various flags.  See ioctl(2) to interpret the values. Note that some values are added to the flags automatically.

Example

A valid inittab entry is:

00:23:respawn:/etc/getty −m /usr/lib/keyboard/french.map tty00 9600

FILES

/etc/gettydefs

SEE ALSO

ct(1C), init(1M), login(1), uugetty(1M), ioctl(2), gettydefs(4), inittab(4), tty(7). 

BUGS

While getty understands simple single character quoting conventions, it is not possible to quote certain special control characters used by getty. Thus, you cannot log in via getty and type a #, @, /, !, _, backspace, ^U, ^D, or & as part of your login name or arguments.  getty uses them to determine when the end of the line has been reached, which protocol is being used, and what the erase character is.  They will always be interpreted as having their special meaning. 

WARNING

When connecting two computers using a direct connection, be sure to use the modem-control devices, or use uugetty(1M) instead of getty(1M).

ADDED VALUE

This entry, supplied by SunSoft, Inc., contains enhancements to UNIX ­System V. 

\*U  —  Version 1.0

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