gettydefs(F)


gettydefs -- speed and terminal settings used by getty

Format

label # initial_flags # final_flags # login_prompt # next_label [# [AUTO] [login_program]]

Description

gettydefs contains information used by getty(M) to set up the speed and terminal settings for a line. It supplies information on what the login prompt should look like. It also supplies the speed to try next if the user indicates that the current speed is not correct by typing a BREAK character. Optionally, it can define a different executable program to run as the login program.

Each entry in gettydefs must be followed by a carriage return and a blank line. The fields of each entry are separated by ``#'' characters. The fields can also contain quoted characters of the form \b, \n, \c, and so on, as well as \nnn, where nnn is the octal value of the desired character.

Each entry contains the following fields. The first five are required; the sixth field is optional.


label
The string against which getty tries to match its speed argument. It is often the speed, such as 9600bps, at which the terminal is supposed to run, but it need not be (see below).

initial_flags
The initial ioctl settings to which the terminal is to be set. The flags that getty understands are the same as the ones listed in /usr/include/sys/termio.h (see termio(M)). Normally only the speed flag is required in the initial_flags. getty automatically sets the terminal to raw input mode and takes care of most of the other flags. The initial_flag settings remain in effect until getty executes login. Note that, if AUTO is set, the terminal is left in the state specified by initial_flags even if final_flags is specified.

The /etc/gettydefs entries for PC-scancode terminals (including the video console) use the SCANCODE flag to set the default mapping from scancodes to a character set. The getty utility understands the SCANCODE flag in /etc/gettydefs entries and issues an ioctl request to set the KB_ISSCANCODE | KB_XSCANCODE flags on the tty.


final_flags
This field uses the same format as the initial_flags. The speed flag is again required. These flags are set just prior to getty executing login unless AUTO is set, in which case the terminal is left in the state specified by initial_flags.

SANE is a composite flag that sets the following parameters from termio(M):

CREAD BRKINT IGNPAR ISTRIP ICRNL IXON ISIG ICANON
ECHO ECHOK OPOST ONLCR

SANE also clears the following modes:

CLOCAL
IGNBRK PARMRK INPCK INLCR IUCLC IXOFF
XCASE ECHOE ECHONL NOFLSH
OLCUC OCRNL ONOCR ONLRET OFILL OFDEL NLDLY CRDLY
TABDLY BSDLY VTDLY FFDLY

Other commonly specified final_flags are:


HUPCL
Hang up line on final close.

IXANY
Any character restarts output,

TAB3
Expand tabs as spaces.

login_prompt
Contains login prompt message that greets users. Several character sequences are recognized, including:

\b
backspace

\f
form feed

\n
linefeed

\r
carriage return

\t
tab

\v
vertical tab

\nnn
ASCII character (3 octal digits)

next_label
Identifies the next entry in gettydefs for getty to try if the current one is not successful. getty tries the next label if a user presses the BREAK key while attempting to log in to the system. Groups of entries, for example, for dial-up lines or for TTY lines, should form a closed set so that getty cycles back to the original entry if none of the entries is successful. For instance, 2400 linked to 1200, which in turn is linked to 300, which is finally linked to 2400.

login_program (Optional)
The name of an executable program to be invoked instead of login(M). AUTO can be specified alone or in front of the login_program, separated by a space.

If login_program is specified without AUTO, getty(M) opens the terminal specified by its line argument, sets it to the specified initial_flags, and prompts with the login_prompt field until the user types something and presses <Enter>. It then sets the terminal to the specified final_flags and passes the user input to the login_program as its command line argument(s), divided into arguments according to any whitespace separators in the user's input.

If both login_program and AUTO are specified, getty(M) opens the terminal specified by the line argument, sets it to the specified initial_flags, and immediately starts the login_program, passing getty's line argument as its single command-line argument. It does not issue the login_prompt, read user input, or set the terminal to final_flags.

If AUTO is specified without login_program, login(M) is executed with line as its single command-line argument. It does not issue the login_prompt, read user input, or set the terminal to final_flags. This may be useful in conjunction with an account named after a specific terminal line.

login_program is executed as root, with no login UID (see setluid(S) and su(C)). The first three descriptors (stdin, stdout, and stderr) are open for read/write access to the terminal line as specified for getty(M). stty(C) settings are determined by the initial_flags field if AUTO is set or by final_flags if AUTO is not set.

See recon(C) for a different method of running a program on a specified terminal line.

If getty is called without a second argument, then the first entry of /etc/gettydefs is used as the default entry. The first entry is also used if getty cannot find the specified label. If /etc/gettydefs itself is missing, there is one entry built into the command which will bring up a terminal at 300 baud.

After modifying /etc/gettydefs, run it through getty with the check option to be sure there are no errors.

Examples

Example 1

This is a standard entry from /etc/gettydefs for 9600bps terminal lines:
   m # B9600 HUPCL # B9600 CS8 SANE HUPCL TAB3 ECHOE IXANY #\r\n@!login: # m
getty identifies this entry by the line mode label ``m''.

The second and third fields indicate the speed (B9600) and the HUPCL line characteristic. The third field includes some additional characteristics including SANE and TAB3.

The fourth field defines that the system name should be displayed in the ``login:'' prompt.

The final field directs getty to repeat this entry if it is unsuccessful.

Example 2

An example /etc/gettydefs line for autologin is:
   kiosk96 # B9600 C88 SANE HUPCL #B9600 CS8 SANE HUPCL
       # no prompt # kiosk96 #AUTO
It would be used in conjunction with an inittab(F) entry such as:
   Sela:234:respawn:/etc/getty tty1a kiosk96
The inittab entry invokes the gettydefs entry ``kiosk96'' on /dev/tty1a. The gettydefs entry specifies autologin with the default login program, /bin/login. Because it is an autologin, the terminal name (tty1a in this case) is passed to login automatically.

The administrator would also have created an passwordless account named tty1a with startup scripts to run a kiosk application. A system status display is another possible application.

Example 3

The following /etc/gettydefs line illustrates how to set up a captive application. configures ``tty1a'' to issue a prompt asking for a user name, then run finger(C) on that user:
   finger96 # B9600 CS8 SANE HUPCL #B9600 CS8 SANE HUPCL
       #enter name of user to look up: # finger96 # /usr/bin/finger
It would be used in conjunction with an inittab(F) entry such as the following:
   Sela: 234:respawn:/etc/getty tty1a finger96
This prompts for a user name, then runs finger(C) on it. Note that finger takes arguments other than local user names.

Files


/etc/gettydefs
full pathname of gettydefs

See also

getty(M), inittab(F), ioctl(S), login(M), recon(C), scancode(HW), stty(C), termio(M)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005