xref: /netbsd-src/libexec/getty/ttys.5 (revision f8cf1a9151c7af1cb0bd8b09c13c66bca599c027)
1.\"	$NetBSD: ttys.5,v 1.24 2024/07/06 07:24:01 simonb 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 July 6, 2024
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
53.Pq Ql \*q .
54Blank lines and comments may appear anywhere in the file; comments
55are delimited by hash marks
56.Pq Ql #
57and new lines.
58Any unspecified fields will default to null.
59.Pp
60Each line in
61.Nm
62has the format:
63.Pp
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 terminfo 5
84data base file.
85The environment variable
86.Ev 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
95.Pq see 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
100.Pq currently unused .
101.Bl -tag -offset indent -width Ic
102.\"
103.It Ic on No or Ic off
104.Xr init 8
105should
106.Pq or should not
107execute the command given in the second field.
108.\"
109.It Ic secure
110If
111.Ic on
112is specified, allows users with a uid of 0
113.Pq e.g. Qq root
114to login on this line.
115.\"
116.It Ic local
117Sets the
118.Dv TIOCFLAG_CLOCAL
119.Xr tty 4
120flag for the device.
121This will cause the
122.Xr termios 4
123.Dv CLOCAL
124flag to be set on every open and thus modem control signal lines will be
125ignored by default.
126.\"
127.It Ic softcar
128Causes the driver to ignore hardware carrier on the line
129.Po
130by setting the
131.Dv TIOCFLAG_SOFTCAR
132.Xr tty 4
133flag
134.Pc .
135.\"
136.It Ic rtscts
137Sets the
138.Dv TIOCFLAG_CRTSCTS
139.Xr tty 4
140flag for the device to enable
141.Tn RTS Ns / Ns Tn CTS
142.Dq hardware
143flow control by default.
144.\"
145.It Ic mdmbuf
146Sets the
147.Dv TIOCFLAG_MDMBUF
148.Xr tty 4
149flag for the device to enable
150.Tn DTR Ns / Ns Tn DCD
151.Dq hardware
152flow control by default.
153.El
154.Pp
155The flags
156.Ic local ,
157.Ic rtscts ,
158.Ic mdmbuf ,
159and
160.Ic softcar
161modify the default behaviour of the terminal line, and their actions
162are device driver dependent.
163These flag fields should not be quoted.
164.Pp
165The string
166.Ql window=
167may be followed by a quoted command
168string which
169.Xr init 8
170will execute
171.Em before
172starting the command specified by the second field.
173.Pp
174The string
175.Ql class=
176may be followed by a quoted string used
177as a key into a database of attributes for that category of tty.
178See
179.Xr getttynam 3
180for more information on this feature.
181.Pp
182After changing the
183.Nm
184file a
185.Dv SIGHUP
186signal can be sent to
187.Xr init 8
188with the command
189.Pp
190.Dl kill -HUP 1
191.Pp
192On receipt of this signal,
193.Xr init 8
194will re-read the
195.Nm
196file and spawn any necessary
197.Xr getty 8
198processes.
199.Pp
200.Sy NB :
201Sending
202.Dv SIGHUP
203to
204.Xr init 8
205does
206.Em not
207change the state of the various
208.Xr tty 4
209device flags listed above; the
210.Xr ttyflags 8
211program must be run for changes in those flags to take effect on the devices.
212.Sh FILES
213.Bl -tag -width Pa -compact
214.It Pa /etc/ttys
215.El
216.Sh EXAMPLES
217.Bd -literal
218# root login on console at 1200 baud
219console	"/usr/libexec/getty std.1200" vt100 on secure
220# dialup at 1200 baud, no root logins
221tty00	"/usr/libexec/getty d1200" dialup on        # 555-1234
222# Mike's terminal: hp2621
223ttyh0	"/usr/libexec/getty std.9600" hp2621-nl on  # 457 Evans
224# John's terminal: vt100
225ttyh1	"/usr/libexec/getty std.9600" vt100 on      # 459 Evans
226# terminal emulate/window system
227ttyv0	"/usr/new/xterm -L :0" vs100 on window="/usr/new/Xvs100 0"
228# Network pseudo ttys -- don't enable getty
229ttyp0	none	network
230ttyp1	none	network off
231.Ed
232.Sh SEE ALSO
233.Xr login 1 ,
234.Xr getttyent 3 ,
235.Xr ttyslot 3 ,
236.Xr tty 4 ,
237.Xr gettytab 5 ,
238.Xr terminfo 5 ,
239.Xr getty 8 ,
240.Xr init 8 ,
241.Xr ttyflags 8
242.Sh HISTORY
243A
244.Nm
245file appeared in
246.At v6 .
247