1*0a6a1f1dSLionel Sambuc.\" $NetBSD: ttys.5,v 1.20 2015/02/12 07:32:09 aymeric Exp $ 2a06e2ab3SBen Gras.\" 3a06e2ab3SBen Gras.\" Copyright (c) 1985, 1991, 1993 4a06e2ab3SBen Gras.\" The Regents of the University of California. All rights reserved. 5a06e2ab3SBen Gras.\" 6a06e2ab3SBen Gras.\" Redistribution and use in source and binary forms, with or without 7a06e2ab3SBen Gras.\" modification, are permitted provided that the following conditions 8a06e2ab3SBen Gras.\" are met: 9a06e2ab3SBen Gras.\" 1. Redistributions of source code must retain the above copyright 10a06e2ab3SBen Gras.\" notice, this list of conditions and the following disclaimer. 11a06e2ab3SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright 12a06e2ab3SBen Gras.\" notice, this list of conditions and the following disclaimer in the 13a06e2ab3SBen Gras.\" documentation and/or other materials provided with the distribution. 14a06e2ab3SBen Gras.\" 3. Neither the name of the University nor the names of its contributors 15a06e2ab3SBen Gras.\" may be used to endorse or promote products derived from this software 16a06e2ab3SBen Gras.\" without specific prior written permission. 17a06e2ab3SBen Gras.\" 18a06e2ab3SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19a06e2ab3SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20a06e2ab3SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21a06e2ab3SBen Gras.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22a06e2ab3SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23a06e2ab3SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24a06e2ab3SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25a06e2ab3SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26a06e2ab3SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27a06e2ab3SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28a06e2ab3SBen Gras.\" SUCH DAMAGE. 29a06e2ab3SBen Gras.\" 30a06e2ab3SBen Gras.\" from: @(#)ttys.5 8.1 (Berkeley) 6/4/93 31a06e2ab3SBen Gras.\" 32a06e2ab3SBen Gras.Dd April 5, 2012 33a06e2ab3SBen Gras.Dt TTYS 5 34a06e2ab3SBen Gras.Os 35a06e2ab3SBen Gras.Sh NAME 36a06e2ab3SBen Gras.Nm ttys 37a06e2ab3SBen Gras.Nd terminal initialization information 38a06e2ab3SBen Gras.Sh DESCRIPTION 39a06e2ab3SBen GrasThe file 40a06e2ab3SBen Gras.Nm 41a06e2ab3SBen Grascontains information that is used by various routines to initialize 42a06e2ab3SBen Grasand control the use of terminal special files. 43a06e2ab3SBen GrasThis information is read with the 44a06e2ab3SBen Gras.Xr getttyent 3 45a06e2ab3SBen Graslibrary routines. 46a06e2ab3SBen Gras.Pp 47a06e2ab3SBen GrasThere is one line in the 48a06e2ab3SBen Gras.Nm 49a06e2ab3SBen Grasfile per special device file. 50a06e2ab3SBen GrasFields are separated by tabs and/or spaces. 51a06e2ab3SBen GrasFields comprising more than one word should be enclosed in double 52a06e2ab3SBen Grasquotes (``"''). 53a06e2ab3SBen GrasBlank lines and comments may appear anywhere in the file; comments 54a06e2ab3SBen Grasare delimited by hash marks (``#'') and new lines. 55a06e2ab3SBen GrasAny unspecified fields will default to null. 56a06e2ab3SBen Gras.Pp 57a06e2ab3SBen GrasEach line in 58a06e2ab3SBen Gras.Nm 59a06e2ab3SBen Grashas the format: 60a06e2ab3SBen Gras.Dl tty command type flags 61a06e2ab3SBen Gras.Pp 62a06e2ab3SBen GrasThe first field is the 63a06e2ab3SBen Grasname of the terminal special file as it is found in 64a06e2ab3SBen Gras.Pa /dev . 65a06e2ab3SBen Gras.Pp 66a06e2ab3SBen GrasThe second field of the file is the command to execute for the line, 67a06e2ab3SBen Grasusually 68a06e2ab3SBen Gras.Xr getty 8 , 69a06e2ab3SBen Graswhich initializes and opens the line, setting the speed, waiting for 70a06e2ab3SBen Grasa user name and executing the 71a06e2ab3SBen Gras.Xr login 1 72a06e2ab3SBen Grasprogram. 73a06e2ab3SBen GrasHowever, it can be any desired command, for example the start up 74a06e2ab3SBen Grasfor a window system terminal emulator or some other daemon process, 75a06e2ab3SBen Grasand can contain multiple words if quoted. 76a06e2ab3SBen Gras.Pp 77a06e2ab3SBen GrasThe third field is the type of terminal usually connected to that 78a06e2ab3SBen Grastty line, normally the one found in the 79a06e2ab3SBen Gras.Xr terminfo 5 80a06e2ab3SBen Grasdata base file. 81a06e2ab3SBen GrasThe environment variable 82a06e2ab3SBen Gras.Dv TERM 83a06e2ab3SBen Grasis initialized with the value by either 84a06e2ab3SBen Gras.Xr getty 8 85a06e2ab3SBen Grasor 86a06e2ab3SBen Gras.Xr login 1 . 87a06e2ab3SBen Gras.Pp 88a06e2ab3SBen GrasThe remaining fields set flags in the 89a06e2ab3SBen Gras.Fa ty_status 90a06e2ab3SBen Grasentry (see 91a06e2ab3SBen Gras.Xr getttyent 3 ) 92a06e2ab3SBen Grasor specify a window system process that 93a06e2ab3SBen Gras.Xr init 8 94a06e2ab3SBen Graswill maintain for the terminal line 95a06e2ab3SBen Grasor a key into a database of tty attributes (currently unused). 96a06e2ab3SBen Gras.Pp 97a06e2ab3SBen Gras.Bl -tag -width softcar 98a06e2ab3SBen Gras.It Sy on No or Sy off 99a06e2ab3SBen Gras.Xr init 8 100a06e2ab3SBen Grasshould (or should not) execute the command given in the second field. 101a06e2ab3SBen Gras.It Sy secure 102a06e2ab3SBen GrasIf 103a06e2ab3SBen Gras.Sy on 104a06e2ab3SBen Grasis specified, allows users with a uid of 0 105a06e2ab3SBen Gras.Pq e.g. Qq root 106a06e2ab3SBen Grasto login on this line. 107a06e2ab3SBen Gras.It Sy local 108a06e2ab3SBen GrasSets the 109a06e2ab3SBen Gras.Dv TIOCFLAG_CLOCAL 110a06e2ab3SBen Gras.Xr tty 4 111a06e2ab3SBen Grasflag for the device. 112a06e2ab3SBen GrasThis will cause the 113a06e2ab3SBen Gras.Xr termios 4 114a06e2ab3SBen Gras.Dv CLOCAL 115a06e2ab3SBen Grasflag to be set on every open and thus modem control signal lines will be 116a06e2ab3SBen Grasignored by default. 117a06e2ab3SBen Gras.It Sy softcar 118a06e2ab3SBen GrasCauses the driver to ignore hardware carrier on the line (by setting the 119a06e2ab3SBen Gras.Dv TIOCFLAG_SOFTCAR 120a06e2ab3SBen Gras.Xr tty 4 121a06e2ab3SBen Grasflag). 122a06e2ab3SBen Gras.It Sy rtscts 123a06e2ab3SBen GrasSets the 124a06e2ab3SBen Gras.Dv TIOCFLAG_CRTSCTS 125a06e2ab3SBen Gras.Xr tty 4 126a06e2ab3SBen Grasflag for the device to enable 127a06e2ab3SBen Gras.Tn RTS / 128a06e2ab3SBen Gras.Tn CTS 129a06e2ab3SBen Gras.Qq hardware 130a06e2ab3SBen Grasflow control by default. 131a06e2ab3SBen Gras.It Sy mdmbuf 132a06e2ab3SBen GrasSets the 133a06e2ab3SBen Gras.Dv TIOCFLAG_MDMBUF 134a06e2ab3SBen Gras.Xr tty 4 135a06e2ab3SBen Grasflag for the device to enable 136a06e2ab3SBen Gras.Tn DTR / 137a06e2ab3SBen Gras.Tn DCD 138a06e2ab3SBen Gras.Qq hardware 139a06e2ab3SBen Grasflow control by default. 140a06e2ab3SBen Gras.El 141a06e2ab3SBen Gras.Pp 142a06e2ab3SBen GrasThe flags 143a06e2ab3SBen Gras.Qq local , 144a06e2ab3SBen Gras.Qq rtscts , 145a06e2ab3SBen Gras.Qq mdmbuf , 146a06e2ab3SBen Grasand 147a06e2ab3SBen Gras.Qq softcar 148a06e2ab3SBen Grasmodify the default behaviour of the terminal line, and their actions 149a06e2ab3SBen Grasare device driver dependent. 150a06e2ab3SBen GrasThese flag fields should not be quoted. 151a06e2ab3SBen Gras.Pp 152a06e2ab3SBen GrasThe string ``window='' may be followed by a quoted command 153a06e2ab3SBen Grasstring which 154a06e2ab3SBen Gras.Xr init 8 155a06e2ab3SBen Graswill execute 156a06e2ab3SBen Gras.Em before 157a06e2ab3SBen Grasstarting the command specified by the second field. 158a06e2ab3SBen Gras.Pp 159a06e2ab3SBen GrasThe string ``class='' may be followed by a quoted string used 160a06e2ab3SBen Grasas a key into a database of attributes for that category of tty. 161a06e2ab3SBen GrasSee 162a06e2ab3SBen Gras.Xr getttynam 3 163a06e2ab3SBen Grasfor more information on this feature. 164a06e2ab3SBen Gras.Pp 165a06e2ab3SBen GrasAfter changing the 166a06e2ab3SBen Gras.Nm 167a06e2ab3SBen Grasfile a 168a06e2ab3SBen Gras.Dv SIGHUP 169a06e2ab3SBen Grassignal can be sent to 170a06e2ab3SBen Gras.Xr init 8 171a06e2ab3SBen Graswith the command 172a06e2ab3SBen Gras.Dq Li "kill \-s HUP 1" . 173a06e2ab3SBen GrasOn receipt of this signal, 174a06e2ab3SBen Gras.Xr init 8 175a06e2ab3SBen Graswill re-read the 176a06e2ab3SBen Gras.Nm 177a06e2ab3SBen Grasfile and spawn any necessary 178a06e2ab3SBen Gras.Xr getty 8 179a06e2ab3SBen Grasprocesses. 180a06e2ab3SBen Gras.Pp 181a06e2ab3SBen Gras.Sy Nota Bene : 182a06e2ab3SBen GrasSending 183a06e2ab3SBen Gras.Dv SIGHUP 184a06e2ab3SBen Grasto 185a06e2ab3SBen Gras.Xr init 8 186a06e2ab3SBen Grasdoes 187a06e2ab3SBen Gras.Em not 188a06e2ab3SBen Graschange the state of the various 189a06e2ab3SBen Gras.Xr tty 4 190a06e2ab3SBen Grasdevice flags listed above; the 191a06e2ab3SBen Gras.Xr ttyflags 8 192a06e2ab3SBen Grasprogram must be run for changes in those flags to take effect on the devices. 193a06e2ab3SBen Gras.Sh FILES 194a06e2ab3SBen Gras.Bl -tag -width /etc/ttys -compact 195a06e2ab3SBen Gras.It Pa /etc/ttys 196a06e2ab3SBen Gras.El 197a06e2ab3SBen Gras.Sh EXAMPLES 198a06e2ab3SBen Gras.Bd -literal 199a06e2ab3SBen Gras# root login on console at 1200 baud 200a06e2ab3SBen Grasconsole "/usr/libexec/getty std.1200" vt100 on secure 201a06e2ab3SBen Gras# dialup at 1200 baud, no root logins 202*0a6a1f1dSLionel Sambuctty00 "/usr/libexec/getty d1200" dialup on # 555-1234 203a06e2ab3SBen Gras# Mike's terminal: hp2621 204a06e2ab3SBen Grasttyh0 "/usr/libexec/getty std.9600" hp2621-nl on # 457 Evans 205a06e2ab3SBen Gras# John's terminal: vt100 206a06e2ab3SBen Grasttyh1 "/usr/libexec/getty std.9600" vt100 on # 459 Evans 207a06e2ab3SBen Gras# terminal emulate/window system 208a06e2ab3SBen Grasttyv0 "/usr/new/xterm -L :0" vs100 on window="/usr/new/Xvs100 0" 209a06e2ab3SBen Gras# Network pseudo ttys -- don't enable getty 210a06e2ab3SBen Grasttyp0 none network 211a06e2ab3SBen Grasttyp1 none network off 212a06e2ab3SBen Gras.Ed 213a06e2ab3SBen Gras.Sh SEE ALSO 214a06e2ab3SBen Gras.Xr login 1 , 215a06e2ab3SBen Gras.Xr getttyent 3 , 216a06e2ab3SBen Gras.Xr ttyslot 3 , 217a06e2ab3SBen Gras.Xr tty 4 , 218a06e2ab3SBen Gras.Xr gettytab 5 , 219a06e2ab3SBen Gras.Xr terminfo 5 , 220a06e2ab3SBen Gras.Xr getty 8 , 221a06e2ab3SBen Gras.Xr init 8 , 222a06e2ab3SBen Gras.Xr ttyflags 8 223a06e2ab3SBen Gras.Sh HISTORY 224a06e2ab3SBen GrasA 225a06e2ab3SBen Gras.Nm 226a06e2ab3SBen Grasfile appeared in 227a06e2ab3SBen Gras.At v6 . 228