'\" te .\" Copyright 1989 AT&T .\" Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. .TH ttymon 1M "10 May 2012" "SunOS 5.11" "System Administration Commands" .SH NAME ttymon \- port monitor for terminal ports .SH SYNOPSIS .LP .nf \fB/usr/sbin/ttymon\fR \fB-g\fR [\fB-d\fR \fIdevice\fR] [\fB-h\fR] [\fB-t\fR \fItimeout\fR] [\fB-l\fR \fIttylabel\fR] [\fB-p\fR \fIprompt\fR] [\fB-m\fR \fImodules\fR] [\fB-T\fR \fItermtype\fR] .fi .SH DESCRIPTION .sp .LP \fBttymon\fR is a STREAMS-based TTY port monitor. Its function is to monitor ports, to set terminal modes, baud rates, and line disciplines for the ports, and to connect users or applications to services associated with the ports. Each instance of \fBttymon\fR monitors one port, specified at startup. When an instance of \fBttymon\fR is started, \fBttymon\fR first initializes the line disciplines, if they are specified, and the speed and terminal settings. For ports with entries in \fB/etc/logindevperm\fR, device owner, group and permissions are set. (See \fBlogindevperm\fR(4).) The values used for initialization are taken from the appropriate entry in the TTY settings file. This file is maintained by the \fBsttydefs\fR(1M) command. Default line disciplines on ports are usually set up by the \fBautopush\fR(1M) command of the Autopush Facility. .sp .LP \fBttymon\fR then writes the prompt and waits for user input. If the user indicates that the speed is inappropriate by pressing the BREAK key, \fBttymon\fR tries the next speed and writes the prompt again. When valid input is received, \fBttymon\fR creates a \fButmpx\fR entry (see \fButmpx\fR(4)), and \fBexec\fRs the login service for the port. Valid input consists of a string of at least one non-newline character, terminated by a carriage return. .sp .LP If \fIautobaud\fR is enabled for a port, \fBttymon\fR will try to determine the baud rate on the port automatically. Users must enter a carriage return before \fBttymon\fR can recognize the baud rate and print the prompt. Currently, the baud rates that can be determined by \fIautobaud\fR are \fB110\fR, \fB1200\fR, \fB2400\fR, \fB4800\fR, and \fB9600\fR. .SS "SMF Service Description" .sp .LP The primary \fBsmf\fR(5) service which invokes \fBttymon\fR is \fBsvc:/system/console-login\fR, which may have multiple service instances. Instances are described in greater detail below. The service provides a number of properties within the property group \fBttymon\fR to control the invocation, as follows: .sp .in +2 .nf NAME TYPE TTYMON OPTION ---------------------------------------------------------- device astring [-d device] nohangup boolean [-h] label astring [-l label] modules astring [-m module1,module2] prompt astring [-p prompt] timeout count [-t timeout] terminal_type astring [-T termtype] .fi .in -2 .sp .sp .LP If any value is the empty string or an integer set to zero, then the option is not passed to the \fBttymon\fR invocation. .sp .ne 2 .mk .na \fB\fBsvc:/system/console-login:default\fR\fR .ad .sp .6 .RS 4n The default instance always represents the \fBttymon\fR that offers login on the system hardware console. .sp See EXAMPLES for an example of how to modify settings for the system console. .RE .sp .ne 2 .mk .na \fB\fBsvc:/system/console-login:{vt2, vt3, vt4, vt5, vt6}\fR\fR .ad .sp .6 .RS 4n Additional service instances are provided for the system's virtual consoles. If virtual consoles are not available, these services will automatically disable themselves. See \fBvtdaemon\fR(1M). .RE .sp .ne 2 .mk .na \fB\fBsvc:/system/console-login:{terma, termb}\fR\fR .ad .sp .6 .RS 4n \fBsvc:/system/console-login:terma\fR and \fBsvc:/system/console-login:termb\fR are provided as a convenience and can assist the user in setting up login services for additional ports \fB/dev/term/a\fR and \fB/dev/term/b\fR. These services are disabled by default. .RE .SS "Creating Additional Instances" .sp .LP The user can configure additional service instances for additional devices. This can be accomplished in any of these ways: .RS +4 .TP .ie t \(bu .el o Manually creating the service instance using \fBsvccfg\fR(1M). .RE .RS +4 .TP .ie t \(bu .el o Creating the service in a service profile (see \fBsmf\fR(5)). .RE .RS +4 .TP .ie t \(bu .el o Creating a service manifest for additional service instance(s). .RE .sp .LP See EXAMPLES for an example of manually configuring the service using \fBsvccfg\fR. .SS "SMF Service Errors" .sp .LP In most cases when an instance of the console-login service is misconfigured, it will transition itself to the maintenance state. Use \fBsvcs\fR \fB-l\fR (see \fBsvcs\fR(1)) to determine the location of the service's log file and consult the log for additional information. .sp .LP In some error cases, the service may respawn indefinitely. Disable the service using \fBsvcadm\fR(1M), then consult the service log for additional messages or information to help resolve the problem. .SH SECURITY .sp .LP \fBttymon\fR uses \fBpam\fR(3PAM) for session management. The \fBPAM\fR configuration policy, specified in \fB/etc/pam.conf\fR or per-service files in \fB/etc/pam.d/\fR, specifies the modules to be used for \fBttymon\fR. Here is a partial \fBpam.conf\fR file with an entry for \fBttymon\fR using the UNIX session management module: .sp .in +2 .nf ttymon session required /usr/lib/security/pam_unix_session.so.1 .fi .in -2 .sp .LP The equivalent PAM configuration using \fB/etc/pam.d/\fR would be the following entry in \fB/etc/pam.d/ttymon\fR: .sp .in +2 .nf session required /usr/lib/security/pam_unix_session.so.1 .fi .in -2 .sp .sp .LP If there are no entries for the \fBttymon\fR service in \fB/etc/pam.conf\fR and the \fB/etc/pam.d/ttymon\fR file does not exist, then the entries for the "other" service in \fB/etc/pam.conf\fR will be used. If there are not any entries in \fB/etc/pam.conf\fR for the "other" service, then the entries in \fB/etc/pam.d/other\fR will be used. .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-g\fR\fR .ad .RS 14n .rt The \fB-g\fR option is required for historical reasons. .RE .sp .ne 2 .mk .na \fB\fB-d\fR\fIdevice\fR\fR .ad .RS 14n .rt \fIdevice\fR is the full path name of the port to which \fBttymon\fR is to attach. If this option is not specified, file descriptor \fB0\fR must be set up by the invoking process to a TTY port. .RE .sp .ne 2 .mk .na \fB\fB-h\fR\fR .ad .RS 14n .rt If the -h flag is not set, \fBttymon\fR will force a hangup on the line by setting the speed to zero before setting the speed to the default or specified speed. .RE .sp .ne 2 .mk .na \fB\fB-l\fR\fIttylabel\fR\fR .ad .RS 14n .rt \fIttylabel\fR is a link to a speed and TTY definition in the \fBttydefs\fR file. This definition tells \fBttymon\fR at what speed to run initially, what the initial TTY settings are, and what speed to try next if the user indicates that the speed is inappropriate by pressing the BREAK key. The default speed is 9600 baud. .RE .sp .ne 2 .mk .na \fB\fB-m\fR\fImodules\fR\fR .ad .RS 14n .rt When initializing the port, \fBttymon\fR will pop all modules on the port, and then push \fImodules\fR in the order specified. \fImodules\fR is a comma-separated list of pushable modules. Default modules on the ports are usually set up by the Autopush Facility. .RE .sp .ne 2 .mk .na \fB\fB-p\fR\fIprompt\fR\fR .ad .RS 14n .rt Allows the user to specify a prompt string. The default prompt is \fBLogin:\fR. .RE .sp .ne 2 .mk .na \fB\fB-t\fR\fItimeout\fR\fR .ad .RS 14n .rt Specifies that \fBttymon\fR should exit if no one types anything in \fItimeout\fR seconds after the prompt is sent. .RE .sp .ne 2 .mk .na \fB\fB-T\fR\fItermtype\fR\fR .ad .RS 14n .rt Sets the \fBTERM\fR environment variable to \fItermtype\fR. .RE .sp .ne 2 .mk .na \fB\fB-v\fR\fR .ad .RS 14n .rt Enables verbose messaging. .RE .SH EXAMPLES .LP \fBExample 1 \fRSetting the Terminal Type for the System Console .sp .LP The following example sets the value of the terminal type (\fB-T\fR) option for the system console \fBttymon\fR invocation: .sp .in +2 .nf # \fBsvccfg -s svc:/system/console-login:default \e\fR \fB"setprop ttymon/terminal_type = xterm"\fR # \fBsvcadm refresh svc:/system/console-login:default\fR .fi .in -2 .sp .LP \fBExample 2 \fRCreating a Service Instance for an Additional Serial Device .sp .LP In this example, the user wishes to configure an additional instance of the \fBsvc:/system/console-login\fR service in order to offer login services over a terminal connected by means of a USB serial adapter. Assume that the USB serial port is present as \fB/dev/term/1\fR, and the user plans to connect a \fBvt100\fR terminal to it. In this case, the service instance can be named \fBterm1\fR (or any other name) and defined as follows: .sp .in +2 .nf # \fBsvccfg -s svc:/system/console-login "add term1"\fR # \fBSVC=svc:/system/console-login:term1\fR # \fBsvccfg -s $SVC "addpg ttymon application"\fR # \fBsvccfg -s $SVC "setprop ttymon/device = /dev/term/1"\fR # \fBsvccfg -s $SVC "setprop ttymon/terminal_type = vt100"\fR # \fBsvcadm refresh $SVC\fR # \fBsvcadm enable $SVC\fR .fi .in -2 .sp .SH ENVIRONMENT VARIABLES .sp .LP If any of the \fBLC_*\fR variables ( \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR, \fBLC_COLLATE\fR, \fBLC_NUMERIC\fR, and \fBLC_MONETARY\fR ) (see \fBenviron\fR(5)) are not set in the environment, the operational behavior of \fBttymon\fR for each corresponding locale category is determined by the value of the \fBLANG\fR environment variable. If \fBLC_ALL\fR is set, its contents are used to override both the \fBLANG\fR and the other \fBLC_*\fR variables. If none of the above variables is set in the environment, the "C" (U.S. style) locale determines how \fBttymon\fR behaves. .sp .ne 2 .mk .na \fB\fBLC_CTYPE\fR\fR .ad .RS 12n .rt Determines how \fBttymon\fR handles characters. When \fBLC_CTYPE\fR is set to a valid value, \fBttymon\fR can display and handle text and filenames containing valid characters for that locale. \fBttymon\fR can display and handle Extended Unix Code (EUC) characters where any individual character can be 1, 2, or 3 bytes wide. \fBttymon\fR can also handle EUC characters of 1, 2, or more column widths. In the "C" locale, only characters from ISO 8859-1 are valid. .RE .SH FILES .sp .ne 2 .mk .na \fB\fB/etc/logindevperm\fR\fR .ad .sp .6 .RS 4n Contains information that is used by \fBlogin\fR(1) and \fBttymon\fR to change the owner, group, and permissions of devices upon logging into or out of a console device. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitysystem/core-os _ Interface StabilityCommitted .TE .SH SEE ALSO .sp .LP \fBsvcs\fR(1), \fBct\fR(1C), \fBcu\fR(1C), \fBautopush\fR(1M), \fBsttydefs\fR(1M), \fBsvcadm\fR(1M), \fBsvccfg\fR(1M), \fBuucico\fR(1M), \fBvtdaemon\fR(1M), \fBpam\fR(3PAM), \fBlogindevperm\fR(4), \fBpam.conf\fR(4), \fButmpx\fR(4), \fBattributes\fR(5), \fBenviron\fR(5), \fBpam_authtok_check\fR(5), \fBpam_authtok_get\fR(5), \fBpam_authtok_store\fR(5), \fBpam_dhkeys\fR(5), \fBpam_passwd_auth\fR(5), \fBpam_unix_account\fR(5), \fBpam_unix_auth\fR(5), \fBpam_unix_session\fR(5), \fBsmf\fR(5) .sp .LP \fIIntroduction to Oracle Solaris 11.3 Administration\fR .SH NOTES .SS "Service Access Facility (SAF and SAC)" .sp .LP \fBttymon\fR was formerly a component of the Service Access Facility and was invoked by \fBsac\fR, the Service Access Controller. This facility has been removed in this release of Solaris, and a conversion to SMF of relevant portions was performed. .SS "Competition for Ports" .sp .LP If a port is monitored by more than one \fBttymon\fR, it is possible for the \fBttymon\fRs to send out prompt messages in such a way that they compete for input. .sp .LP It is possible that two \fBsvc:/system/console-login\fR service instances could refer to the same underlying device. For example, if the system's hardware console is connected (due to settings or autodetection in firmware) to serial port A, then both the \fBsvc:/system/console-login:default\fR and \fBsvc:/system/console-login:terma\fR services will refer to same underlying hardware device. Care should be taken when defining or enabling additional service instances to avoid this situation, or the two \fBttymon\fRs will compete for input.