Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
12.  Managing Serial Ports With the Service Access Facility (Tasks) Administering ttymon Port Monitors How to Add a ttymon Port Monitor  Previous   Contents   Next 
   
 

How to View ttymon Port Monitor Status

To see the status of a ttymon port monitor, type the following:

# sacadm -l -p mbmon

-l

The list port monitor status flag.

-p

Specifies the pmtag mbmon as the port monitor tag.

Example--Viewing ttymon Port Monitor Status

# sacadm -l -p mbmon
PMTAG  PMTYPE  FLGS RCNT STATUS    COMMAND
mbmon  ttymon  -    0    STARTING  /usr/lib/saf/ttymon #TTY Ports a & b

PMTAG

mbmon

Identifies the port monitor name, mbmon.

PMTYPE

ttymon

Identifies the port monitor type, ttymon.

FLGS

-

Indicates whether the following two flags are set:

d, do not enable the new port monitor, or

x, do not start the new port monitor. There are no flags set in this example.

RCNT

0

Indicates the return count value. A return count of 0 indicates that the port monitor is not to be restarted if it fails.

STATUS

STARTING

Indicates the current status of the port monitor.

COMMAND

/usr/lib/saf ...

Identifies the command used to start the port monitor.

#TTY Ports a & b

Identifies any comment used to describe the port monitor.

How to Stop a ttymon Port Monitor

To kill a ttymon port monitor, type the following:

# sacadm -k -p mbmon

-k

The kill port monitor status flag.

-p

Specifies the pmtag mbmon as the port monitor tag.

How to Start a ttymon Port Monitor

To start a killed ttymon port monitor, type the following:

# sacadm -s -p mbmon

-s

The start port monitor status flag.

-p

Specifies the pmtag mbmon as the port monitor tag.

How to Disable a ttymon Port Monitor

Disabling a port monitor prevents new services from starting, without affecting existing services.

To disable a ttymon port monitor, type the following:

# sacadm -d -p mbmon

-d

The disable port monitor status flag.

-p

Specifies the pmtag mbmon as the port monitor tag.

How to Enable a ttymon Port Monitor

Enabling a ttymon port monitor allows it to service new requests.

To enable a ttymon port monitor, type the following:

# sacadm -e -p mbmon

-e

The enable port monitor status flag.

-p

Specifies the pmtag mbmon as the port monitor tag.

How to Remove a ttymon Port Monitor

To remove a ttymon port monitor, type the following:

# sacadm -r -p mbmon

-r

The remove port monitor status flag.

-p

Specifies the pmtag mbmon as the port monitor tag.


Note - Removing a port monitor deletes all the configuration files associated with it. Port monitor configuration files cannot be updated or changed using sacadm. To reconfigure a port monitor, remove it and add a new one.


Administering ttymon Services

Use pmadm to add services, list the services of one or more ports associated with a port monitor, and enable or disable a service.


Note - You must be superuser to perform the following procedures.


How to Add a Service

To add a standard terminal service to the mbmon port monitor, type the following:

# pmadm -a -p mbmon -s a -i root -v `ttyadm -V` -m "`ttyadm -i 'Terminal
 disabled' -l contty -m ldterm,ttcompat -S y -d /dev/term/a 
-s /usr/bin/login`"

Note - In this example, the input wraps to the next line. Do not put a Return or line feed after contty.


-a

The add port monitor status flag

-p

Specifies the pmtag mbmon as the port monitor tag.

-s

Specifies the svctag a as the port monitor service tag.

-i

Specifies the identity to be assigned to svctag when it runs.

-v

Specifies the version number of the port monitor.

-m

Specifies the ttymon-specific configuration data formatted by ttyadm.

The above pmadm command contains an embedded ttyadm command. The options in this embedded command are as follows:

-b

The bidirectional port flag.

-i

Specifies the inactive (disabled) response message.

-l

Specifies which TTY label in the /etc/ttydefs file to use.

-m

Specifies the STREAMS modules to push before invoking this service.

-d

Specifies the full path name to the device to use for the TTY port.

-s

Specifies the full path name of the service to invoke when a connection request is received. If arguments are required, enclose the command and its arguments in quotation marks (").

How to View the Status of a TTY Port Service

Use the pmadm command as shown to list the status of a TTY port, or all the ports associated with a port monitor.

To list one service of a port monitor, type the following:

# pmadm -l -p mbmon -s a

-l

Lists service information.

-p

Specifies the pmtag mbmon as the port monitor tag.

-s

Specifies the svctag a as the port monitor service tag.

To list all services of all port monitors, type the following:

# pmadm -l

-l

Lists service information

To list all services of a port monitor, type the following:

# pmadm -l -p mbmon

-l

Lists service information

-p

Specifies the pmtag mbmon as the port monitor tag

Example--Viewing the Status of a TTY Port Monitor Service

# pmadm -l -p mbmon
PMTAG  PMTYPE  SVCTAG FLAGS ID    <PMSPECIFIC> 
mbmon  ttymon  a      -     root  /dev/term/a - - /usr/bin/login - contty
ldterm,ttcompat login:  Terminal disabled - y  #

mbmon

Identifies the port monitor name, mbmon, set by using the pmadm -p command.

ttymon

Identifies the port monitor type, ttymon.

a

Indicates the service tag value set by using the pmadm -s command.

-

Identifies whether the following flags are set by using the pmadm -f command:

x, which means do not enable the service;

u, which means create a utmpx entry for the service. No flags are set in this example.

root

Identifies the ID assigned to the service when its started. This value is set by using the pmadm -i command.

<PMSPECIFIC> Information

 

/dev/term/a

Indicates the TTY port pathname set by using the ttyadm -d command.

-

Indicates whether the following flags are set by using the ttyadm -c -b -h -I -r command:

c, sets the connect on carrier flag for the port

b, sets the port as bidirectional, allowing both incoming and outgoing traffic

h, suppresses an automatic hangup immediately after an incoming call is received

I, initializes the port

r, forces ttymon to wait until it receives a character from the port before it prints the login: message.

-

Indicates a value set by using the ttyadm -r option. This option determines when ttymon displays a prompt after receiving data from a port. If count is 0, ttymon will wait until it receives any character. If count is greater than 0, ttymon will wait until count new lines have been received. No value is set in this example.

/usr/bin/login

Identifies the full pathname of the service to be invoked when a connected is received. This value is set by using ttyadm -s command.

-

Identifies the ttyadm -t command's (timeout) value. This option specifies that ttymon should close a port if the open on the port succeeds, and no input data is received in timeout seconds. There is no timeout value in this example.

contty

Identifies the TTY label in the /etc/ttydefs file. This value is set by using the ttyadm -l command.

ldterm,ttcompat

Identifies the STREAMS modules to be pushed. These modules are set by using the ttyadmin -m command.

login: Terminal disabled

Identifies an inactive message to be displayed when the port is disabled. This message is set by using the ttyadm -i command.

tvi925

Identifies the terminal type, if set, by using the ttyadm -Tcommand. The terminal type is tvi925 in this example.

y

Identifies the software carrier value set by using the ttyadm -S command; n will turn software carrier off, y will turn software carrier on. Software carrier is turned on in this example.

#

Identifies any comment specified with the pmadm -y command. (There is no comment in this example).

 
 
 
  Previous   Contents   Next