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.
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.
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:
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.
After modifying /etc/gettydefs,
run it through getty
with the check option to be sure there are no errors.
m # B9600 HUPCL # B9600 CS8 SANE HUPCL TAB3 ECHOE IXANY #\r\n@!login: # mgetty 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.
kiosk96 # B9600 C88 SANE HUPCL #B9600 CS8 SANE HUPCL # no prompt # kiosk96 #AUTOIt would be used in conjunction with an inittab(F) entry such as:
Sela:234:respawn:/etc/getty tty1a kiosk96The 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.
finger96 # B9600 CS8 SANE HUPCL #B9600 CS8 SANE HUPCL #enter name of user to look up: # finger96 # /usr/bin/fingerIt would be used in conjunction with an inittab(F) entry such as the following:
Sela: 234:respawn:/etc/getty tty1a finger96This prompts for a user name, then runs finger(C) on it. Note that finger takes arguments other than local user names.