Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

login(1)

tty(4)

gettytab(5)

ttys(5)

init(8)

syslog(8)

getty(8)

NAME

getty  − set terminal mode

SYNTAX

/etc/getty [ type ] [ tty ]

DESCRIPTION

The getty routine is one of several ( init, getty, login, shell ) by which users gain access to the ULTRIX system from a terminal. getty initializes a terminal line, reads a login name, and invokes login(.). While reading the name, getty tries to adapt the system to the speed and type of terminal on the line specified by the tty argument.

The init command typically invokes getty, as directed by the command field in the /etc/ttys file.

getty first tries to initialize the line.  It examines /etc/ttys and sets up the line for local or remote connections, as appropriate.  Next, getty calls vhangup() to revoke access to the terminal by any background processes that could have /dev/tty open. The getty routine then opens /dev/tty for reading and writing. File descriptors 0, 1, and 2 become the standard input, output, and diagnostic devices. If the terminal line is connected to a modem, the open is not completed until someone dials up and establishes carrier on the channel.

If a terminal exists, but an error occurs when trying to open the terminal, getty writes a message to the system console.  The message is repeated every 10 minutes until the terminal is available, or the /etc/ttys entry for the terminal is modified to indicate that the terminal is off, and init() is notified by a hangup.

The getty routine checks every minute to see if the terminal is still off.

Next, getty reads a login name, terminated by a newline or carriage-return character.  For a carriage return, the system is set to treat carriage returns appropriately.  For further information, see tty(.).

The getty routine scans the user’s name to see if it contains any lower-case alphabetic characters.  If it does not, and the name is nonempty, the system is told to map any future upper-case characters into the corresponding lower-case characters.

Finally, getty calls login with the user’s name as an argument.

Most of the default actions of getty can be changed with a suitable gettytab table.

The getty routine can be set to timeout after some interval with the to variable in the gettytab() table. Thus, if the user does not enter a login name after a reasonable amount of time, getty hangs up the dialup line.

ARGUMENTS

ttyThe special device file in the /dev directory to open for the terminal (for example, ttyh0). If there is no argument or the argument is "+", the terminal line is assumed to be open as file descriptor 0.

typeUsed to make getty treat the line specially. This argument is used as an index into the gettytab() database, to determine the characteristics of the line. If there is no argument, or there is no such table, the default entry in gettytab() is used. If there is no /etc/gettytab, a set of system defaults is used.

The gettytab() entry is used to define specific terminal hardware attributes such as the baud rate and number of bits per character.  Terminals which are setup to transmit and receive 8-bit characters must specify a gettytab entry which appropriately sets up the line.  For example a terminal line setup to operate at 9600 baud with 8-bit characters may use the "8bit.9600" gettytab entry.  If a terminal is setup to use 8-bit characters, but uses a 7-bit gettytab entry (such as "std.9600") the output from the getty program may be corrupted.  This output corruption appears as multinational characters being generated by getty or login programs.  When these programs operate in 7-bit mode, the high order bit of the character is used as software provided parity.  This parity generation causes conventional ascii characters to be transformed into multinational characters.  By using an 8-bit gettytab entry, characters will be transmitted without any software generated parity.
 

If indicated by the table located, getty will clear the terminal screen, print a banner heading, and prompt for a login name. Usually either the banner or the login prompt will include the system hostname. Then the user’s name is read, a character at a time. If a null character is received, it is assumed to be the result of the user pushing the break (interrupt) key. The speed is usually then changed and the “login:” prompt is displayed again. a second break changes the speed again and redisplays the “login:” prompt.  Successive break characters cycle through some standard set of speeds.

FILES

/etc/gettytabData base describing terminal lines

DIAGNOSTICS

The getty uses syslog() to produce diagnostic messages. Therefore, the syslog configuration file will determine where the messages are printed.  For further information, see syslog(8).

getty: tty: cannot open. 

A terminal which is turned on in the ttys file cannot be opened. This is probably because the requisite lines are either not configured into the system or the associated device was not attached during boot-time system configuration. The syslog error logging level is LOG_ERR.

getty: command, tty failing, open blocked. 

The getty routine tried a non-blocking open of the terminal line and the open still blocked.  This can only happen on devices that have not implemented O_NDELAY. For further information, see open(.). The getty routine tries to continue but the line may not be properly initialized. The syslog error logging level is LOG_ERR.

getty: command, tty  open failed, reason. 

getty tried a non-blocking open of the terminal line and the open failed.  reason is the explanation produced by the perror() routine for why the open failed. getty tries to continue but the line may not be properly initialized. The syslog error logging level is LOG_ERR.

getty: in use line tty. 

The Itty is “in use” by some other process.  The getty will not initialize a line that is already “in use”. The getty will block until the line is no longer in use. See tty() and open() for discussions on shared lines. The syslog error logging level is LOG_INFO.

getty could not set pgrp, reason. 

The getty tried and failed to initialize the process group of the terminal to process group 0.  See tty() for a discussion of process groups. reason is the explanation produced by perror() for the failure. The syslog error logging level is LOG_INFO.

SEE ALSO

login(1), tty(4), gettytab(5), ttys(5), init(8), syslog(8)

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