Upload Tizen:Base source
[framework/base/util-linux-ng.git] / login-utils / agetty.8
1 .TH AGETTY 8 
2 .SH NAME
3 agetty \- alternative Linux getty
4
5 .SH SYNOPSIS
6 .BR "agetty " [\-8ihLmnUw]
7 .RI "[-f " issue_file ]
8 .RI "[-l " login_program ]
9 .RI "[-I " init ]
10 .RI "[-t " timeout ]
11 .RI "[-H " login_host ]
12 .I port
13 .I baud_rate,...
14 .RI [ term ]
15 .br
16 .BR "agetty " [\-8ihLmnw]
17 .RI "[-f " issue_file ]
18 .RI "[-l " login_program ]
19 .RI "[-I " init ]
20 .RI "[-t " timeout ]
21 .RI "[-H " login_host ]
22 .I baud_rate,...
23 .I port
24 .RI [ term ]
25
26 .SH DESCRIPTION
27 .ad
28 .fi
29 \fBagetty\fP opens a tty port, prompts for a login name and invokes
30 the /bin/login command. It is normally invoked by \fIinit(8)\fP.
31
32 \fBagetty\fP has several \fInon-standard\fP features that are useful
33 for hard-wired and for dial-in lines:
34 .IP o
35 Adapts the tty settings to parity bits and to erase, kill,
36 end-of-line and uppercase characters when it reads a login name.
37 The program can handle 7-bit characters with even, odd, none or space
38 parity, and 8-bit characters with no parity. The following special
39 characters are recognized: @ and Control-U (kill); #, DEL and
40 back space (erase); carriage return and line feed (end of line).
41 .IP o
42 Optionally deduces the baud rate from the CONNECT messages produced by
43 Hayes(tm)-compatible modems.
44 .IP o
45 Optionally does not hang up when it is given an already opened line
46 (useful for call-back applications).
47 .IP o
48 Optionally does not display the contents of the \fI/etc/issue\fP file.
49 .IP o
50 Optionally displays an alternative issue file instead of \fI/etc/issue\fP.
51 .IP o
52 Optionally does not ask for a login name.
53 .IP o
54 Optionally invokes a non-standard login program instead of
55 \fI/bin/login\fP.
56 .IP o
57 Optionally turns on hard-ware flow control
58 .IP o
59 Optionally forces the line to be local with no need for carrier detect.
60 .PP
61 This program does not use the \fI/etc/gettydefs\fP (System V) or
62 \fI/etc/gettytab\fP (SunOS 4) files.
63 .SH ARGUMENTS
64 .na
65 .nf
66 .fi
67 .ad
68 .TP
69 port
70 A path name relative to the \fI/dev\fP directory. If a "-" is
71 specified, \fBagetty\fP assumes that its standard input is
72 already connected to a tty port and that a connection to a
73 remote user has already been established.
74 .sp
75 Under System V, a "-" \fIport\fP argument should be preceded
76 by a "--".
77 .TP
78 baud_rate,...
79 A comma-separated list of one or more baud rates. Each time
80 \fBagetty\fP receives a BREAK character it advances through
81 the list, which is treated as if it were circular.
82 .sp
83 Baud rates should be specified in descending order, so that the
84 null character (Ctrl-@) can also be used for baud rate switching.
85 .TP
86 term
87 The value to be used for the TERM environment variable. This overrides
88 whatever init(8) may have set, and is inherited by login and the shell.
89 .SH OPTIONS
90 .na
91 .nf
92 .fi
93 .ad
94 .TP
95 \-8
96 Assume that the tty is 8-bit clean, hence disable parity detection.
97 .TP
98 \-h
99 Enable hardware (RTS/CTS) flow control. It is left up to the
100 application to disable software (XON/XOFF) flow protocol where
101 appropriate.
102 .TP
103 \-i
104 Do not display the contents of \fI/etc/issue\fP (or other) before writing the
105 login prompt. Terminals or communications hardware may become confused
106 when receiving lots of text at the wrong baud rate; dial-up scripts
107 may fail if the login prompt is preceded by too much text.
108 .TP
109 \-f \fIissue_file\fP
110 Display the contents of \fIissue_file\fP instead of \fI/etc/issue\fP.
111 This allows custom messages to be displayed on different terminals.
112 The \-i option will override this option.
113 .TP
114 \-I \fIinitstring\fP
115 Set an initial string to be sent to the tty or modem before sending
116 anything else. This may be used to initialize a modem.  Non printable
117 characters may be sent by writing their octal code preceded by a
118 backslash (\\). For example to send a linefeed character (ASCII 10,
119 octal 012) write \\012.
120 .PP
121 .TP
122 \-l \fIlogin_program\fP
123 Invoke the specified \fIlogin_program\fP instead of /bin/login.
124 This allows the use of a non-standard login program (for example,
125 one that asks for a dial-up password or that uses a different
126 password file).
127 .TP
128 \-H \fIlogin_host\fP
129 Write the specified \fIlogin_host\fP into the utmp file. (Normally,
130 no login host is given, since \fBagetty\fP is used for local hardwired
131 connections and consoles. However, this option can be useful for 
132 identifying terminal concentrators and the like.
133 .TP
134 \-m
135 Try to extract the baud rate the CONNECT status message
136 produced by Hayes(tm)\-compatible modems. These status
137 messages are of the form: "<junk><speed><junk>".
138 \fBagetty\fP assumes that the modem emits its status message at
139 the same speed as specified with (the first) \fIbaud_rate\fP value
140 on the command line.
141 .sp
142 Since the \fI\-m\fP feature may fail on heavily-loaded systems,
143 you still should enable BREAK processing by enumerating all
144 expected baud rates on the command line.
145 .TP 
146 \-n 
147 Do not prompt the user for a login name. This can be used in
148 connection with \-l option to invoke a non-standard login process such
149 as a BBS system. Note that with the \-n option, \fBagetty\fR gets no input from
150 user who logs in and therefore won't be able to figure out parity,
151 character size, and newline processing of the connection. It defaults to 
152 space parity, 7 bit characters, and ASCII CR (13) end-of-line character.
153 Beware that the program that \fBagetty\fR starts (usually /bin/login)
154 is run as root.
155 .TP
156 \-t \fItimeout\fP
157 Terminate if no user name could be read within \fItimeout\fP
158 seconds. This option should probably not be used with hard-wired
159 lines.
160 .TP
161 \-L
162 Force the line to be a local line with no need for carrier detect. This can
163 be useful when you have a locally attached terminal where the serial line
164 does not set the carrier detect signal.
165 .TP
166 \-U
167 Turn on support for detecting an uppercase only terminal.  This setting will
168 detect a login name containing only capitals as indicating an uppercase
169 only terminal and turn on some upper to lower case conversions.  Note that
170 this has no support for any unicode characters.
171 .TP
172 \-w 
173 Wait for the user or the modem to send a carriage-return or a
174 linefeed character before sending the \fI/etc/issue\fP (or other) file
175 and the login prompt. Very useful in connection with the \-I option.
176 .PP
177 .SH EXAMPLES
178 This section shows examples for the process field of an entry in the
179 \fI/etc/inittab\fP file.  You'll have to prepend appropriate values
180 for the other fields.  See \fIinittab(5)\fP for more details.
181
182 For a hard-wired line or a console tty:
183 .ti +5
184 /sbin/agetty 9600 ttyS1
185
186 For a directly connected terminal without proper carriage detect wiring:
187 (try this if your terminal just sleeps instead of giving you a password:
188 prompt.)
189 .ti +5
190 /sbin/agetty \-L 9600 ttyS1 vt100
191
192 For a old style dial-in line with a 9600/2400/1200 baud modem:
193 .ti +5
194 /sbin/agetty \-mt60 ttyS1 9600,2400,1200
195
196 For a Hayes modem with a fixed 115200 bps interface to the machine:
197 (the example init string turns off modem echo and result codes, makes
198 modem/computer DCD track modem/modem DCD, makes a DTR drop cause a 
199 dis-connection and turn on auto-answer after 1 ring.)
200 .ti +5
201 /sbin/agetty \-w \-I 'ATE0Q1&D2&C1S0=1\\015' 115200 ttyS1
202
203 .SH ISSUE ESCAPES
204 The issue-file (\fI/etc/issue\fP or the file set with the \-f option)
205 may contain certain escape codes to display the system name, date and
206 time etc. All escape codes consist of a backslash (\\) immediately
207 followed by one of the letters explained below.
208
209 .TP
210 b
211 Insert the baudrate of the current line.
212 .TP
213 d
214 Insert the current date.
215 .TP
216 s
217 Insert the system name, the name of the operating system.
218 .TP
219 l
220 Insert the name of the current tty line.
221 .TP
222 m
223 Insert the architecture identifier of the machine, eg. i486
224 .TP
225 n
226 Insert the nodename of the machine, also known as the hostname.
227 .TP
228 o
229 Insert the NIS domainname of the machine.
230 .TP
231 O
232 Insert the DNS domainname of the machine.
233 .TP
234 r
235 Insert the release number of the OS, eg. 1.1.9.
236 .TP
237 t
238 Insert the current time.
239 .TP
240 u
241 Insert the number of current users logged in.
242 .TP
243 U
244 Insert the string "1 user" or "<n> users" where <n> is the number of current
245 users logged in.
246 .TP
247 v
248 Insert the version of the OS, eg. the build-date etc.
249 .TP
250 Example: On my system, the following \fI/etc/issue\fP file:
251
252 .na
253 .nf
254 .ti +.5
255 This is \\n.\\o (\\s \\m \\r) \\t
256 .TP
257 displays as
258
259 .ti +.5
260 This is thingol.orcan.dk (Linux i386 1.1.9) 18:29:30
261
262 .fi
263
264 .SH FILES
265 .na
266 .nf
267 /var/run/utmp, the system status file.
268 /etc/issue, printed before the login prompt.
269 /dev/console, problem reports (if syslog(3) is not used).
270 /etc/inittab, \fIinit\fP(8) configuration file.
271 .SH BUGS
272 .ad
273 .fi
274 The baud-rate detection feature (the \fI-m\fP option) requires that
275 \fBagetty\fP be scheduled soon enough after completion of a dial-in
276 call (within 30 ms with modems that talk at 2400 baud). For robustness,
277 always use the \fI\-m\fP option in combination with a multiple baud
278 rate command-line argument, so that BREAK processing is enabled.
279
280 The text in the \fI/etc/issue\fP file (or other) and the login prompt
281 are always output with 7-bit characters and space parity.
282
283 The baud-rate detection feature (the \fI-m\fP option) requires that
284 the modem emits its status message \fIafter\fP raising the DCD line.
285 .SH DIAGNOSTICS
286 .ad
287 .fi
288 Depending on how the program was configured, all diagnostics are
289 written to the console device or reported via the syslog(3) facility.
290 Error messages are produced if the \fIport\fP argument does not
291 specify a terminal device; if there is no utmp entry for the
292 current process (System V only); and so on.
293 .SH AUTHOR(S)
294 .na
295 .nf
296 W.Z. Venema <wietse@wzv.win.tue.nl>
297 Eindhoven University of Technology
298 Department of Mathematics and Computer Science
299 Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
300
301 Peter Orbaek <poe@daimi.aau.dk>
302 Linux port and more options. Still maintains the code.
303
304 Eric Rasmussen <ear@usfirst.org>
305 Added \-f option to display custom login messages on different terminals.
306
307 .SH AVAILABILITY
308 The agetty command is part of the util-linux-ng package and is available from
309 ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.