xref: /freebsd/libexec/getty/getty.8 (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
1.\" Copyright (c) 1980, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\" "
28.Dd July 21, 2020
29.Dt GETTY 8
30.Os
31.Sh NAME
32.Nm getty
33.Nd set terminal mode
34.Sh SYNOPSIS
35.Nm
36.Oo
37.Ar type
38.Op Ar tty
39.Oc
40.Sh DESCRIPTION
41The
42.Nm
43utility is called by
44.Xr init 8
45to open and initialize the tty line, read a login name, and invoke
46.Xr login 1 .
47.Pp
48The argument
49.Ar tty
50is the special device file in
51.Pa /dev
52to open for the terminal (for example, ``ttyh0'').
53If there is no argument or the argument is
54.Sq Fl ,
55the tty line is assumed to be open as file descriptor 0.
56.Pp
57The
58.Ar type
59argument can be used to make
60.Nm
61treat the terminal line specially.
62This argument is used as an index into the
63.Xr gettytab 5
64database, to determine the characteristics of the line.
65If there is no argument, or there is no such table, the
66.Em default
67table is used.
68If there is no
69.Pa /etc/gettytab
70a set of system defaults is used.
71If indicated by the table located,
72.Nm
73will clear the terminal screen,
74print a banner heading,
75and prompt for a login name.
76Usually either the banner or the login prompt will include
77the system hostname.
78.Pp
79Most of the default actions of
80.Nm
81can be circumvented, or modified, by a suitable
82.Pa gettytab
83table.
84.Pp
85The
86.Nm
87utility can be set to timeout after some interval,
88which will cause dial up lines to hang up
89if the login name is not entered reasonably quickly.
90.Sh FILES
91.Bl -tag -width /etc/gettytab -compact
92.It Pa /etc/gettytab
93.It Pa /etc/ttys
94.El
95.Sh DIAGNOSTICS
96.Bl -diag
97.It "ttyxx: No such device or address."
98.It "ttyxx: No such file or address."
99.Pp
100A terminal which is turned
101on in the
102.Pa ttys
103file cannot be opened, likely because the requisite
104lines are either not configured into the system, the associated device
105was not attached during boot-time system configuration,
106or the special file in
107.Pa /dev
108does not exist.
109.El
110.Sh SEE ALSO
111.Xr login 1 ,
112.Xr ioctl 2 ,
113.Xr tty 4 ,
114.Xr gettytab 5 ,
115.Xr ttys 5 ,
116.Xr init 8 ,
117.Xr pstat 8
118.Sh HISTORY
119A
120.Nm
121utility appeared in
122.At v3 .
123