xref: /netbsd-src/libexec/getty/ttys.5 (revision de1dfb1250df962f1ff3a011772cf58e605aed11)
1.\"	$NetBSD: ttys.5,v 1.16 2003/08/07 09:46:42 agc Exp $
2.\"
3.\" Copyright (c) 1985, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     from: @(#)ttys.5	8.1 (Berkeley) 6/4/93
31.\"
32.Dd June 4, 1993
33.Dt TTYS 5
34.Os
35.Sh NAME
36.Nm ttys
37.Nd terminal initialization information
38.Sh DESCRIPTION
39The file
40.Nm
41contains information that is used by various routines to initialize
42and control the use of terminal special files.
43This information is read with the
44.Xr getttyent 3
45library routines.
46.Pp
47There is one line in the
48.Nm
49file per special device file.
50Fields are separated by tabs and/or spaces.
51Fields comprising more than one word should be enclosed in double
52quotes (``"'').
53Blank lines and comments may appear anywhere in the file; comments
54are delimited by hash marks (``#'') and new lines.
55Any unspecified fields will default to null.
56.Pp
57Each line in
58.Nm
59has the format:
60.Dl tty command type flags
61.Pp
62The first field is the
63name of the terminal special file as it is found in
64.Pa /dev .
65.Pp
66The second field of the file is the command to execute for the line,
67usually
68.Xr getty 8 ,
69which initializes and opens the line, setting the speed, waiting for
70a user name and executing the
71.Xr login 1
72program.
73However, it can be any desired command, for example the start up
74for a window system terminal emulator or some other daemon process,
75and can contain multiple words if quoted.
76.Pp
77The third field is the type of terminal usually connected to that
78tty line, normally the one found in the
79.Xr termcap 5
80data base file.
81The environment variable
82.Dv TERM
83is initialized with the value by either
84.Xr getty 8
85or
86.Xr login 1 .
87.Pp
88The remaining fields set flags in the
89.Fa ty_status
90entry (see
91.Xr getttyent 3 )
92or specify a window system process that
93.Xr init 8
94will maintain for the terminal line
95or a key into a database of tty attributes (currently unused).
96.Pp
97.Bl -tag -width softcar
98.It Sy on No or Sy off
99.Xr init 8
100should (or should not) execute the command given in the second field.
101.It Sy secure
102If
103.Sy on
104is specified, allows users with a uid of 0
105.Pq e.g. Qq root
106to login on this line.
107.It Sy local
108Sets
109.Dv CLOCAL
110.Xr termios 4
111flag for the device.
112Tells device to ignore modem control signal lines.
113.It Sy softcar
114Causes the driver to ignore hardware carrier on the line.
115.It Sy rtscts
116Sets
117.Dv CRTSCTS
118.Xr termios 4
119flag for the device to enable
120.Tn RTS /
121.Tn CTS
122.Qq hardware
123flow control.
124.It Sy mdmbuf
125Sets
126.Dv MDMBUF
127.Xr termios 4
128flag for the device to enable
129.Tn DTR /
130.Tn DCD
131.Qq hardware
132flow control.
133.El
134.Pp
135The flags
136.Qq local ,
137.Qq rtscts ,
138.Qq mdmbuf ,
139and
140.Qq softcar
141modify the default behaviour of the terminal line, and their actions
142are device driver dependent.
143These flag fields should not be quoted.
144.Pp
145The string ``window='' may be followed by a quoted command
146string which
147.Xr init 8
148will execute
149.Em before
150starting the command specified by the second field.
151.Pp
152The string ``class='' may be followed by a quoted string used
153as a key into a database of attributes for that category of tty.
154See
155.Xr getttynam 3
156for more information on this feature.
157.Pp
158After changing the
159.Nm
160file a
161.Dv SIGHUP
162signal can be sent to
163.Xr init 8
164with the command
165.Dq Li "kill \-s HUP 1" .
166On receipt of this signal,
167.Xr init 8
168will re-read the
169.Nm
170file and spawn any necessary
171.Xr getty 8
172processes.
173.Pp
174.Sy Nota Bene :
175Sending
176.Dv SIGHUP
177to
178.Xr init 8
179does
180.Em not
181change the state of the various
182.Xr termios 4
183device flags listed above; the
184.Xr ttyflags 8
185program must be run for changes in those flags to take effect on the devices.
186.Sh FILES
187.Bl -tag -width /etc/ttys -compact
188.It Pa /etc/ttys
189.El
190.Sh EXAMPLES
191.Bd -literal
192# root login on console at 1200 baud
193console	"/usr/libexec/getty std.1200"	vt100	on secure
194# dialup at 1200 baud, no root logins
195ttyd0	"/usr/libexec/getty d1200"	dialup	on	# 555-1234
196# Mike's terminal: hp2621
197ttyh0	"/usr/libexec/getty std.9600"	hp2621-nl	on	# 457 Evans
198# John's terminal: vt100
199ttyh1	"/usr/libexec/getty std.9600"	vt100	on		# 459 Evans
200# terminal emulate/window system
201ttyv0	"/usr/new/xterm -L :0"		vs100	on window="/usr/new/Xvs100 0"
202# Network pseudo ttys -- don't enable getty
203ttyp0	none	network
204ttyp1	none	network	off
205.Ed
206.Sh SEE ALSO
207.Xr login 1 ,
208.Xr getttyent 3 ,
209.Xr ttyslot 3 ,
210.Xr gettytab 5 ,
211.Xr termcap 5 ,
212.Xr getty 8 ,
213.Xr init 8 ,
214.Xr ttyflags 8
215.Sh HISTORY
216A
217.Nm
218file appeared in
219.At v6 .
220