]> git.saurik.com Git - apple/system_cmds.git/blame - getty.tproj/gettytab.5
system_cmds-541.tar.gz
[apple/system_cmds.git] / getty.tproj / gettytab.5
CommitLineData
1815bff5
A
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" from: @(#)gettytab.5 8.4 (Berkeley) 4/19/94
34d340d7
A
33.\" $FreeBSD: src/libexec/getty/gettytab.5,v 1.41 2005/01/18 09:29:39 ru Exp $
34.\" "
1815bff5
A
35.Dd April 19, 1994
36.Dt GETTYTAB 5
34d340d7 37.Os
1815bff5
A
38.Sh NAME
39.Nm gettytab
40.Nd terminal configuration data base
41.Sh SYNOPSIS
34d340d7 42.Nm
1815bff5
A
43.Sh DESCRIPTION
44The
34d340d7 45.Nm
1815bff5
A
46file
47is a simplified version of the
48.Xr termcap 5
49data base
50used to describe terminal lines.
51The initial terminal login process
52.Xr getty 8
53accesses the
34d340d7 54.Nm
1815bff5
A
55file each time it starts, allowing simpler
56reconfiguration of terminal characteristics.
57Each entry in the data base
58is used to describe one class of terminals.
59.Pp
60There is a default terminal class,
34d340d7 61.Va default ,
1815bff5
A
62that is used to set global defaults for all other classes.
63(That is, the
34d340d7 64.Va default
1815bff5
A
65entry is read, then the entry for the class required
66is used to override particular settings.)
67.Sh CAPABILITIES
68Refer to
69.Xr termcap 5
70for a description of the file layout.
71The
34d340d7 72.Va default
1815bff5
A
73column below lists defaults obtained if there is
74no entry in the table obtained, nor one in the special
34d340d7 75.Va default
1815bff5 76table.
34d340d7
A
77.Bl -column Name Type /usr/bin/login
78.It Sy "Name Type Default Description
79.It "ac str unused expect-send chat script for modem answer"
80.It "al str unused user to auto-login instead of prompting"
1815bff5
A
81.It "ap bool false terminal uses any parity"
82.It "bk str 0377 alternate end of line character (input break)"
83.It "c0 num unused tty control flags to write messages"
84.It "c1 num unused tty control flags to read login name"
85.It "c2 num unused tty control flags to leave terminal as"
86.It "ce bool false use crt erase algorithm"
87.It "ck bool false use crt kill algorithm"
34d340d7 88.It "cl str" Ta Dv NULL Ta
1815bff5
A
89.No "screen clear sequence"
90.It "co bool false console - add"
91.Ql \en
92after login prompt
34d340d7
A
93.It "ct num 10 chat timeout for"
94.Va \&ac
95and
96.Va \&ic
97scripts
98.It "dc num 0 chat debug bitmask"
99.It "de num 0 delay secs and flush input before writing first prompt"
100.It "df str %+ the" Xr strftime 3 "format used for \&%d in the banner message"
1815bff5
A
101.It "ds str" Ta So Li ^Y Sc Ta
102.No "delayed suspend character"
103.It "dx bool false set"
104.Dv DECCTLQ
105.It "ec bool false leave echo"
34d340d7 106.Em OFF
1815bff5
A
107.It "ep bool false terminal uses even parity"
108.It "er str" Ta So Li ^? Sc Ta
109.No "erase character"
110.It "et str" Ta So Li ^D Sc Ta
111.No "end of text"
112.Pq Dv EOF
113character
34d340d7 114.It "ev str" Ta Dv NULL Ta
1815bff5
A
115.No "initial environment"
116.It "f0 num unused tty mode flags to write messages"
117.It "f1 num unused tty mode flags to read login name"
118.It "f2 num unused tty mode flags to leave terminal as"
119.It "fl str" Ta So Li ^O Sc Ta
120.No "output flush character"
121.It "hc bool false do"
34d340d7 122.Em NOT
1815bff5 123hangup line on last close
34d340d7 124.It "he str" Ta Dv NULL Ta
1815bff5
A
125.No "hostname editing string"
126.It "hn str hostname hostname"
127.It "ht bool false terminal has real tabs"
34d340d7 128.It "hw bool false do cts/rts hardware flow control"
1815bff5
A
129.It "i0 num unused tty input flags to write messages"
130.It "i1 num unused tty input flags to read login name"
131.It "i2 num unused tty input flags to leave terminal as"
34d340d7
A
132.It "ic str unused expect-send chat script for modem initialization"
133.It "if str unused display named file before prompt, like /etc/issue"
1815bff5
A
134.It "ig bool false ignore garbage characters in login name"
135.It "im str" Ta Dv NULL Ta
136.No "initial (banner) message"
137.It "in str" Ta So Li ^C Sc Ta
138.No "interrupt character"
139.It "is num unused input speed"
140.It "kl str" Ta So Li ^U Sc Ta
141.No "kill character"
142.It "l0 num unused tty local flags to write messages"
143.It "l1 num unused tty local flags to read login name"
144.It "l2 num unused tty local flags to leave terminal as"
1815bff5
A
145.It "lm str login: login prompt"
146.It "ln str" Ta So Li ^V Sc Ta
147.No "``literal next'' character"
148.It "lo str" Ta Pa /usr/bin/login Ta
149.No "program to exec when name obtained"
150.It "mb bool false do flow control based on carrier"
34d340d7 151.It "nc bool false terminal does not supply carrier (set clocal)"
1815bff5
A
152.It "nl bool false terminal has (or might have) a newline character"
153.It "np bool false terminal uses no parity (i.e. 8-bit characters)"
154.It "nx str default next table (for auto speed selection)"
155.It "o0 num unused tty output flags to write messages"
156.It "o1 num unused tty output flags to read login name"
157.It "o2 num unused tty output flags to leave terminal as"
158.It "op bool false terminal uses odd parity"
159.It "os num unused output speed"
160.It "pc str" Ta So Li \e0 Sc Ta
161.No "pad character"
162.It "pe bool false use printer (hard copy) erase algorithm"
163.It "pf num 0 delay"
164between first prompt and following flush (seconds)
34d340d7
A
165.It "pl bool false start PPP login program unconditionally if"
166.Va \&pp
167is specified
168.It "pp str unused PPP login program"
1815bff5
A
169.It "ps bool false line connected to a"
170.Tn MICOM
171port selector
172.It "qu str" Ta So Li \&^\e Sc Ta
173.No "quit character"
174.It "rp str" Ta So Li ^R Sc Ta
175.No "line retype character"
34d340d7
A
176.It "rt num unused ring timeout when using"
177.Va \&ac
1815bff5 178.It "rw bool false do"
34d340d7 179.Em NOT
1815bff5
A
180use raw for input, use cbreak
181.It "sp num unused line speed (input and output)"
182.It "su str" Ta So Li ^Z Sc Ta
183.No "suspend character"
184.It "tc str none table continuation"
185.It "to num 0 timeout (seconds)"
186.It "tt str" Ta Dv NULL Ta
187.No "terminal type (for environment)"
188.It "ub bool false do unbuffered output (of prompts etc)"
189.It "we str" Ta So Li ^W Sc Ta
190.No "word erase character"
191.It "xc bool false do
34d340d7 192.Em NOT
1815bff5
A
193echo control chars as
194.Ql ^X
195.It "xf str" Ta So Li ^S Sc Ta Dv XOFF
196(stop output) character
197.It "xn str" Ta So Li ^Q Sc Ta Dv XON
198(start output) character
34d340d7 199.It "Lo str C the locale name used for \&%d in the banner message"
1815bff5
A
200.El
201.Pp
34d340d7
A
202The following capabilities are no longer supported by
203.Xr getty 8 :
204.Bl -column Name Type /usr/bin/login
1815bff5
A
205.It "bd num 0 backspace delay"
206.It "cb bool false use crt backspace mode"
207.It "cd num 0 carriage-return delay"
208.It "fd num 0 form-feed (vertical motion) delay"
34d340d7 209.It "lc bool false terminal has lower case"
1815bff5
A
210.It "nd num 0 newline (line-feed) delay"
211.It "uc bool false terminal is known upper case only"
212.El
213.Pp
214If no line speed is specified, speed will not be altered
215from that which prevails when getty is entered.
216Specifying an input or output speed will override
217line speed for stated direction only.
218.Pp
219Terminal modes to be used for the output of the message,
220for input of the login name,
221and to leave the terminal set as upon completion,
222are derived from the boolean flags specified.
223If the derivation should prove inadequate,
224any (or all) of these three may be overridden
225with one of the
34d340d7
A
226.Va \&c0 ,
227.Va \&c1 ,
228.Va \&c2 ,
229.Va \&i0 ,
230.Va \&i1 ,
231.Va \&i2 ,
232.Va \&l0 ,
233.Va \&l1 ,
234.Va \&l2 ,
235.Va \&o0 ,
236.Va \&o1 ,
1815bff5 237or
34d340d7 238.Va \&o2
1815bff5
A
239numeric specifications, which can be used to specify
240(usually in octal, with a leading '0')
241the exact values of the flags.
242These flags correspond to the termios
34d340d7
A
243.Va c_cflag ,
244.Va c_iflag ,
245.Va c_lflag ,
1815bff5 246and
34d340d7
A
247.Va c_oflag
248fields, respectively.
249Each of these sets must be completely specified to be effective.
250.Pp
1815bff5 251The
34d340d7
A
252.Va \&f0 ,
253.Va \&f1 ,
1815bff5 254and
34d340d7 255.Va \&f2
1815bff5 256are excepted for backwards compatibility with a previous incarnation of
34d340d7
A
257the TTY sub-system.
258In these flags the bottom 16 bits of the (32 bits)
1815bff5 259value contain the sgttyb
34d340d7 260.Va sg_flags
1815bff5
A
261field, while the top 16 bits represent the local mode word.
262.Pp
263Should
34d340d7 264.Xr getty 8
1815bff5
A
265receive a null character
266(presumed to indicate a line break)
267it will restart using the table indicated by the
34d340d7
A
268.Va \&nx
269entry.
270If there is none, it will re-use its original table.
1815bff5
A
271.Pp
272Delays are specified in milliseconds, the nearest possible
273delay available in the tty driver will be used.
274Should greater certainty be desired, delays
275with values 0, 1, 2, and 3 are interpreted as
276choosing that particular delay algorithm from the driver.
277.Pp
278The
34d340d7 279.Va \&cl
1815bff5
A
280screen clear string may be preceded by a (decimal) number
281of milliseconds of delay required (a la termcap).
282This delay is simulated by repeated use of the pad character
34d340d7 283.Va \&pc .
1815bff5 284.Pp
34d340d7
A
285The initial message, login message, and initial file;
286.Va \&im ,
287.Va \&lm
1815bff5 288and
34d340d7
A
289.Va \&if
290may include any of the following character sequences, which expand to
291information about the environment in which
292.Xr getty 8
293is running.
294.Pp
295.Bl -tag -offset indent -width \&%xxxxxxxxxxxxxx
296.It \&%d
297The current date and time formatted according to the
298.Va \&Lo
299and
300.Va \&df
301strings.
302.It \&%h
303The hostname of the machine, which is normally obtained from the
304system using
305.Xr gethostname 3 ,
306but may also be overridden by the
307.Va \&hn
1815bff5 308table entry.
34d340d7
A
309In either case it may be edited with the
310.Va \&he
311string.
1815bff5 312A '@' in the
34d340d7
A
313.Va \&he
314string causes one character from the real hostname to
1815bff5
A
315be copied to the final hostname.
316A '#' in the
34d340d7
A
317.Va \&he
318string causes the next character of the real hostname
1815bff5 319to be skipped.
34d340d7
A
320Each character that
321is neither '@' nor '#' is copied into the final hostname.
1815bff5 322Surplus '@' and '#' characters are ignored.
34d340d7
A
323.It \&%t
324The tty name.
325.It "\&%m, \&%r, \&%s, \&%v"
326The type of machine, release of the operating system, name of the
327operating system, and version of the kernel, respectively, as
328returned by
329.Xr uname 3 .
330.It \&%%
331A
332.Dq %
333character.
334.El
1815bff5
A
335.Pp
336When getty execs the login process, given
337in the
34d340d7 338.Va \&lo
1815bff5
A
339string (usually
340.Dq Pa /usr/bin/login ) ,
341it will have set
342the environment to include the terminal type, as indicated
343by the
34d340d7 344.Va \&tt
1815bff5
A
345string (if it exists).
346The
34d340d7 347.Va \&ev
1815bff5
A
348string, can be used to enter additional data into
349the environment.
350It is a list of comma separated strings, each of which
351will presumably be of the form
34d340d7 352.Li name=value .
1815bff5
A
353.Pp
354If a non-zero timeout is specified, with
34d340d7 355.Va \&to ,
1815bff5
A
356then getty will exit within the indicated
357number of seconds, either having
358received a login name and passed control
359to
34d340d7 360.Xr login 1 ,
1815bff5
A
361or having received an alarm signal, and exited.
362This may be useful to hangup dial in lines.
363.Pp
364Output from
34d340d7 365.Xr getty 8
1815bff5 366is even parity unless
34d340d7 367.Va \&op
1815bff5 368or
34d340d7 369.Va \&np
1815bff5
A
370is specified.
371The
34d340d7 372.Va \&op
1815bff5
A
373string
374may be specified with
34d340d7 375.Va \&ap
1815bff5
A
376to allow any parity on input, but generate odd parity output.
377Note: this only applies while getty is being run,
378terminal driver limitations prevent a more complete
379implementation.
34d340d7
A
380The
381.Xr getty 8
382utility does not check parity of input characters in
1815bff5
A
383.Dv RAW
384mode.
34d340d7
A
385.Pp
386If a
387.Va \&pp
388string is specified and a PPP link bring-up sequence is recognized,
389getty will invoke the program referenced by the
390.Va \&pp
391option.
392This can be used to handle incoming PPP calls.
393If the
394.Va \&pl
395option is true as well,
396.Xr getty 8
397will skip the user name prompt and the PPP detection phase, and will
398invoke the program specified by
399.Va \&pp
400instantly.
401.Pp
402.Nm Getty
403provides some basic intelligent modem handling by providing a chat
404script feature available via two capabilities:
405.Pp
406.Bl -tag -offset indent -width \&xxxxxxxx -compact
407.It ic
408Chat script to initialize modem.
409.It ac
410Chat script to answer a call.
411.El
412.Pp
413A chat script is a set of expect/send string pairs.
414When a chat string starts,
415.Nm getty
416will wait for the first string, and if it finds it, will send the
417second, and so on.
418Strings specified are separated by one or more tabs or spaces.
419Strings may contain standard ASCII characters and special 'escapes',
420which consist of a backslash character followed by one or more
421characters which are interpreted as follows:
422.Pp
423.Bl -tag -offset indent -width \&xxxxxxxx -compact
424.It \ea
425bell character.
426.It \eb
427backspace.
428.It \en
429newline.
430.It \ee
431escape.
432.It \ef
433formfeed.
434.It \ep
435half-second pause.
436.It \er
437carriage return.
438.It \eS , \es
439space character.
440.It \et
441tab.
442.It \exNN
443hexadecimal byte value.
444.It \e0NNN
445octal byte value.
446.El
447.Pp
448Note that the
449.Ql \ep
450sequence is only valid for send strings and causes a half-second
451pause between sending the previous and next characters.
452Hexadecimal values are, at most, 2 hex digits long, and octal
453values are a maximum of 3 octal digits.
454.Pp
455The
456.Va \&ic
457chat sequence is used to initialize a modem or similar device.
458A typical example of an init chat script for a modem with a
459hayes compatible command set might look like this:
460.Pp
461.Dl :ic="" ATE0Q0V1\er OK\er ATS0=0\er OK\er:
462.Pp
463This script waits for nothing (which always succeeds), sends
464a sequence to ensure that the modem is in the correct mode
465(suppress command echo, send responses in verbose mode),
466and then disables auto-answer.
467It waits for an "OK" response before it terminates.
468The init sequence is used to check modem responses to ensure that
469the modem is functioning correctly.
470If the init script fails to complete,
471.Nm getty
472considers this to be fatal, and results in an error logged via
473.Xr syslogd 8 ,
474and exiting.
475.Pp
476Similarly, an answer chat script is used to manually answer the
477phone in response to (usually) a "RING".
478When run with an answer script,
479.Nm getty
480opens the port in non-blocking mode, clears any extraneous input
481and waits for data on the port.
482As soon as any data is available, the answer chat script is
483started and scanned for a string, and responds according to
484the answer chat script.
485With a hayes compatible modem, this would normally look something
486like:
487.Pp
488.Dl :ac=RING\er ATA\er CONNECT:
489.Pp
490This causes the modem to answer the call via the "ATA" command,
491then scans input for a "CONNECT" string.
492If this is received before a
493.Va \&ct
494timeout, then a normal login sequence commences.
495.Pp
496The
497.Va \&ct
498capability specifies a timeout for all send and expect strings.
499This timeout is set individually for each expect wait and send
500string and must be at least as long as the time it takes for
501a connection to be established between a remote and local
502modem (usually around 10 seconds).
503.Pp
504In most situations, you will want to flush any additional
505input after the connection has been detected, and the
506.Va \&de
507capability may be used to do that, as well as delay for a
508short time after the connection has been established during
509which all of the connection data has been sent by the modem.
1815bff5
A
510.Sh SEE ALSO
511.Xr login 1 ,
34d340d7
A
512.Xr gethostname 3 ,
513.Xr uname 3 ,
1815bff5 514.Xr termcap 5 ,
34d340d7
A
515.Xr getty 8 ,
516.Xr telnetd 8
517.Sh HISTORY
518The
519.Nm
520file format appeared in
521.Bx 4.2 .
1815bff5
A
522.Sh BUGS
523The special characters (erase, kill, etc.) are reset to system defaults
524by
525.Xr login 1 .
526In
527.Em all
528cases, '#' or '^H' typed in a login name will be treated as
529an erase character, and '@' will be treated as a kill character.
530.Pp
531The delay stuff is a real crock.
532Apart form its general lack of flexibility, some
533of the delay algorithms are not implemented.
534The terminal driver should support sane delay settings.
535.Pp
536The
34d340d7 537.Va \&he
1815bff5
A
538capability is stupid.
539.Pp
540The
34d340d7 541.Xr termcap 5
1815bff5
A
542format is horrid, something more rational should
543have been chosen.
544.Pp
545This should be converted to use
546.Xr termios 4 .