1.\" $NetBSD: ttys.5,v 1.20 2015/02/12 07:32:09 aymeric 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 April 5, 2012 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 (``"''). 53Blank lines and comments may appear anywhere in the file; comments 54are delimited by hash marks (``#'') and new lines. 55Any unspecified fields will default to null. 56.Pp 57Each line in 58.Nm 59has the format: 60.Dl tty command type flags 61.Pp 62The first field is the 63name of the terminal special file as it is found in 64.Pa /dev . 65.Pp 66The second field of the file is the command to execute for the line, 67usually 68.Xr getty 8 , 69which initializes and opens the line, setting the speed, waiting for 70a user name and executing the 71.Xr login 1 72program. 73However, it can be any desired command, for example the start up 74for a window system terminal emulator or some other daemon process, 75and can contain multiple words if quoted. 76.Pp 77The third field is the type of terminal usually connected to that 78tty line, normally the one found in the 79.Xr terminfo 5 80data base file. 81The environment variable 82.Dv TERM 83is initialized with the value by either 84.Xr getty 8 85or 86.Xr login 1 . 87.Pp 88The remaining fields set flags in the 89.Fa ty_status 90entry (see 91.Xr getttyent 3 ) 92or specify a window system process that 93.Xr init 8 94will maintain for the terminal line 95or a key into a database of tty attributes (currently unused). 96.Pp 97.Bl -tag -width softcar 98.It Sy on No or Sy off 99.Xr init 8 100should (or should not) execute the command given in the second field. 101.It Sy secure 102If 103.Sy on 104is specified, allows users with a uid of 0 105.Pq e.g. Qq root 106to login on this line. 107.It Sy local 108Sets the 109.Dv TIOCFLAG_CLOCAL 110.Xr tty 4 111flag for the device. 112This will cause the 113.Xr termios 4 114.Dv CLOCAL 115flag to be set on every open and thus modem control signal lines will be 116ignored by default. 117.It Sy softcar 118Causes the driver to ignore hardware carrier on the line (by setting the 119.Dv TIOCFLAG_SOFTCAR 120.Xr tty 4 121flag). 122.It Sy rtscts 123Sets the 124.Dv TIOCFLAG_CRTSCTS 125.Xr tty 4 126flag for the device to enable 127.Tn RTS / 128.Tn CTS 129.Qq hardware 130flow control by default. 131.It Sy mdmbuf 132Sets the 133.Dv TIOCFLAG_MDMBUF 134.Xr tty 4 135flag for the device to enable 136.Tn DTR / 137.Tn DCD 138.Qq hardware 139flow control by default. 140.El 141.Pp 142The flags 143.Qq local , 144.Qq rtscts , 145.Qq mdmbuf , 146and 147.Qq softcar 148modify the default behaviour of the terminal line, and their actions 149are device driver dependent. 150These flag fields should not be quoted. 151.Pp 152The string ``window='' may be followed by a quoted command 153string which 154.Xr init 8 155will execute 156.Em before 157starting the command specified by the second field. 158.Pp 159The string ``class='' may be followed by a quoted string used 160as a key into a database of attributes for that category of tty. 161See 162.Xr getttynam 3 163for more information on this feature. 164.Pp 165After changing the 166.Nm 167file a 168.Dv SIGHUP 169signal can be sent to 170.Xr init 8 171with the command 172.Dq Li "kill \-s HUP 1" . 173On receipt of this signal, 174.Xr init 8 175will re-read the 176.Nm 177file and spawn any necessary 178.Xr getty 8 179processes. 180.Pp 181.Sy Nota Bene : 182Sending 183.Dv SIGHUP 184to 185.Xr init 8 186does 187.Em not 188change the state of the various 189.Xr tty 4 190device flags listed above; the 191.Xr ttyflags 8 192program must be run for changes in those flags to take effect on the devices. 193.Sh FILES 194.Bl -tag -width /etc/ttys -compact 195.It Pa /etc/ttys 196.El 197.Sh EXAMPLES 198.Bd -literal 199# root login on console at 1200 baud 200console "/usr/libexec/getty std.1200" vt100 on secure 201# dialup at 1200 baud, no root logins 202tty00 "/usr/libexec/getty d1200" dialup on # 555-1234 203# Mike's terminal: hp2621 204ttyh0 "/usr/libexec/getty std.9600" hp2621-nl on # 457 Evans 205# John's terminal: vt100 206ttyh1 "/usr/libexec/getty std.9600" vt100 on # 459 Evans 207# terminal emulate/window system 208ttyv0 "/usr/new/xterm -L :0" vs100 on window="/usr/new/Xvs100 0" 209# Network pseudo ttys -- don't enable getty 210ttyp0 none network 211ttyp1 none network off 212.Ed 213.Sh SEE ALSO 214.Xr login 1 , 215.Xr getttyent 3 , 216.Xr ttyslot 3 , 217.Xr tty 4 , 218.Xr gettytab 5 , 219.Xr terminfo 5 , 220.Xr getty 8 , 221.Xr init 8 , 222.Xr ttyflags 8 223.Sh HISTORY 224A 225.Nm 226file appeared in 227.At v6 . 228