1.\" $NetBSD: getty.8,v 1.18 2013/05/29 15:02:12 wiz Exp $ 2.\" 3.\" Copyright (c) 1980, 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: @(#)getty.8 8.1 (Berkeley) 6/4/93 31.\" 32.Dd May 29, 2013 33.Dt GETTY 8 34.Os 35.Sh NAME 36.Nm getty , 37.Nm uugetty 38.Nd set terminal modes for system access 39.Sh SYNOPSIS 40.Nm 41.Oo 42.Ar type 43.Op Ar tty 44.Oc 45.Nm uugetty 46.Oo 47.Ar type 48.Op Ar tty 49.Oc 50.Sh DESCRIPTION 51The 52.Nm 53program 54is called by 55.Xr init 8 56to open and initialize the tty line, read a login name, and invoke 57.Xr login 1 . 58The devices on which to run 59.Nm 60are normally determined by 61.Xr ttys 5 . 62.Pp 63The 64.Nm 65program can also recognize a Point to Point Protocol 66.Pq Tn PPP 67negotiation, and, if the 68.Sy pp 69attribute in 70.Xr gettytab 5 71is set, invoke the program given by that string, e.g., 72.Xr pppd 8 , 73instead of 74.Xr login 1 . 75This makes it possible to use a single serial port for either a 76.Qq shell 77account with command line interface, or a 78.Tn PPP 79network link. 80.Pp 81The argument 82.Ar tty 83is the special device file in 84.Pa /dev 85to open for the terminal 86.Po 87for example, 88.Qq ttyh0 89.Pc . 90If there is no argument or the argument is 91.Ql Fl , 92the tty line is assumed to be open as file descriptor 0. 93.Pp 94The 95.Ar type 96argument can be used to make 97.Nm 98treat the terminal line specially. 99This argument is used as an index into the 100.Xr gettytab 5 101database, to determine the characteristics of the line. 102If there is no argument, or there is no such table, the 103.Em default 104table is used. 105If there is no 106.Pa /etc/gettytab 107a set of system defaults is used. 108If indicated by the table located, 109.Nm 110will clear the terminal screen, 111print a banner heading, 112and prompt for a login name. 113Usually either the banner or the login prompt will include 114the system hostname. 115.Pp 116.Nm 117uses the 118.Xr ttyaction 3 119facility with an action of 120.Qq getty 121and user 122.Qq root 123to execute site-specific commands when it starts. 124.Pp 125Most of the default actions of 126.Nm 127can be circumvented, or modified, by a suitable 128.Xr gettytab 5 129table. 130.Pp 131The 132.Nm 133program can be set to timeout after some interval, 134which will cause dial up lines to hang up 135if the login name is not entered reasonably quickly. 136.Pp 137The 138.Nm uugetty 139program is the same, except that it uses 140.Xr pidlock 3 141to respect the locks in 142.Pa /var/spool/lock 143of processes that dial out on that tty. 144.Sh FILES 145.Bl -tag -width /var/spool/lock/LCK..ttyXX -compact 146.It Pa /etc/gettytab 147.It Pa /etc/ttys 148.It Pa /usr/libexec/getty 149.It Pa /var/spool/lock/LCK..ttyXX 150.El 151.Sh DIAGNOSTICS 152.Bl -diag 153.It "ttyxx: No such device or address." 154.It "ttyxx: No such file or address." 155A terminal which is turned on in the 156.Xr ttys 5 157file cannot be opened, likely because the requisite 158lines are either not configured into the system, the associated device 159was not attached during boot-time system configuration, 160or the special file in 161.Pa /dev 162does not exist. 163.El 164.Sh SEE ALSO 165.Xr login 1 , 166.Xr ioctl 2 , 167.Xr pidlock 3 , 168.Xr ttyaction 3 , 169.Xr tty 4 , 170.Xr gettytab 5 , 171.Xr ttys 5 , 172.Xr init 8 , 173.Xr pppd 8 174.Sh HISTORY 175A 176.Nm 177program appeared in 178.At v6 . 179