Move /var/svc/log to /var/log/svc
[unleashed/lotheac.git] / share / man / man8 / ttymon.8
blobddd2bf1514c8fb3b48e10e288a936fc3d1e2e86c
1 '\" te
2 .\" Copyright 1989 AT&T
3 .\" Copyright (C) 2004, Sun Microsystems, Inc.
4 .\" All Rights Reserved
5 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
7 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
8 .TH TTYMON 8 "Feb 22, 2005"
9 .SH NAME
10 ttymon \- port monitor for terminal ports
11 .SH SYNOPSIS
12 .LP
13 .nf
14 \fB/usr/lib/saf/ttymon\fR
15 .fi
17 .LP
18 .nf
19 \fB/usr/lib/saf/ttymon\fR \fB-g\fR [\fB-d\fR \fIdevice\fR] [\fB-h\fR] [\fB-t\fR \fItimeout\fR]
20      [\fB-l\fR \fIttylabel\fR] [\fB-p\fR \fIprompt\fR] [\fB-m\fR \fImodules\fR] [\fB-T\fR \fItermtype\fR]
21 .fi
23 .SH DESCRIPTION
24 .sp
25 .LP
26 \fBttymon\fR is a STREAMS-based TTY port monitor. Its function is to monitor
27 ports, to set terminal modes, baud rates, and line disciplines for the ports,
28 and to connect users or applications to services associated with the ports.
29 Normally, \fBttymon\fR is configured to run under the Service Access
30 Controller, \fBsac\fR(8), as part of the Service Access Facility (SAF). It is
31 configured using the \fBsacadm\fR(8) command. Each instance of \fBttymon\fR
32 can monitor multiple ports. The ports monitored by an instance of \fBttymon\fR
33 are specified in the port monitor's administrative file. The administrative
34 file is configured using the \fBpmadm\fR(8) and \fBttyadm\fR(8) commands.
35 When an instance of \fBttymon\fR is invoked by the \fBsac\fR command, it starts
36 to monitor its ports. For each port, \fBttymon\fR first initializes the line
37 disciplines, if they are specified, and the speed and terminal settings. For
38 ports with entries in \fB/etc/logindevperm\fR, device owner, group and
39 permissions are set. (See \fBlogindevperm\fR(4).) The values used for
40 initialization are taken from the appropriate entry in the TTY settings file.
41 This file is maintained by the \fBsttydefs\fR(8) command. Default line
42 disciplines on ports are usually set up by the \fBautopush\fR(8) command of
43 the Autopush Facility.
44 .sp
45 .LP
46 \fBttymon\fR then writes the prompt and waits for user input. If the user
47 indicates that the speed is inappropriate by pressing the BREAK key,
48 \fBttymon\fR tries the next speed and writes the prompt again. When valid input
49 is received, \fBttymon\fR interprets the per-service configuration file for the
50 port, if one exists, creates a \fButmpx\fR entry if required (see
51 \fButmpx\fR(4)), establishes the service environment, and then invokes the
52 service associated with the port. Valid input consists of a string of at least
53 one non-newline character, terminated by a carriage return. After the service
54 terminates, \fBttymon\fR cleans up the \fButmpx\fR entry, if one exists, and
55 returns the port to its initial state.
56 .sp
57 .LP
58 If \fIautobaud\fR is enabled for a port, \fBttymon\fR will try to determine the
59 baud rate on the port automatically. Users must enter a carriage return before
60 \fBttymon\fR can recognize the baud rate and print the prompt. Currently, the
61 baud rates that can be determined by \fIautobaud\fR are \fB110\fR, \fB1200\fR,
62 \fB2400\fR, \fB4800\fR, and \fB9600\fR.
63 .sp
64 .LP
65 If a port is configured as a bidirectional port, \fBttymon\fR will allow users
66 to connect to a service.  If a port is bidirectional, \fBttymon\fR will wait
67 to read a character before it prints a prompt.
68 .sp
69 .LP
70 If the \fIconnect-on-carrier\fR flag is set for a port, \fBttymon\fR will
71 immediately invoke the port's associated service when a connection request is
72 received. The prompt message will not be sent.
73 .sp
74 .LP
75 If a port is disabled, \fBttymon\fR will not start any service on that port. If
76 a disabled message is specified, \fBttymon\fR will send out the disabled
77 message when a connection request is received. If \fBttymon\fR is disabled, all
78 ports under that instance of \fBttymon\fR will also be disabled.
79 .SS "Service Invocation"
80 .sp
81 .LP
82 The service \fBttymon\fR invokes for a port is specified in the \fBttymon\fR
83 administrative file. \fBttymon\fR will scan the character string giving the
84 service to be invoked for this port, looking for a \fB%d\fR or a \fB%%\fR
85 two-character sequence. If \fB%d\fR is found, \fBttymon\fR will modify the
86 service command to be executed by replacing those two characters by the full
87 path name of this port (the device name). If \fB%%\fR is found, they will be
88 replaced by a single \fB%\fR. When the service is invoked, file descriptor
89 \fB0\fR, \fB1\fR, and \fB2\fR are opened to the port device for reading and
90 writing. The service is invoked with the user ID, group ID and current home
91 directory set to that of the user name under which the service was registered
92 with \fBttymon\fR. Two environment variables, \fBHOME\fR and \fBTTYPROMPT\fR,
93 are added to the service's environment by \fBttymon\fR. \fBHOME\fR is set to
94 the home directory of the user name under which the service is invoked.
95 \fBTTYPROMPT\fR is set to the prompt string configured for the service on the
96 port. This is provided so that a service invoked by \fBttymon\fR has a means of
97 determining if a prompt was actually issued by \fBttymon\fR and, if so, what
98 that prompt actually was.
99 .sp
101 See \fBttyadm\fR(8) for options that can be set for ports monitored by
102 \fBttymon\fR under the Service Access Controller.
103 .SS "System Console Invocation"
106 The invocation of ttymon on the system console is managed under \fBsmf\fR(5) by
107 the service \fBsvc:/system/console-login\fR. It provides a number of properties
108 within the property group \fBttymon\fR to control the invocation, as follows:
110 .in +2
112 NAME                  TYPE               TTYMON OPTION
113 ----------------------------------------------------------
114 device                astring            [-d device]
115 nohangup              boolean            [-h]
116 label                 astring            [-l label]
117 modules               astring            [-m module1,module2]
118 prompt                astring            [-p prompt]
119 timeout               count              [-t timeout]
120 terminal_type         astring            [-T termtype]
122 .in -2
127 If any value is the empty string or an integer set to zero, then the option is
128 not passed to the ttymon invocation. The \fB-g\fR option is always specified
129 for this invocation. The \fB-d\fR option always defaults to \fB/dev/console\fR
130 if it is not set.
133 See \fBEXAMPLES\fR.
134 .SH SECURITY
137 \fBttymon\fR uses \fBpam\fR(3PAM) for session management. The \fBPAM\fR
138 configuration policy, listed through \fB/etc/pam.conf\fR, specifies the modules
139 to be used for \fBttymon\fR. Here is a partial \fBpam.conf\fR file with entries
140 for \fBttymon\fR using the UNIX session management module.
142 .in +2
144 ttymon session  required /usr/lib/security/pam_unix_session.so.1
146 .in -2
150 If there are no entries for the \fBttymon\fR service, then the entries for the
151 "other" service will be used.
152 .SH OPTIONS
155 The following options are supported:
157 .ne 2
159 \fB\fB-g\fR\fR
161 .RS 14n
162 A special invocation of \fBttymon\fR is provided with the \fB-g\fR option. This
163 form of the command should only be called by applications that need to set the
164 correct baud rate and terminal settings on a port and then connect to
165 \fBlogin\fR service, but that cannot be pre-configured under the SAC. The
166 following combinations of options can be used with \fB-g\fR:
170 .ne 2
172 \fB\fB-d\fR\fIdevice\fR\fR
174 .RS 14n
175 \fIdevice\fR is the full path name of the port to which \fBttymon\fR is to
176 attach. If this option is not specified, file descriptor \fB0\fR must be set up
177 by the invoking process to a TTY port.
181 .ne 2
183 \fB\fB-h\fR\fR
185 .RS 14n
186 If the -h flag is not set, \fBttymon\fR will force a hangup on the line by
187 setting the speed to zero before setting the speed to the default or specified
188 speed.
192 .ne 2
194 \fB\fB-l\fR\fIttylabel\fR\fR
196 .RS 14n
197 \fIttylabel\fR is a link to a speed and TTY definition in the \fBttydefs\fR
198 file. This definition tells \fBttymon\fR at what speed to run initially, what
199 the initial TTY settings are, and what speed to try next if the user indicates
200 that the speed is inappropriate by pressing the BREAK key. The default speed is
201 9600 baud.
205 .ne 2
207 \fB\fB-m\fR\fImodules\fR\fR
209 .RS 14n
210 When initializing the port, \fBttymon\fR will pop all modules on the port, and
211 then push \fImodules\fR in the order specified. \fImodules\fR is a
212 comma-separated list of pushable modules. Default modules on the ports are
213 usually set up by the Autopush Facility.
217 .ne 2
219 \fB\fB-p\fR\fIprompt\fR\fR
221 .RS 14n
222 Allows the user to specify a prompt string. The default prompt is \fBLogin:\fR.
226 .ne 2
228 \fB\fB-t\fR\fItimeout\fR\fR
230 .RS 14n
231 Specifies that \fBttymon\fR should exit if no one types anything in
232 \fItimeout\fR seconds after the prompt is sent.
236 .ne 2
238 \fB\fB-T\fR\fItermtype\fR\fR
240 .RS 14n
241 Sets the \fBTERM\fR environment variable to \fItermtype\fR.
244 .SH EXAMPLES
246 \fBExample 1 \fRSetting the Terminal Type
249 The following example sets the value of the terminal type (\fB-T\fR) option for
250 the system console \fBttymon\fR invocation:
253 .in +2
255         svccfg -s svc:/system/console-login setprop \e
256             ttymon/terminal_type = "xterm"
257         svcadm refresh svc:/system/console-login:default
259 .in -2
262 .SH ENVIRONMENT VARIABLES
265 If any of the \fBLC_*\fR variables ( \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR,
266 \fBLC_TIME\fR, \fBLC_COLLATE\fR, \fBLC_NUMERIC\fR, and \fBLC_MONETARY\fR ) (see
267 \fBenviron\fR(5)) are not set in the environment, the operational behavior of
268 \fBttymon\fR for each corresponding locale category is determined by the value
269 of the \fBLANG\fR environment variable. If \fBLC_ALL\fR is set, its contents
270 are used to override both the \fBLANG\fR and the other \fBLC_*\fR variables. If
271 none of the above variables is set in the environment, the "C" (U.S. style)
272 locale determines how \fBttymon\fR behaves.
274 .ne 2
276 \fB\fBLC_CTYPE\fR\fR
278 .RS 12n
279 Determines how \fBttymon\fR handles characters. When \fBLC_CTYPE\fR is set to a
280 valid value, \fBttymon\fR can display and handle text and filenames containing
281 valid characters for that locale. \fBttymon\fR can display and handle Extended
282 Unix Code (EUC) characters where any individual character can be 1, 2, or 3
283 bytes wide. \fBttymon\fR can also handle EUC characters of 1, 2, or more column
284 widths. In the "C" locale, only characters from ISO 8859-1 are valid.
287 .SH FILES
289 .ne 2
291 \fB\fB/etc/logindevperm\fR\fR
293 .RS 21n
299 The command-line syntax is Stable. The SMF properties are Evolving.
300 .SH SEE ALSO
303 \fBautopush\fR(8), \fBpmadm\fR(8), \fBsac\fR(8),
304 \fBsacadm\fR(8), \fBsttydefs\fR(8), \fBttyadm\fR(8),
305 \fBpam\fR(3PAM), \fBlogindevperm\fR(4), \fBpam.conf\fR(4), \fButmpx\fR(4),
306 \fBattributes\fR(5), \fBenviron\fR(5), \fBpam_authtok_check\fR(5),
307 \fBpam_authtok_get\fR(5), \fBpam_authtok_store\fR(5), \fBpam_dhkeys\fR(5),
308 \fBpam_passwd_auth\fR(5), \fBpam_unix_account\fR(5), \fBpam_unix_auth\fR(5),
309 \fBpam_unix_session\fR(5), \fBsmf\fR(5)
312 \fI\fR
313 .SH NOTES
316 If a port is monitored by more than one \fBttymon\fR, it is possible for the
317 \fBttymon\fRs to send out prompt messages in such a way that they compete for
318 input.
321 The \fBpam_unix\fR(5) module is no longer supported. Similar functionality is
322 provided by \fBpam_authtok_check\fR(5), \fBpam_authtok_get\fR(5),
323 \fBpam_authtok_store\fR(5), \fBpam_dhkeys\fR(5), \fBpam_passwd_auth\fR(5),
324 \fBpam_unix_account\fR(5), \fBpam_unix_auth\fR(5), and
325 \fBpam_unix_session\fR(5).