xref: /freebsd/libexec/getty/getty.8 (revision 315ee00f)
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.\"     from: @(#)getty.8	8.1 (Berkeley) 6/4/93
29.\" "
30.Dd July 21, 2020
31.Dt GETTY 8
32.Os
33.Sh NAME
34.Nm getty
35.Nd set terminal mode
36.Sh SYNOPSIS
37.Nm
38.Oo
39.Ar type
40.Op Ar tty
41.Oc
42.Sh DESCRIPTION
43The
44.Nm
45utility is called by
46.Xr init 8
47to open and initialize the tty line, read a login name, and invoke
48.Xr login 1 .
49.Pp
50The argument
51.Ar tty
52is the special device file in
53.Pa /dev
54to open for the terminal (for example, ``ttyh0'').
55If there is no argument or the argument is
56.Sq Fl ,
57the tty line is assumed to be open as file descriptor 0.
58.Pp
59The
60.Ar type
61argument can be used to make
62.Nm
63treat the terminal line specially.
64This argument is used as an index into the
65.Xr gettytab 5
66database, to determine the characteristics of the line.
67If there is no argument, or there is no such table, the
68.Em default
69table is used.
70If there is no
71.Pa /etc/gettytab
72a set of system defaults is used.
73If indicated by the table located,
74.Nm
75will clear the terminal screen,
76print a banner heading,
77and prompt for a login name.
78Usually either the banner or the login prompt will include
79the system hostname.
80.Pp
81Most of the default actions of
82.Nm
83can be circumvented, or modified, by a suitable
84.Pa gettytab
85table.
86.Pp
87The
88.Nm
89utility can be set to timeout after some interval,
90which will cause dial up lines to hang up
91if the login name is not entered reasonably quickly.
92.Sh FILES
93.Bl -tag -width /etc/gettytab -compact
94.It Pa /etc/gettytab
95.It Pa /etc/ttys
96.El
97.Sh DIAGNOSTICS
98.Bl -diag
99.It "ttyxx: No such device or address."
100.It "ttyxx: No such file or address."
101.Pp
102A terminal which is turned
103on in the
104.Pa ttys
105file cannot be opened, likely because the requisite
106lines are either not configured into the system, the associated device
107was not attached during boot-time system configuration,
108or the special file in
109.Pa /dev
110does not exist.
111.El
112.Sh SEE ALSO
113.Xr login 1 ,
114.Xr ioctl 2 ,
115.Xr tty 4 ,
116.Xr gettytab 5 ,
117.Xr ttys 5 ,
118.Xr init 8 ,
119.Xr pstat 8
120.Sh HISTORY
121A
122.Nm
123utility appeared in
124.At v3 .
125