1.\"	$OpenBSD: ttys.5,v 1.9 2003/06/02 19:38:24 millert Exp $
2.\" Copyright (c) 1985, 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: @(#)ttys.5	8.1 (Berkeley) 6/4/93
30.\"
31.Dd June 4, 1993
32.Dt TTYS 5
33.Os
34.Sh NAME
35.Nm ttys
36.Nd terminal initialization information
37.Sh DESCRIPTION
38The
39.Nm
40file contains information that is used by various routines to initialize
41and control the use of terminal special files.
42This information is read with the
43.Xr getttyent 3
44library routines.
45There is one line in the
46.Nm
47file per special device file.
48Fields are separated by tabs and/or spaces.
49Fields comprised of more than one word should be enclosed in double quotes
50.Pq Ql \&" .
51Blank lines and comments may appear anywhere in the file; comments
52are delimited by hash marks
53.Pq Ql #
54and newlines.
55Any unspecified fields will default to null.
56.Pp
57The first field is the
58name of the terminal special file as it is found in
59.Pa /dev .
60.Pp
61The second field of the file is the command to execute for the line,
62usually
63.Xr getty 8 ,
64which initializes and opens the line, setting the speed, waiting for
65a user name and executing the
66.Xr login 1
67program.
68It can be, however, any desired command, for example
69the start up for a window system terminal emulator or some other
70daemon process, and can contain multiple words if quoted.
71.Pp
72The third field is the type of terminal usually connected to that
73TTY line, normally the one found in the
74.Xr termcap 5
75database file.
76The environment variable
77.Dv TERM
78is initialized with the value by either
79.Xr getty 8
80or
81.Xr login 1 .
82.Pp
83The remaining fields set flags in the
84.Fa ty_status
85entry (see
86.Xr getttyent 3 )
87or specify a window system process that
88.Xr init 8
89will maintain for the terminal line.
90The following is a list of permitted flags for each TTY:
91.Bl -tag -width xxxxxxx
92.It Ar on
93Specify that
94.Xr init 8
95should execute the command given in the second field.
96.It Ar off
97The opposite of on.
98.It Ar secure
99If
100.Ar on
101is also specified, allows users with a UID of 0 to login on this line.
102.El
103.Pp
104Additionally, the following flags modify the default behavior of
105the terminal line.
106Some of these flags may not be supported by a terminal line driver.
107The flag fields should not be quoted.
108.Bl -tag -width xxxxxxx
109.It Ar local
110Treat the line as if it is locally connected.
111.It Ar rtscts
112Use RTS/CTS hardware flow control, if
113possible.
114.It Ar mdmbuf
115Use DTR/DCD flow control if possible.
116.It Ar softcar
117Ignore hardware carrier on the line.
118.El
119.Pp
120The string
121.Ar window=
122may be followed by a quoted command string which
123.Xr init 8
124will execute
125.Em before
126starting the command specified by the second field.
127.Sh FILES
128.Bl -tag -width /etc/ttys -compact
129.It Pa /etc/ttys
130.El
131.Sh EXAMPLES
132.Bd -literal
133# root login on console at 1200 baud
134console	"/usr/libexec/getty std.1200"	vt100	on secure
135# dialup at 1200 baud, no root logins
136ttyd0	"/usr/libexec/getty d1200"	dialup	on	# 555-1234
137# Mike's terminal: hp2621
138ttyh0	"/usr/libexec/getty std.9600"	hp2621-nl	on	# 457 Evans
139# John's terminal: vt100
140ttyh1	"/usr/libexec/getty std.9600"	vt100	on		# 459 Evans
141# terminal emulate/window system
142ttyv0	"/usr/new/xterm -L :0"		vs100	on window="/usr/new/Xvs100 0"
143# Network pseudo ttys -- don't enable getty
144ttyp0	none	network
145ttyp1	none	network	off
146.Ed
147.Sh SEE ALSO
148.Xr login 1 ,
149.Xr getttyent 3 ,
150.Xr ttyslot 3 ,
151.Xr gettytab 5 ,
152.Xr termcap 5 ,
153.Xr getty 8 ,
154.Xr init 8 ,
155.Xr ttyflags 8
156.Sh HISTORY
157A
158.Nm
159file appeared in
160.At v6 .
161