After the initialization, the line is closed and reopened. This time, however, the line is opened in blocking mode so that the device is not tied up. Detection of the carrier signal will allow the line to be opened.
Next, getty types the issue (or login banner, usually from /etc/issue ) and login prompt. Finally, getty reads the user's login name and invokes login (1m) with the user's name as an argument. While reading the name, getty attempts to adapt the system to the speed of the terminal being used, and also sets certain terminal parameters (see termio (7)) to conform with the user's login procedure.
The tty device used by getty is determined by the line argument. Getty uses the string /dev/ line as the name of the device to attach itself to. Unless getty is invoked with the -h flag (or HANGUP=NO is specified in the defaults file), it will force a hangup on the line by setting the speed to zero. Giving -r delay on the command line (or using WAITCHAR=YES and DELAY= delay in the defaults file) will cause getty to wait for a single character from the line, and then to wait delay seconds before continuing. If no delay is desired, use -r0 . Giving -w waitfor on the command line (or using WAITFOR= waitfor in the defaults file) will cause getty to wait for the specified string of characters from the line before continuing. Giving -t timeout on the command line (or using TIMEOUT= timeout in the defaults file) will cause getty to exit if no user name is accepted within timeout seconds after the login prompt is typed.
The speed argument is a label to a entry in the /etc/gettydefs file (see gettydefs (4)). This entry defines to getty the initial speed (baud rate) and tty settings, the login prompt to be used, the final speed and tty settings, and a pointer to another entry to try should the user indicate that the speed is not correct. This is done by sending a <break> character (actually sequence). Under certain conditions, a carriage-return will perform the same function. This is usually the case when getty is set to a higher speed than the modem or terminal. Getty scans the gettydefs file sequentially looking for a matching entry. If no speed was given or the entry cannot be found, the first entry in the /etc/gettydefs file is used as a default. In the event that the gettydefs file cannot be accessed, there is a compiled-in default entry that is used.
The type argument is a string which names the type of terminal attached to the line. The type should be a valid terminal name listed in the termcap (7) database. Getty uses this value to determine how to clear the video display. It also sets the environment variable TERM to the contents of this value.
The lined argument is a string describing the line discipline to use on the line. The default is LDISC0 .
As mentioned, getty types the login prompt and then reads the user's login name. If a null character is received, it is assumed to be the result of the user pressing the <break> key or the carriage-return key to indicate the speed is wrong. This causes getty to locate the next speed in the series (defined in /etc/gettydefs).
The user's name is terminated by a new-line or carriage-return character. A carriage-return results in the system being set to map those to new-lines (see ioctl (2)).
The user's name is scanned to see if it contains only upper-case characters. If so, the system is set to map any future upper-case characters into lower-case.
A check option is provided for testing the gettydefs file. When getty is invoked with the -c gettydefs option, it scans the named gettydefs file and prints out (to the standard output) the values it sees. If any parsing errors occur (due to errors in the syntax of the gettydefs file), they are reported.
CONNECT\\A\r\n
WAITFOR=RING CONNECT="" ATA\r CONNECT\\A
Also, certain "@" char parameters are recognized. Those parameters, and the value that is substituted for them are:
Line initialization is performed just after the
line
is opened and prior to handling the WAITCHAR and/or WAITFOR options.
Initialization is accomplished by placing an
Getty
supports subfields in the expect field of the form
The for the connect chat script is exactly the same as that
for the INIT script (see LINE INITIALIZATION), with the following
addition:
When uugetty starts up, if it sees a lock file on the line it intends to use, it will use the pid in the lock file to see if there is an active process holding the lock. If not, uugetty will remove the lock file and continue. If a valid process is found, uugetty will sleep until that process releases the lock and then it will exit, forcing init (1m) to spawn a new uugetty. Once no conflicting process is found, uugetty grabs the line by creating the lock file itself before issuing the login prompt. This prevents other processes from using the line.
Uugetty
will normally only lock the name of the line it is running on. On
systems where there are two device names referring to the same port
(as is the case where one device uses modem control while the other
doesn't), place a line of the form
While waiting for carrier detect, Uugetty will check for lockfiles every 30 seconds. If lockfiles are found, uugetty will exit, and init will respawn another getty. This allows the modem to be reinitialized after another process has used the modem.
Getty_ps in its current evil form: Kris Gleason <gleasokr@boulder.colorado.edu>
Original getty_ps: Paul Sutcliffe, Jr. <paul@devon.lns.pa.us> UUCP: ...!rutgers!devon!paul
Autobauding routines adapted from code submitted by Mark Keating <...!utzoo!censor!markk>