xref: /openbsd/libexec/getty/gettytab.5 (revision 73471bf0)
1.\"	$OpenBSD: gettytab.5,v 1.28 2017/05/27 09:31:13 deraadt Exp $
2.\" Copyright (c) 1983, 1991, 1993
3.\"	The Regents of the University of California.  All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\" 3. Neither the name of the University nor the names of its contributors
14.\"    may be used to endorse or promote products derived from this software
15.\"    without specific prior written permission.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.\"     from: @(#)gettytab.5	8.4 (Berkeley) 4/19/94
30.\"
31.Dd $Mdocdate: May 27 2017 $
32.Dt GETTYTAB 5
33.Os
34.Sh NAME
35.Nm gettytab
36.Nd terminal configuration database
37.Sh DESCRIPTION
38The
39.Nm
40file
41is a simplified version of the
42.Xr termcap 5
43database
44used to describe terminal lines.
45The initial terminal login process
46.Xr getty 8
47accesses the
48.Nm
49file each time it starts, allowing simpler
50reconfiguration of terminal characteristics.
51Each entry in the database
52is used to describe one class of terminals.
53.Pp
54There is a default terminal class,
55.Em default ,
56that is used to set global defaults for all other classes.
57(That is, the
58.Em default
59entry is read, then the entry for the class required
60is used to override particular settings.)
61.Sh CAPABILITIES
62Refer to
63.Xr termcap 5
64for a description of the file layout.
65The
66.Em default
67column below lists defaults obtained if there is
68no entry in the table obtained, nor one in the special
69.Em default
70table.
71.Bl -column "Name" "Type" "Default" "Description"
72.It Sy Name Ta Sy Type Ta Sy Default Ta Sy Description
73.It ap Ta bool Ta false Ta "Terminal uses any parity."
74.It bk Ta str Ta 0377 Ta "Alternative end-of-line character (input break)."
75.It c0 Ta num Ta unused Ta "TTY control flags to write messages."
76.It c1 Ta num Ta unused Ta "TTY control flags to read login name."
77.It c2 Ta num Ta unused Ta "TTY control flags to leave terminal as."
78.It ce Ta bool Ta false Ta "Use CRT erase algorithm."
79.It ck Ta bool Ta false Ta "Use CRT kill algorithm."
80.It cl Ta str Ta Dv NULL Ta "Screen clear sequence."
81.It co Ta bool Ta false Ta "Console; add"
82.Ql \en
83after login prompt.
84.It ds Ta str Ta So Li ^Y Sc Ta "Delayed suspend character."
85.It dx Ta bool Ta false Ta "Set"
86.Dv DECCTLQ .
87.It ec Ta bool Ta false Ta "Leave echo OFF."
88.It ep Ta bool Ta false Ta "Terminal uses even parity."
89.It er Ta str Ta So Li ^? Sc Ta "Erase character."
90.It et Ta str Ta So Li ^D Sc Ta "End of text"
91.Pq Dv EOF
92character.
93.It ev Ta str Ta Dv NULL Ta "Initial environment."
94.It fl Ta str Ta So Li ^O Sc Ta "Output flush character."
95.It hc Ta bool Ta false Ta "\&Do"
96.Em not
97hangup line on last close.
98.It hn Ta str Ta hostname Ta "Hostname."
99.It ht Ta bool Ta false Ta "Terminal has real tabs."
100.It i0 Ta num Ta unused Ta "TTY input flags to write messages."
101.It i1 Ta num Ta unused Ta "TTY input flags to read login name."
102.It i2 Ta num Ta unused Ta "TTY input flags to leave terminal as."
103.It ig Ta bool Ta false Ta "Ignore garbage characters in login name."
104.It im Ta str Ta Dv NULL Ta "Initial (banner) message."
105.It in Ta str Ta So Li ^C Sc Ta "Interrupt character."
106.It is Ta num Ta unused Ta "Input speed."
107.It kl Ta str Ta So Li ^U Sc Ta "Kill character."
108.It l0 Ta num Ta unused Ta "TTY local flags to write messages."
109.It l1 Ta num Ta unused Ta "TTY local flags to read login name."
110.It l2 Ta num Ta unused Ta "TTY local flags to leave terminal as."
111.It lc Ta bool Ta false Ta "Terminal has lower case."
112.It lm Ta str Ta login: Ta "Login prompt."
113.It ln Ta str Ta So Li ^V Sc Ta "``Literal next'' character."
114.It lo Ta str Ta Pa /usr/bin/login Ta "Program to execute when name obtained."
115.It mb Ta bool Ta false Ta "\&Do flow control based on carrier."
116.It nl Ta bool Ta false Ta "Terminal has (or might have) a newline character."
117.It np Ta bool Ta false Ta "Terminal uses no parity (i.e., 8-bit characters)."
118.It nx Ta str Ta default Ta "Next table (for auto speed selection)."
119.It o0 Ta num Ta unused Ta "TTY output flags to write messages."
120.It o1 Ta num Ta unused Ta "TTY output flags to read login name."
121.It o2 Ta num Ta unused Ta "TTY output flags to leave terminal as."
122.It op Ta bool Ta false Ta "Terminal uses odd parity."
123.It os Ta num Ta unused Ta "Output speed."
124.It pc Ta str Ta So Li \e0 Sc Ta "Pad character."
125.It pe Ta bool Ta false Ta "Use printer (hard copy) erase algorithm."
126.It pf Ta num Ta 0 Ta "Delay"
127between first prompt and following flush (seconds).
128.It ps Ta bool Ta false Ta "Line connected to a MICOM port selector."
129.It qu Ta str Ta So Li \&^\e Sc Ta "Quit character."
130.It rp Ta str Ta So Li ^R Sc Ta "Line retype character."
131.It rw Ta bool Ta false Ta "\&Do"
132.Em not
133use raw for input, use cbreak.
134.It sp Ta num Ta unused Ta "Line speed (input and output)."
135.It su Ta str Ta So Li ^Z Sc Ta "Suspend character."
136.It tc Ta str Ta none Ta "Table continuation."
137.It to Ta num Ta 0 Ta "Timeout (seconds)."
138.It tt Ta str Ta Dv NULL Ta "Terminal type (for environment)."
139.It ub Ta bool Ta false Ta "\&Do unbuffered output (of prompts etc)."
140.It we Ta str Ta So Li ^W Sc Ta "Word erase character."
141.It xc Ta bool Ta false Ta "\&Do"
142.Em not
143echo control characters as
144.Ql ^X .
145.It xf Ta str Ta So Li ^S Sc Ta Dv XOFF
146(stop output) character.
147.It xn Ta str Ta So Li ^Q Sc Ta Dv XON
148(start output) character.
149.El
150.Pp
151The following capabilities are no longer supported by
152.Xr getty 8 :
153.Bl -column "bd" "bool" "flase" "description"
154.It bd Ta num Ta 0 Ta "Backspace delay."
155.It cb Ta bool Ta false Ta "Use CRT backspace mode."
156.It cd Ta num Ta 0 Ta "Carriage-return delay."
157.It f0 Ta num Ta unused Ta "TTY mode flags to write messages."
158.It f1 Ta num Ta unused Ta "TTY mode flags to read login name."
159.It f2 Ta num Ta unused Ta "TTY mode flags to leave terminal as."
160.It fd Ta num Ta 0 Ta "Form-feed (vertical motion) delay."
161.It nd Ta num Ta 0 Ta "Newline (line-feed) delay."
162.It uc Ta bool Ta false Ta "Terminal is known upper case only."
163.El
164.Pp
165If no line speed is specified, speed will not be altered
166from that which prevails when
167.Xr getty 8
168is entered.
169Specifying an input or output speed will override
170line speed for stated direction only.
171.Pp
172Terminal modes to be used for the output of the message and
173for input of the login name,
174and to leave the terminal set as upon completion,
175are derived from the boolean flags specified.
176If the derivation should prove inadequate,
177any (or all) of these three may be overridden
178with one of the
179.Em \&c0 ,
180.Em \&c1 ,
181.Em \&c2 ,
182.Em \&i0 ,
183.Em \&i1 ,
184.Em \&i2 ,
185.Em \&l0 ,
186.Em \&l1 ,
187.Em \&l2 ,
188.Em \&o0 ,
189.Em \&o1 ,
190or
191.Em \&o2
192numeric specifications, which can be used to specify
193(usually in octal, with a leading
194.Ql 0 )
195the exact values of the flags.
196These flags correspond to the termios
197.Em c_cflag ,
198.Em c_iflag ,
199.Em c_lflag ,
200and
201.Em c_oflag
202fields, respectively.
203Each of these sets must be completely specified to be effective.
204.Pp
205Should
206.Xr getty 8
207receive a null character
208(presumed to indicate a line break)
209it will restart using the table indicated by the
210.Em nx
211entry.
212If there is none, it will re-use its original table.
213.Pp
214Delays are specified in milliseconds;
215the nearest possible delay available in the TTY driver will be used.
216Should greater certainty be desired, delays
217with values 0, 1, 2, and 3 are interpreted as
218choosing that particular delay algorithm from the driver.
219.Pp
220The
221.Em \&cl
222screen clear string may be preceded by a (decimal) number
223of milliseconds of delay required (a la
224.Xr termcap 5 ) .
225This delay is simulated by repeated use of the pad character
226.Em \&pc .
227.Pp
228The initial message and login message
229.Po
230.Em \&im
231and
232.Em \&lm
233.Pc
234may include any of the following character sequences, which expand to
235information about the environment in which
236.Xr getty 8
237is running:
238.Bl -tag -width \&%xxx
239.It \&%d
240The current date.
241.It \&%h
242The hostname of the machine, which is normally obtained from the
243system using
244.Xr gethostname 3 ,
245but may also be overridden by the
246.Em \&hn
247table entry.
248.It \&%t
249The TTY name.
250.It "\&%m, \&%r, \&%s, \&%v"
251The type of machine, release of the operating system, name of the
252operating system, and version of the kernel, respectively, as
253returned by
254.Xr uname 3 .
255.It \&%%
256A
257.Ql %
258character.
259.El
260.Pp
261When
262.Xr getty 8
263executes the login process given in the
264.Em \&lo
265string (usually
266.Pa /usr/bin/login ) ,
267it will have set
268the environment to include the terminal type, as indicated
269by the
270.Em \&tt
271string (if it exists).
272The
273.Em \&ev
274string can be used to enter additional data into the environment.
275It is a list of comma-separated strings, each of which
276will presumably be of the form
277.Em name=value .
278.Pp
279If a non-zero timeout is specified with
280.Em \&to ,
281then
282.Xr getty 8
283will exit within the indicated number of seconds, either having
284received a login name and passed control to
285.Xr login 1 ,
286or having received an alarm signal and exited.
287This may be useful to hangup dial in lines.
288.Pp
289Output from
290.Xr getty 8
291is even parity unless
292.Em \&op
293or
294.Em \&np
295is specified.
296The
297.Em \&op
298string
299may be specified with
300.Em \&ap
301to allow any parity on input, but generate odd parity output.
302Note: this only applies while
303.Xr getty 8
304is being run;
305terminal driver limitations prevent a more complete implementation.
306.Xr getty 8
307does not check parity of input characters in
308.Dv RAW
309mode.
310.Pp
311If a
312.Em \&pp
313string is specified and a PPP link bring-up sequence is recognized,
314.Xr getty 8
315will invoke the program referenced by the
316.Em \&pp
317option.
318This can be used to handle incoming PPP calls.
319.Sh FILES
320.Bl -tag -width "/etc/gettytab" -compact
321.It Pa /etc/gettytab
322Default location of the database file.
323.El
324.Sh SEE ALSO
325.Xr login 1 ,
326.Xr gethostname 3 ,
327.Xr uname 3 ,
328.Xr termcap 5 ,
329.Xr getty 8
330.Sh HISTORY
331The
332.Nm
333file format appeared in
334.Bx 4.2 .
335.Sh BUGS
336The special characters (erase, kill, etc.) are reset to system defaults by
337.Xr login 1 .
338.Pp
339The delay stuff is a real crock.
340Apart from its general lack of flexibility, some
341of the delay algorithms are not implemented.
342The terminal driver should support sane delay settings.
343.Pp
344The
345.Xr termcap 5
346format is horrid; something more rational should have been chosen.
347