getty(M) 19 June 1992 getty(M) Name getty, uugetty - set terminal type, modes, speed, and line discipline Syntax /etc/getty [ -h ] [ -t timeout ] line [ speed [ type [ linedisc ] ] ] /etc/getty -c file /usr/lib/uucp/uugetty [-a[-d dialer]] [-t timeout] line [speed [type [linedisc] ] ] /usr/lib/uucp/uugetty -c file Description getty is a program that is invoked by init(M). It is the second process in the series, (init-getty-login-shell), that ultimately connects a user with the UNIX system. getty uses initcond(ADM) to secure the terminal for logins. In previous versions, getty was complemented by the command uugetty, which allowed bidirectional line use. In this release of UNIX, uugetty exists as a shell script that calls getty, which now recognizes all the arguments required by uugetty. Initially getty displays the login message field for the entry it is using from /etc/gettydefs. getty reads the user's login name and invokes the login(M) command with the user's name as argument. While reading the name, getty attempts to adapt the system to the speed and type of device being used. 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 direc- tory to open for reading and writing. The available options are as follows: -a Enables automatic baud rate detection. The baud rate is detected by reading the dialer entry in /usr/lib/uucp/Devices (or the equivalent file if the system has been customized). -d dialer Specifies dialer to be used for automatic baud rate detec- tion. This option is ignored if the dialer entry is present in /usr/lib/uucp/Devices or the equivalent file. -t timeout Specifies that getty should exit if the open on the line succeeds and there is no response to the login prompt in timeout seconds. line Defines the name of the line to which getty will attach itself. The line name will point to an entry in the /dev directory: for example, /dev/tty00. speed Defines the entry to use from the /etc/gettydefs file. The entry defines the line speed, the login message, the initial tty setting, and the next speed to try if the user says the speed is inappropriate (by sending a break character). If no speed is supplied, the first entry in /etc/gettydefs is used. If /etc/gettydefs cannot be read, a default speed of 300 baud is used. type Defines the type of terminal connected to the line. The default terminal is none, representing a normal terminal unknown to the system. For terminal type to have any mean- ing, the virtual terminal handlers must be compiled into the operating system. They are available, but not compiled in the default condition. linedisc Sets the line discipline to use on the line. The hooks for line disciplines are available in the operating system; four are available, numbered LDISC0 - LDISC4. The default is LDISC0. -h This argument is provided for internal use by ct, and is not documented here. -c file Checks the speed and tty definitions in file and sends the results to standard output. Unrecognized modes and improp- erly constructed entries are reported. For correct entries, flag values are printed. file is replaced by /etc/gettydefs or a similarly structured file. getty displays the login message before reading the user's name a charac- ter at a time. If a null character (or framing error) is received, it is assumed to be the result of the user pressing the Break key. This will cause getty to attempt the next speed in the series determined by what it finds in the file /etc/gettydefs. The user's name is terminated by a new-line or carriage-return character. This is used to define the subsequent treatment of carriage returns (see ioctl(S)). The user's name is scanned to see if it contains any lowercase alphabetic characters. getty suggests that the user use all lowercase characters. If the user uses uppercase characters, the system is told to map any future uppercase characters into the corresponding lowercase characters. Finally, login is executed with the user's name as an argument. Addi- tional arguments may be typed after the login name. These are passed to login, which will place them in the environment (see login(M)). 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 displays the values of the various flags. See ioctl(S) to interpret the values. Note that some values are added to the flags automatically. Files /etc/gettydefs /etc/issue /usr/lib/uucp/Devices See also ct(C), cu(C), dial(ADM), gettydefs(F), init(M), initcond(ADM), inittab(F), ioctl(S), login(M), tty(M,) tty(C,) uucico(ADM). Notes 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 #, @, /, !, _, ^U, ^D, & or backspace as part of your login name or arguments. getty uses them to determine when the end of the line has been reached, which proto- col is being used, and what the erase character is. They will always be interpreted as having these special meanings. ct will not work when [uu]getty is used with an intelligent modem such as penril or ventel. In order for a line to be used in both directions, there must be an entry for that line in /usr/lib/uucp/Devices. If a line is being used in both directions, [uu]getty will wait to read a character before it outputs the login message, thus preventing two gettys from looping. [uu]getty allows users to log in on bidirectional lines, but if the line is free uucico, cu, or ct can use it for dialing out. The implementation depends on the fact that uucico, cu, and ct create lock files when de- vices are used. When the open returns (or when the first character is read when the line is being used in both directions) the status of the lock file indicates whether the line is being used by uucico, cu, ct, or by someone trying to log in. Note that when the line is being used in both directions, several carriage-return characters may be required before the login message is output. Human users should be able to handle this slight inconvenience. uucico trying to log in will have to be told by using the following login script: "" \r\d\r\d\r\d\r in:--in: ... where the ... is whatever would normally be used for the login sequence. If /etc/gettydefs is unreadable, getty sets the speed of the interface to 300 baud, specifies that raw mode will be used (awaken on every charac- ter), that echo will be suppressed, either parity allowed, that new-line characters will be converted to carriage return-line feed, and that tab expansion is performed on the standard output. If there is a getty on one end of a direct line between two machines, there must be a getty or uugetty on the other end as well. Here is an /etc/inittab entry using getty on an intelligent modem or direct line: 30:2:respawn:/usr/lib/uucp/uugetty -t 60 tty00 1200