The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the University of
California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
from: @(#)gettytab.5 8.4 (Berkeley) 4/19/94
$Id: gettytab.5,v 1.17 1998/05/04 02:37:24 steve Exp $
"
.Dd April 19, 1994 .Dt GETTYTAB 5 .Os BSD 4.2 turn off hyphenation
.Sh NAME .Nm gettytab .Nd terminal configuration data base .Sh SYNOPSIS .Nm gettytab .Sh DESCRIPTION The .Nm file is a simplified version of the .Xr termcap 5 data base used to describe terminal lines. The initial terminal login process .Xr getty 8 accesses the .Nm file each time it starts, allowing simpler reconfiguration of terminal characteristics. Each entry in the data base is used to describe one class of terminals.
p There is a default terminal class, .Em default , that is used to set global defaults for all other classes. (That is, the .Em default entry is read, then the entry for the class required is used to override particular settings.) .Sh CAPABILITIES Refer to .Xr termcap 5 for a description of the file layout. The .Em default column below lists defaults obtained if there is no entry in the table obtained, nor one in the special .Em default table. l -column Namexx /usr/bin/login Default t Sy Name Type Default Description t "ac str unused expect-send chat script for modem answer" t "ap bool false terminal uses any parity" t "bk str 0377 alternate end of line character (input break)" t "c0 num unused tty control flags to write messages" t "c1 num unused tty control flags to read login name" t "c2 num unused tty control flags to leave terminal as" t "ce bool false use crt erase algorithm" t "ck bool false use crt kill algorithm" t "cl str" Ta Dv NULL Ta .No "screen clear sequence" t "co bool false console - add" .Ql \en after login prompt t "ct num 10 chat timeout for ac/ic scripts" t "dc num 0 chat debug bitmask" t "de num 0 delay secs and flush input before writing first prompt" t "ds str" Ta So Li ^Y Sc Ta .No "delayed suspend character" t "dx bool false set" .Dv DECCTLQ t "ec bool false leave echo" .Tn OFF t "ep bool false terminal uses even parity" t "er str" Ta So Li ^? Sc Ta .No "erase character" t "et str" Ta So Li ^D Sc Ta .No "end of text"
q Dv EOF character t "ev str" Ta Dv NULL Ta .No "initial environment" t "f0 num unused tty mode flags to write messages" t "f1 num unused tty mode flags to read login name" t "f2 num unused tty mode flags to leave terminal as" t "fl str" Ta So Li ^O Sc Ta .No "output flush character" t "hc bool false do" .Tn NOT hangup line on last close t "he str" Ta Dv NULL Ta .No "hostname editing string" t "hn str hostname hostname" t "ht bool false terminal has real tabs" t "hw bool false do cts/rts hardware flow control" t "i0 num unused tty input flags to write messages" t "i1 num unused tty input flags to read login name" t "i2 num unused tty input flags to leave terminal as" t "ic str unused expect-send chat script for modem initialization" t "if str unused display named file before prompt, like /etc/issue" t "ig bool false ignore garbage characters in login name" t "im str" Ta Dv NULL Ta .No "initial (banner) message" t "in str" Ta So Li ^C Sc Ta .No "interrupt character" t "is num unused input speed" t "kl str" Ta So Li ^U Sc Ta .No "kill character" t "l0 num unused tty local flags to write messages" t "l1 num unused tty local flags to read login name" t "l2 num unused tty local flags to leave terminal as" t "lm str login: login prompt" t "ln str" Ta So Li ^V Sc Ta .No "``literal next'' character" t "lo str" Ta Pa /usr/bin/login Ta .No "program to exec when name obtained" t "mb bool false do flow control based on carrier" t "nl bool false terminal has (or might have) a newline character" t "np bool false terminal uses no parity (i.e. 8-bit characters)" t "nx str default next table (for auto speed selection)" t "o0 num unused tty output flags to write messages" t "o1 num unused tty output flags to read login name" t "o2 num unused tty output flags to leave terminal as" t "op bool false terminal uses odd parity" t "os num unused output speed" t "pc str" Ta So Li \e0 Sc Ta .No "pad character" t "pe bool false use printer (hard copy) erase algorithm" t "pf num 0 delay" between first prompt and following flush (seconds) t "pp str unused PPP authentication program" t "ps bool false line connected to a" .Tn MICOM port selector t "qu str" Ta So Li ^\e Sc Ta .No "quit character" t "rp str" Ta So Li ^R Sc Ta .No "line retype character" t "rt num unused ring timeout when using ac" t "rw bool false do" .Tn NOT use raw for input, use cbreak t "sp num unused line speed (input and output)" t "su str" Ta So Li ^Z Sc Ta .No "suspend character" t "tc str none table continuation" t "to num 0 timeout (seconds)" t "tt str" Ta Dv NULL Ta .No "terminal type (for environment)" t "ub bool false do unbuffered output (of prompts etc)" t "we str" Ta So Li ^W Sc Ta .No "word erase character" t xc bool false do .Tn NOT echo control chars as .Ql ^X t "xf str" Ta So Li ^S Sc Ta Dv XOFF (stop output) character t "xn str" Ta So Li ^Q Sc Ta Dv XON (start output) character t "Lo str C the locale name used for %d in the banner message" .El
p The following capabilities are no longer supported by .Xr getty 8 Ns : l -column Namexx /usr/bin/login Default t "bd num 0 backspace delay" t "cb bool false use crt backspace mode" t "cd num 0 carriage-return delay" t "fd num 0 form-feed (vertical motion) delay" t "lc bool false terminal has lower case" t "nd num 0 newline (line-feed) delay" t "uc bool false terminal is known upper case only" .El
p If no line speed is specified, speed will not be altered from that which prevails when getty is entered. Specifying an input or output speed will override line speed for stated direction only.
p Terminal modes to be used for the output of the message, for input of the login name, and to leave the terminal set as upon completion, are derived from the boolean flags specified. If the derivation should prove inadequate, any (or all) of these three may be overridden with one of the .Em c0 , .Em c1 , .Em c2 , .Em i0 , .Em i1 , .Em i2 , .Em l0 , .Em l1 , .Em l2 , .Em o0 , .Em o1 , or .Em o2 numeric specifications, which can be used to specify (usually in octal, with a leading '0') the exact values of the flags. These flags correspond to the termios .Em c_cflag , .Em c_iflag , .Em c_lflag , and .Em c_oflag fields, respectively. Each these sets must be completely specified to be effective. The .Em f0 , .Em f1 , and .Em f2 are excepted for backwards compatibility with a previous incarnation of the TTY sub-system. In these flags the bottom 16 bits of the (32 bits) value contain the sgttyb .Em sg_flags field, while the top 16 bits represent the local mode word.
p Should .Xr getty 8 receive a null character (presumed to indicate a line break) it will restart using the table indicated by the .Em nx entry. If there is none, it will re-use its original table.
p Delays are specified in milliseconds, the nearest possible delay available in the tty driver will be used. Should greater certainty be desired, delays with values 0, 1, 2, and 3 are interpreted as choosing that particular delay algorithm from the driver.
p The .Em cl screen clear string may be preceded by a (decimal) number of milliseconds of delay required (a la termcap). This delay is simulated by repeated use of the pad character .Em pc .
p The initial message, login message, and initial file; .Em im , .Em lm and .Em if may include any of the following character sequences, which expand to information about the environment in which .Xr getty 8 is running.
p l -tag -offset indent -width %xxxxxxxxxxxxxx t %d The current date and time in the locale's representation as of the .Em Lo string (the %+ format of .Xr strftime 3 ). t %h The hostname of the machine, which is normally obtained from the system using .Xr gethostname 3 , but may also be overridden by the .Em hn table entry. In either case it may be edited with the .Em he string. A '@' in the .Em he string causes one character from the real hostname to be copied to the final hostname. A '#' in the .Em he string causes the next character of the real hostname to be skipped. Each character that is neither '@' nor '#' is copied into the final hostname. Surplus '@' and '#' characters are ignored. t %t The tty name. t "%m, %r, %s, %v" The type of machine, release of the operating system, name of the operating system, and version of the kernel, respectively, as returned by .Xr uname 3 . t %% A .Dq % character. .El
p When getty execs the login process, given in the .Em lo string (usually .Dq Pa /usr/bin/login ) , it will have set the environment to include the terminal type, as indicated by the .Em tt string (if it exists). The .Em ev string, can be used to enter additional data into the environment. It is a list of comma separated strings, each of which will presumably be of the form .Em name=value .
p If a non-zero timeout is specified, with .Em to , then getty will exit within the indicated number of seconds, either having received a login name and passed control to .Xr login 1 , or having received an alarm signal, and exited. This may be useful to hangup dial in lines.
p Output from .Xr getty 8 is even parity unless .Em op or .Em np is specified. The .Em op string may be specified with .Em ap to allow any parity on input, but generate odd parity output. Note: this only applies while getty is being run, terminal driver limitations prevent a more complete implementation. .Xr Getty 8 does not check parity of input characters in .Dv RAW mode.
p If .Em pp string is specified and a PPP link bring up sequence is recognized, getty will invoke the program referenced by the pp option. This can be used to handle incoming PPP calls.
p .Nm Getty provides some basic intelligent modem handling by providing a chat script feature available via two capabilities:
p l -tag -offset indent -width xxxxxxxx -compact t ic Chat script to initialize modem. t ac Chat script to answer a call. .El
p A chat script is a set of expect/send string pairs. When a chat string starts, .Nm getty will wait for the first string, and if it finds it, will send the second, and so on. Strings specified are separated by one or more tabs or spaces. Strings may contain standard ascii characters and special 'escapes', which consist of a backslash character followed by one or more characters which are interpreted as follows:
p l -tag -offset indent -width xxxxxxxx -compact t \ea bell character. t \eb backspace. t \en newline. t \ee escape. t \ef formfeed. t \ep half-second pause. t \er carriage return. t \eS, \es space character. t \et tab. t \exNN hexadecimal byte value. t \e0NNN octal byte value. .El
p Note that the .Ql \ep sequence is only valid for send strings and causes a half-second pause between sending the previous and next characters. Hexidecimal values are, at most, 2 hex digits long, and octal values are a maximum of 3 octal digits.
p The .Em ic chat sequence is used to initialize a modem or similar device. A typical example of an init chat script for a modem with a hayes compatible command set might look like this:
p .Dl :ic="" ATE0Q0V1\er OK\er ATS0=0\er OK\er:
p This script waits for nothing (which always succeeds), sends a sequence to ensure that the modem is in the correct mode (suppress command echo, send responses in verbose mode), and then disables auto-answer. It waits for an "OK" response before it terminates. The init sequence is used to check modem responses to ensure that the modem is functioning correctly. If the init script fails to complete, .Nm getty considers this to be fatal, and results in an error logged via .Xr syslogd 8 , and exiting.
p Similarly, an answer chat script is used to manually answer the phone in response to (usually) a "RING". When run with an answer script, .Nm getty opens the port in non-blocking mode, clears any extraneous input and waits for data on the port. As soon as any data is available, the answer chat script is started and scanned for a string, and responds according to the answer chat script. With a hayes compatible modem, this would normally look something like:
p .Dl :ac=RING\er ATA\er CONNECT:
p This causes the modem to answer the call via the "ATA" command, then scans input for a "CONNECT" string. If this is received before a .Em ct timeout, then a normal login sequence commences.
p The .Em ct capability specifies a timeout for all send and expect strings. This timeout is set individually for each expect wait and send string and must be at least as long as the time it takes for a connection to be established between a remote and local modem (usually around 10 seconds).
p In most situations, you will want to flush any additional input after the connection has been detected, and the .Em de capability may be used to do that, as well as delay for a short time after the connection has been established during which all of the connection data has been sent by the modem.
p .Sh SEE ALSO .Xr login 1 , .Xr gethostname 3 , .Xr uname 3 , .Xr termcap 5 , .Xr getty 8 , .Xr telnetd 8 . .Sh BUGS The special characters (erase, kill, etc.) are reset to system defaults by .Xr login 1 . In .Em all cases, '#' or '^H' typed in a login name will be treated as an erase character, and '@' will be treated as a kill character.
p The delay stuff is a real crock. Apart form its general lack of flexibility, some of the delay algorithms are not implemented. The terminal driver should support sane delay settings.
p The .Em he capability is stupid.
p The .Xr termcap 5 format is horrid, something more rational should have been chosen. .Sh HISTORY The .Nm file format appeared in x 4.2 .