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