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