📄 getty.8
字号:
.\" SCCSID: @(#)getty.8 3.1 11/24/87.TH getty 8 .SH Namegetty \- set terminal mode.SH Syntax\fB/etc/getty [ \fItype\fB ] [ \fItty\fB ]\fR.SH Description.NXR "getty program".NXAM "getty program" "gettytab file".NXR "terminal" "setting mode"The .PN gettyroutine is one of several (.PN init ,.PN getty ,.PN login ,.PN shell) by which users gain access to the ULTRIXsystem from a terminal.The.PN gettyroutineinitializes a terminal line, reads a login name, and invokes.MS login 1 .While reading the name, the.PN gettyroutine tries to adapt the system to the speed and type of terminalon the line specified by the.PN ttyargument..PPThe .PN initcommand typically invokes.PN getty ,as directed by the.I commandfield in the .PN /etc/ttysfile..PPThe.PN gettyroutine first tries to initialize the line. It examines.PN /etc/ttysand sets up the line for local or remote connections, asappropriate. Next, the.PN gettyroutine calls.MS vhangup 2to revoke access to the terminal by any background processes thatcould have .PN /dev/ttyopen.The.PN getty routine then opens .PN /dev/ttyfor reading and writing.File descriptors 0, 1, and 2 become the standard input, output,and diagnostic devices. If the terminal line is connected to a modem,the open isnot completed until someone dials up and establishes carrieron the channel. .PP If a terminal exists, but an error occurs when trying toopen the terminal, the.PN gettyroutine writes a message to the system console. The message is repeatedevery 10 minutes until the terminal is available, orthe.PN /etc/ttysentry for the terminal is modified to indicate thatthe terminal is off, and.MS init 8is notified by a hangup..PPThe.PN gettyroutine checks every minute to see if the terminal is still off..PPNext, the.PN gettyroutine reads a login name, terminated by a newline or carriage-returncharacter. For a carriage return, the system is set to treatcarriage returns appropriately. For further information, see.MS tty 4 ..PPThe.PN gettyroutine scans the user's name to see if it contains any lowercasealphabetic characters. If it does not, and the name isnonempty, the system is told to map any future uppercasecharacters into the corresponding lowercase characters..PPFinally,.PN gettycalls.PN loginwith the user's name as an argument..PPMost of thedefault actions of.PN gettycan be changed with a suitable .PN gettytabtable..PPThe.PN gettyroutine can be set to timeout after some interval with the\fIto\fR variable in the .MS gettytab 5table.Thus,if the user does not enter a login name after a reasonableamount of time,.PN gettyhangs up the dialup line..SH Arguments.IP \fItty\fR The special device file in the .PN /devdirectory to openfor the terminal (for example, ttyh0). If there is no argument or the argument is "+", the terminal lineis assumed to be open as file descriptor 0..IP \fItype\fR Used to make.PN gettytreat the line specially.This argument is used as an index into the.MS gettytab 5database, to determine the characteristics of the line.If there is no argument, or there is no such table, thedefault entry in .MS gettytab 5is used. If there is no .PN /etc/gettytab ,a set of system defaults is used..IPThe.MS gettytab 5entry is used to define specific terminal hardware attributes such as the baudrate and number of bits per character. Terminals which are setup to transmitand receive 8-bit characters must specify a gettytab entry which appropriatelysets up the line. For example a terminal line setup to operate at 9600 baudwith 8-bit characters may use the "8bit.9600" gettytab entry. If a terminalis setup to use 8-bit characters, but uses a 7-bit gettytab entry (suchas "std.9600") the output from the getty program may be corrupted. This output corruption appears as multinational characters being generated by.PN gettyor.PN loginprograms. When these programs operate in 7-bit mode, the high order bit of the character is used as software provided parity. This parity generationcauses conventional ASCII characters to be transformed into multinationalcharacters. By using an 8-bit gettytab entry, characters will be transmittedwithout any software generated parity..IPIf indicated by the table located,.PN gettywill clear the terminal screen,print a banner heading,and prompt for a login name.Usually either the banner or the login prompt will includethe system hostname.Then the user's name is read, a character at a time.If a null character is received, it is assumed to be the resultof the user pushing the break (interrupt) key.The speed is usually thenchanged and the ``login:'' prompt is displayed again.a second break changes the speed again and redisplays the ``login:''prompt. Successive break characters cycle through some standard set of speeds..SH Diagnostics.NXR "getty program" "diagnostics"The.PN gettyuses .MS syslog 3to produce diagnostic messages. Therefore,the syslog configuration file will determine where the messagesare printed. For further information, see .MS syslog 8 . .PP.B "getty: \fItty\fB: cannot open".brA terminal which is turnedon in the .PN ttysfile cannot be opened. This is probably because the requisitelines are either not configured into the system or the associated devicewas not attached during boot-time system configuration.The syslog error logging level is LOG_ERR..PP.B "getty: \fIcommand, tty\fB failing, open blocked".brThe.PN gettyroutine tried a non-blocking open of the terminal line and the open still blocked. This can only happen on devices thathave not implemented O_NDELAY.For further information, see .MS open 2 . The.PN gettyroutine tries to continue but the line may not be properly initialized.The syslog error logging level is LOG_ERR..PP.B "getty: \fIcommand, tty\fB open failed, reason" .brThe .PN gettyroutine tried a non-blocking open of the terminal line and the open failed. The \fIreason\fR is the explanationproduced by the .MS perror 3routine for why the open failed. The.PN gettyroutine tries to continue but the line may not be properly initialized.The syslog error logging level is LOG_ERR..PP.B "getty: in use line \fItty".brThe\fIItty\fR is in use by some other process. The.PN gettyroutine will not initialize a line that is already in use.The.PN gettyroutine will block until the line is no longer in use.See .MS tty 4and .MS open 2for discussions on shared lines.The syslog error logging level is LOG_INFO..PP.B "getty could not set pgrp, \fIreason\fB".brThe.PN gettyroutine tried and failed to initialize the process group of the terminal to processgroup 0. See .MS tty 4for a discussion of process groups.The \fIreason\fR is the explanation produced by .MS perror 3 for the failure.The syslog error logging level is LOG_INFO..SH Files.TP 15.PN /etc/gettytabData base describing terminal lines.SH See Alsologin(1), tty(4), gettytab(5), ttys(5), init(8), syslog(8)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -