System Administration Guide

Part XII Managing Terminals and Modems

This part provides instructions for managing terminals and modems. This part contains these chapters.

Chapter 47, Managing Terminals and Modems (Overview)

Provides overview information about terminals and modems.  

Chapter 48, Setting Up Terminals and Modems (Tasks)

Provides step-by-step instructions for setting up terminals and modems.  

Chapter 49, Setting Up Terminals and Modems With the Service Access Facility (Tasks)

Provides step-by-step instructions for using SAF commands to set up terminals and modems.  

Chapter 47 Managing Terminals and Modems (Overview)

This chapter provides the overview information for managing terminals and modems. This is a list of the overview information in this chapter.

For step-by-step instructions about how to set up terminals and modems with Admintool, see Chapter 48, Setting Up Terminals and Modems (Tasks).

For step-by-step instructions about how to set up terminals and modems with the SAF, see Chapter 49, Setting Up Terminals and Modems With the Service Access Facility (Tasks).

Terminals, Modems, Ports, and Services

Terminals and modems provide both local and remote access to system and network resources. Setting up terminals and modem access is an important responsibility of a system administrator. This section explains some of the concepts behind modem and terminal management in the Solaris 2.x environment.

Terminals

Your system's bit-mapped graphics display is not the same as an alphanumeric terminal, which connects to a serial port and displays only text. You don't have to perform any special steps to administer the graphics display.

Modems

Modems can be set up in three basic configurations:

A modem connected to your home computer might be set up to provide dial - -out service, meaning you can access other computers from your own home, but nobody outside can gain access to your machine.

Dial-in service is just the opposite. It allows people to access a system from remote sites, but it does not permit calls to the outside world.

Bidirectional access, as the name implies, provides both dial-in and dial-out capabilities.

Ports

A port is a channel through which a device communicates with the operating system. From a hardware perspective, a port is a "receptacle" into which a terminal or modem cable may be plugged.

However, a port is not strictly a physical receptacle, but an entity with hardware (pins and connectors) and software (a device driver) components. A single physical receptacle often provides multiple ports, allowing connection of two or more devices.

Common types of ports include serial, parallel, small computer systems interface (SCSI), and Ethernet.

A serial port, using a standard communications protocol, transmits a byte of information bit-by-bit over a single line.

Devices that have been designed according to RS-232-C or RS-423 standards (this includes most modems, alphanumeric terminals, plotters, and some printers) can be plugged interchangeably (using standard cables) into serial ports of computers that have been similarly designed.

When many serial port devices must be connected to a single computer, it may be necessary to add an adapter board to the system. The adapter board, with its driver software, provides additional serial ports for connecting more devices than could otherwise be accommodated.

Services

Modems and terminals gain access to computing resources via the serial port software. The serial port software must be set up to provide a particular "service" for the device attached to the port. For example, you can set up a serial port to provide bidirectional service for a modem.

Port Monitors

The main mechanism for gaining access to a service is through a port monitor. A port monitor is a program that continuously monitors for requests to log in or access printers or files.

When a port monitor detects a request, it sets whatever parameters are required to establish communication between the operating system and the device requesting service. Then the port monitor transfers control to other processes that provide the services needed.

Table 47-1 describes the two types of port monitors included in the Solaris 2.x environment.

Table 47-1 Port Monitor Types

Port Monitor 

Description 

listen(1M)

Controls access to network services, handling remote print and file system requests. A common use of the listen port monitor is to listen for requests from the LP print service. For more information on the listen port monitor, see Chapter 49, Setting Up Terminals and Modems With the Service Access Facility (Tasks).The listen port monitor is not used when you set up modems and alphanumeric terminals.

ttymon(1M)

Provides access to the login services needed by modems and alphanumeric terminals. Solstice Serial Port Manager automatically sets up a ttymon port monitor to process login requests from these devices. Using Solstice Serial Port Manager to set up terminals and modems is described in Chapter 48, Setting Up Terminals and Modems (Tasks).

You may be familiar with an older port monitor called getty(1M). The new ttymon is more powerful; a single ttymon can replace multiple occurrences of getty. Otherwise, these two programs serve the same function.

Tools for Managing Terminals and Modems

Table 47-2 lists the recommended tools for managing terminals and modems. Table 47-3 lists specific differences in functionality between the Service Access Facility (SAF) and the SolsticeTM Serial Port Manager.

Table 47-2 Recommended Tools For Managing Terminals and Modems

If You Want The Tool That Is... 

Then Use... 

To Start This Tool See... 

The most comprehensive 

Service Access Facility (SAF) commands 

"Service Access Facility"

The quickest setup 

Admintool graphical user interface (for local systems only) 

Chapter 48, Setting Up Terminals and Modems (Tasks)

 

Solstice AdminSuite's Serial Port Manager graphical user interface (for local and remote systems in a networked, name service environment) 

Solstice AdminSuite 2.3 Administration Guide

Table 47-3 Functionality Differences Between Solstice Serial Port Manager and Service Access Facility

If You Need To... 

Then Use... 

Comment 

Inform users that a port is disabled 

Service Access Facility ttyadm -i

ttyadmin -i specifies the inactive (disabled) response message. The message is sent to a terminal or modem when a user attempts to log in when the port is disabled. This functionality is not provided when a port is disabled using Solstice Serial Port Manager.

Keep the modem connection when a user logs off a host 

Service Access Facility ttyadm -h

ttyadm -h specifies that the system will not hang up on a modem before setting or resetting to the default or specified value. If ttyadm -h is not used, when the user logs out of a host, the host will hang up the modem.

Require the user to type a character before the system displays a prompt 

Service Access Facility ttyadm -r

ttyadm -r specifies that ttymon should require the user to type a character or press Return a specified number of times before the login prompt appears. When -r is not specified, pressing Return one or more times will print the prompt anyway. This option prevents a terminal server from issuing a welcome message that the Solaris host might misinterpret to be a user trying to log in. Without the -r option, the host and terminal server might begin looping and printing prompts to each other.

Admintool

Admintool sets up the serial port software to work with terminals and modems by calling the pmadm command with the appropriate information. It also provides:

Service Access Facility

The SAF is the tool used for administering terminals, modems, and other network devices. In particular, SAF enables you to set up:

The SAF is an open-systems solution that controls access to system and network resources through tty devices and local-area networks (LANs). SAF is not a program. It is a hierarchy of background processes and administrative commands.

Chapter 48 Setting Up Terminals and Modems (Tasks)

This chapter provides step-by-step instructions for setting up terminals and modems using Admintool. This is a list of the step-by-step instructions in this chapter.

For overview information about terminals and modems, see Chapter 47, Managing Terminals and Modems (Overview).

Setting Up Terminals and Modems

When setting up serial port information, start Admintool, and select Serial Ports from the Browse menu. Select a serial port from the Serial Ports window and then choose Modify from the Edit menu to bring up the Modify Serial Port window. This window provides access to the port templates and provides information on the port in three levels of detail--Basic, More, and Expert.

Graphic
Note -

The Modify Serial Port window appears in the Basic detail mode. To view More or Expert details, select the More or Expert option from the Detail menu.


The descriptions of each item in the Modify Serial window are listed in Table 48-1.

Table 48-1 Modify Serial Port Window Items

Detail 

Item 

Description 

Basic 

Port 

Lists the port or ports you selected from Serial Ports main window. 

 

Service 

Specifies that the service for the port is turned on (enabled). 

 

Baud Rate 

Specifies the line speed used to communicate with the terminal. The line speed represents an entry in the/etc/ttydefs file.

 

Terminal Type 

Shows the abbreviation for the type of terminal, for example, ansi or vt100. Similar abbreviations are found in /etc/termcap. This value is set in the $TERM environment variable.

More 

Option: Initialize Only 

Specifies that the port software is initialized but not configured. 

 

Option: Bidirectional 

Specifies that the port line is used in both directions. 

 

Option: Software Carrier 

Specifies that the software carrier detection feature is used. If the option is not checked, the hardware carrier detection signal is used.

 

Login Prompt 

Shows the prompt displayed to a user after a connection is made. 

 

Comment 

Shows the comment field for the service. 

 

Service Tag 

Lists the service tag associated with this port--typically an entry in the /dev/term directory.

 

Port Monitor Tag 

Specifies the name of the port monitor to be used for this port. Note: The default monitor is typically correct. 

Expert 

Create utmp Entry

Specifies that a utmp entry is created in the accounting files upon login. Note: This item must be selected if a login service is used. See the Service item.

 

Connect on Carrier 

Specifies that a port's associated service is invoked immediately when a connect indication is received. 

 

Service 

Shows the program that is run upon connection. 

 

Streams Modules 

Shows the STREAMS modules that are pushed before the service is invoked. 

 

Timeout (secs) 

Specifies the number of seconds before a port is closed if the open process on the port succeeds and no input data is received. 

Setting Up Terminals

Table 48-2 describes the menu items (and their default values) when setting up a terminal using Serial Ports.

Table 48-2 Terminal - Hardwired Default Values

Detail 

Item 

Default Value 

Basic 

Port 

-- 

 

Service 

Enabled 

 

Baud Rate 

9600

 

Terminal Type 

-- 

More 

Option: Initialize Only 

no 

 

Option: Bidirectional 

no 

 

Option: Software Carrier 

yes 

 

Login Prompt 

login:

 

Comment 

Terminal - Hardwired 

 

Service Tag 

-- 

 

Port Monitor Tag 

zsmon

Expert 

Create utmp Entry

yes 

 

Connect on Carrier 

no 

 

Service 

/usr/bin/login

 

Streams Modules 

ldterm,ttcompat

 

Timeout (secs) 

Never 

Setting Up Modems

Table 48-3 describes the three modem templates available when setting up a modem using Serial Ports.

Table 48-3 Modem Templates

Modem Configuration 

Description 

Dial-In Only 

Users may dial in to the modem but cannot dial out. 

Dial-Out Only 

Users may dial out from the modem but cannot dial in. 

Bidirectional 

Users may either dial in or out from the modem. 

Table 48-4 describes the default values of each template.

Table 48-4 Modem Template Default Values

Detail 

Item 

Modem - Dial-In Only 

Modem - Dial-Out Only 

Modem - Bidirectional 

Basic 

Port 

-- 

-- 

-- 

 

Service 

Enabled 

Enabled 

Enabled 

 

Baud Rate 

9600 

9600

9600

 

Terminal Type 

-- 

-- 

-- 

More 

Option: Initialize Only 

yes 

no 

no 

 

Option: Bidirectional 

no 

no 

yes 

 

Option: Software Carrier 

no 

no 

no 

 

Login Prompt 

login:

login:

login:

 

Comment 

Modem - Dial-In Only 

Modem - Dial-Out Only 

Modem - Bidirectional 

 

Service Tag 

-- 

-- 

-- 

 

Port Monitor Tag 

zsmon

zsmon

zsmon

Expert 

Create utmp Entry

yes 

yes 

yes 

 

Connect on Carrier 

no 

no 

no 

 

Service 

/usr/bin/login

/usr/bin/login

/usr/sbin/login

 

Streams Modules 

ldterm,ttcompat

ldterm,ttcompat

ldterm,ttcompat

 

Timeout (secs) 

Never 

Never 

Never 

Table 48-5 describes the default values for the Initialize Only template.

Table 48-5 Initialize Only - No Connection Default Values

Detail 

Item 

Default Value 

Basic 

Port 

-- 

 

Service 

Enabled 

 

Baud Rate 

9600 

 

Terminal Type 

-- 

More 

Option: Initialize Only 

yes 

 

Option: Bidirectional 

no 

 

Option: Software Carrier 

no 

 

Login Prompt 

login:

 

Comment 

Initialize Only - No Connection 

 

Service Tag 

-- 

 

Port Monitor Tag 

zsmon

Expert 

Create utmp Entry

yes 

 

Connect on Carrier 

no 

 

Service 

/usr/bin/login

 

Streams Modules 

ldterm,ttcompat

 

Timeout (secs) 

Never 

How to Start Admintool

  1. Verify that the following prerequisites are met. To use Admintool, you must:

    • Have a bit-mapped display monitor. The Admintool software can be used only on a system with a console that is a bit-mapped screen such as a standard display monitor that comes with a Sun workstation.

    • Be running an X Window System, such as the OpenWindowsTM environment.

    • Be a member of the sysadmin group (group 14).

    If you want to perform administration tasks on a system with an ASCII terminal as the console, use Solaris commands instead.


    Note -

    The system being configured must be your local system. Use Solstice AdminSuite Serial Port Manager to configure serial ports on a remote system.


  2. Start Admintool.


    $ admintool &
    

    The Users main window is displayed.

How to Set Up a Terminal

  1. Start Admintool, if it's not already running.

    See "How to Start Admintool" for more information on starting Admintool.

  2. Select Serial Ports from the Browse menu.

    The Serial Ports menu is displayed.

  3. Select the port or ports that will be used with a terminal.

  4. Choose Modify from the Edit menu.

    The Modify Serial Port window appears in the Basic Detail mode. To enter additional details, select either the More or Expert Detail modes.

  5. Choose Terminal-Hardwired from the Use Template menu.

    See Table 48-2 for a description of the Terminal-Hardware menu items.

  6. Change values of template entries if desired.

  7. Click on OK to configure the port.

  8. Use the pmadm command to verify the terminal service has been added.


    $ pmadm -l -s ttya
    

Example--Completed Modify Window to Set Up a Terminal

Graphic

How to Set Up a Modem

  1. Start Admintool, if it's not already running.

    See "How to Start Admintool" for more information on starting Admintool.

  2. Select Serial Ports from the Browse menu.

    The Serial Ports menu is displayed.

  3. Select the port or ports that will be used with a modem.

  4. Choose Modify from the Edit menu.

    The Modify Serial Port window appears in the Basic Detail mode. To enter additional details, select either the More or Expert Detail modes.

  5. Choose the modem configuration template from the Use Template menu that meets or most closely matches your modem service.

    See Table 48-3 for a description of each template.

    See Table 48-4 for the default values of each template. If a UUCP service will be used to dial in to your modem on a Solaris 2.x system, see "How to Set Up a Modem for Use With UUCP" for the rest of the procedure.

  6. Change values of template entries if desired.

  7. Click on OK to configure the port.

  8. Use the pmadm command to verify the modem service has been configured for use with UUCP.


    $ pmadm -l -s ttyb
    

Example--Completed Modify Window to Set Up a Modem

Graphic

How to Set Up a Modem for Use With UUCP

UUCP sends information to a service using seven bits and even parity. Solaris 2.x modem configurations use eight bits and no parity for internationalization purposes. To set up your modem service to work with UUCP, follow these instructions.

  1. Start Admintool, if it's not already running.

    See "How to Start Admintool" for more information on starting Admintool.

  2. Select Serial Ports from the Browse menu.

    The Serial Ports menu is displayed.

  3. Select the port or ports that will be used with a modem.

  4. Choose Modify from the Edit menu.

    The Modify Serial Port window appears in the Basic Detail mode. For additional details, select either the More or Expert Detail modes.

  5. Select Other from the Baud Rate menu.

    A window listing baud rates from the /etc/ttydefs file is displayed.

  6. Enter a baud rate that provides seven bit, even parity service. Click on OK.

  7. Change values of other template entries if desired.

  8. Click on OK to configure the port.

  9. Use the pmadm command to verify the modem service has been configured for use with UUCP.


    $ pmadm -l -s ttya
    

Example--Completed Modify Window to Set Up a Modem for Use With UUCP

In this example, the 9600E baud rate was selected. This provides a service with a 9600 baud rate, seven bits, and even parity.

Graphic

How to Initialize a Port

  1. Start Admintool, if it's not already running.

    See "How to Start Admintool" for more information on starting Admintool.

  2. Select Serial Ports from the Browse menu.

    The Serial Ports menu is displayed.

  3. Select the port or ports that you want to initialize.

  4. Choose Modify from the Edit menu.

    The Modify Serial Port window appears in the Basic Detail mode. To enter additional details, select either the More or Expert Detail modes.

  5. Choose Initialize Only - No Connection from the Use Template menu.

    See Table 48-5 for a description of the Initialize Only - No Connection template.

  6. Click on OK to initialize the port.

  7. Use the pmadm command to verify the port has been disabled.


    $ pmadm -l -s ttyb
    

Example--Completed Modify Window to Initialize a Port

Graphic

How to Disable a Port

  1. Start Admintool, if it's not already running.

    See "How to Start Admintool" for more information on starting Admintool.

  2. Select Serial Ports from the Browse menu.

    The Serial Ports menu is displayed.

  3. Select the port or ports that you want to disable.

  4. Choose Modify from the Edit menu.

  5. Click on the Service Enable button to disable the port service in the Modify window.

    This button acts as a toggle switch to enable or disable a port service.

  6. Click on OK to disable the port.

  7. Use the pmadm command to verify the port service has been disabled.


    $ pmadm -l -s ttya
    

Example--Completed Modify Window to Disable a Port

Graphic

How to Remove a Port Service

  1. Start Admintool, if it's not already running.

    See "How to Start Admintool" for more information on starting Admintool.

  2. Select the port or ports that has a service you want to delete.

  3. Choose Delete from the Edit menu.

    You are asked if you really want to delete the service for the specified port or ports. You may cancel the delete operation or continue with it.

  4. Use the pmadm command to verify the port service has been deleted.


    $ pmadm -l -s ttya
    

TroubleshootingTerminal and Modem Problems

If users are unable to log in over serial port lines after you have added a terminal or modem and set up the proper services, consider the following possible causes of failure.

  1. Begin by checking with the user.

    Malfunctions in terminals and modem use are typically reported by a user who has failed to log in or dial in. For this reason, it is best to begin troubleshooting by checking for a problem on the desktop.

    Some common reasons for login failure include:

    • Login ID or password is incorrect.

    • Terminal is waiting for X-ON flow control key (Control-q).

    • Serial cable is loose or unplugged.

    • Terminal configuration is incorrect.

    • Terminal is shut off or otherwise has no power.

  2. Check the terminal.

    Continue to troubleshoot by checking the configuration of the terminal or modem. Determine the proper ttylabel for communicating with the terminal or modem. Verify that the terminal or modem settings match those of the ttylabel.

  3. Check the terminal server.

    If the terminal checks out, continue to search for the source of the problem on the terminal or modem server. Use the pmadm command to verify that a port monitor has been configured to service the terminal or modem and that it has the correct ttylabel associated with it.


    $ pmadm -l -t ttymon
    

    Examine /etc/ttydefs and double check the label definition against the terminal configuration. Use sacadm to check the port monitor's status. Use pmadm to check the service associated with the port the terminal uses.

  4. Check the serial connection.

    If the Service Access Controller is starting the TTY port monitor and pmadm reports that the service for the terminal's port is enabled, and if the terminal's configuration matches the port monitor's, then continue to search for the problem by checking the serial connection. A serial connection comprises serial ports, cables, and terminals. Test each of these parts by using it with two other parts that are known to be reliable.

    Test all of the following:

    • Serial ports

    • Modems

    • Cables

    • Connectors

  5. Do not use Admintool or Solstice AdminSuite Serial Port Manager to modify serial port settings if the serial port is being used as a console. The correct procedure for changing console settings is by modifying the following line in the /etc/inittab file:


    co:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` console
    login: " -T terminal_type -d /dev/console -l console -m
    ldterm,ttcompat

Chapter 49 Setting Up Terminals and Modems With the Service Access Facility (Tasks)

This chapter explains in detail what a system or network administrator needs to know about the Service Access Facility (SAF) in the Solaris 2.x environment.

If you want to see examples of specific SAF commands, skip the first section, "Using the Service Access Facility", and use the following list to find the instructions you need.

For overview information about terminals and modems, see Chapter 47, Managing Terminals and Modems (Overview).

Using the Service Access Facility

The SAF is the tool used for administering terminals, modems, and other network devices. The top-level SAF program is the Service Access Controller (SAC). The SAC controls port monitors which you administer through the sacadm command. Each port monitor can manage one or more ports.

You administer the services associated with ports through the pmadm command. While services provided through SAC may differ from network to network, SAC and the administrative programs sacadm and pmadm are network independent.

Table 49-1 illustrates the SAF control hierarchy. The sacadm command is used to administer the SAC which controls the ttymon and listen port monitors.

The services of ttymon and listen are in turn controlled by pmadm. One instance of ttymon can service multiple ports and one instance of listen can provide multiple services on a network interface.

Table 49-1 SAF Control Hierarchy

Function 

Program 

Description 

Overall Administration 

sacadm

Command for adding and removing port monitors 

Service Access Controller 

sac

SAF's master program 

Port Monitors 

ttymon

listen

Monitors serial port login requests 

Monitors requests for network services 

Port Monitor Service Administrator 

pmadm

Command for controlling port monitors services 

Services 

logins; remote procedure calls; other 

Services to which SAF provides access 

Console Administration 

console login 

The console is automatically set up via an entry in the /etc/inittab file using ttymon-express mode. Do not use the pmadm or sacadm to manage the console directly. See "ttymon and the Console Port" for more information.

Overall Administration: sacadm Command

The sacadm command is the top level of the SAF. The sacadm command primarily is used to add and remove port monitors such as ttymon and listen. Other sacadm functions include listing the current status of port monitors and administering port monitor configuration scripts.

Service Access Controller: SAC Program

The Service Access Controller program (SAC) oversees all port monitors. A system automatically starts SAC upon entering multiuser mode.

When SAC is invoked, it first looks for, and interprets, each system's configuration script, by which SAC customizes its environment. The modifications made to the SAC environment are inherited by all the "children" of the SAC. This inherited environment may be modified by the children.

After it has interpreted the per-system configuration script, the SAC program reads its administrative file and starts the specified port monitors. For each port monitor, SAC runs a copy of itself (SAC forks a child process). Each child then interprets its per-port monitor configuration script, if such a script exists.

Any modifications to the environment specified in the per-port monitor configuration script affect the port monitor and will be inherited by all its children. Finally, the child process runs the port monitor program using the command found in the SAC administrative file.

SAC Initialization Process

The following steps summarize what happens when SAC is first started:

  1. The SAC program is spawned by init at run level two.

  2. The SAC program reads /etc/saf/_safconfig, the per-system configuration script.

  3. The SAC program reads /etc/saf/_sactab, the SAC administrative file.

  4. The SAC program forks a child process for each port monitor it starts.

  5. Each port monitor reads /etc/saf/pmtag/_config, the per-port monitor configuration script.

Port Monitor Service Administrator: pmadm Command

The pmadm command enables you to administer port monitors' services. In particular, you use the pmadm command to add or remove a service and to enable or disable a service. You can also install or replace per-service configuration scripts, or print information about a service.

Each instance of a service must be uniquely identified by a port monitor and a port. When you use the pmadm command to administer a service, you specify a particular port monitor via the pmtag argument, and a particular port via the svctag argument.

For each port monitor type, the SAF requires a specialized command to format port monitor-specific configuration data. This data is used by the pmadm command. For ttymon and listen type port monitors, these specialized commands are ttyadm and nlsadmin, respectively.

A Port Monitor at Work: ttymon

Whenever you attempt to log in via a directly connected modem or alphanumeric terminal, ttymon goes to work, as follows.

As shown in Figure 49-1, the init program is the first process to be started at boot time. Consulting its administrative file (/etc/inittab), init starts other processes as they are needed. Listed among those processes is the SAC.

SAC, in turn, automatically starts up the port monitors designated in its administrative file (/etc/saf/_sactab). Figure 49-1 shows only a single ttymon port monitor.

After ttymon has been started, it monitors the serial port lines for service requests.

Figure 49-1 How ttymon Helps Process a Login Request

Graphic

When someone attempts to log in via an alphanumeric terminal or a modem, the serial port driver passes the activity to the operating system. The ttymon port monitor notes the serial port activity, and attempts to establish a communications link. ttymon determines what data transfer rate, line discipline, and handshaking protocol are required to communicate with the device.

Having established the proper parameters for communication with the modem or terminal, ttymon passes these parameters to the login program and transfers control to it.

Port Initialization Process

When an instance of ttymon is invoked by SAC, ttymon starts to monitor its ports. For each port, ttymon first initializes the line disciplines, if they are specified, and the speed and terminal settings. The values used for initialization are taken from the appropriate entry in /etc/ttydefs.

The ttymon port monitor then writes the prompt and waits for user input. If the user indicates that the speed is inappropriate by pressing the Break key, ttymon tries the next speed and writes the prompt again.

If autobaud is enabled for a port, ttymon will try to determine the baud rate on the port automatically. Users must press Return before ttymon can recognize the baud rate and print the prompt.

When valid input is received, ttymon interprets the per-service configuration file for the port, creates a /etc/utmp entry if required, establishes the service environment, and invokes the service associated with the port.

After the service terminates, ttymon cleans up the /etc/utmp entry, if one exists, and returns the port to its initial state.

Bidirectional Service

If a port is configured for bidirectional service, ttymon will:

Port Monitors: TTY Monitor and Network Listener

Though SAF provides a generic means for administering any future or third-party port monitors, only two are implemented in the Solaris 2.x environment--ttymon and listen.

TTY Port Monitor: ttymon

The ttymon port monitor is STREAMS-based. It monitors ports; sets terminal modes, baud rates, and line disciplines; and invokes the login process. (It provides Solaris 2.x users the same services that getty did under previous versions of Solaris software.)

The ttymon port monitor runs under the SAC program. It is configured using the sacadm command. Each instance of ttymon can monitor multiple ports. These ports are specified in the port monitor's administrative file. The administrative file is configured using the pmadm and ttyadm commands.

ttymon and the Console Port

Console services are not managed by the Service Access Controller nor any explicit ttymon administration file. An entry in the /etc/inittab file is used to manage the console port using ttymon in express mode, which is a special ttymon mode that is invoked directly by a command that requires login service.

The default console entry in the /etc/inittab file looks like this:


co:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` console login: "
 -T terminal_type -d /dev/console -l console -m ldterm,ttcompat

co:234:respawn:

co identifies the entry as the console; 234 identifies the run levels for the action, respawn, which means the console entry should be restarted if it fails or doesn't exist at run levels 2, 3, and 4.

/usr/lib/saf/ttymon -g -h

The -g option is used so the correct baud rate and terminal setting can be set on a port and connect to a login service without being preconfigured by the SAC. The -h option forces a line hangup by setting the line speed to zero before setting the default or specified speed.

-p "`uname -n` console login:

Identifies the prompt string for the console port. 

-tterminal_type

Identifes the terminal type of the console. 

-d /dev/console -l console -m ldterm,ttcompat

The -d option identifies the console device; the -l option identifies the ttylabel in the /etc/ttydefs file; and the -m option identifies the STREAMS modules to be pushed.

Special ttymon-Specific Administrative Command: ttyadm

The ttymon administrative file is updated by sacadm and pmadm, as well as by the ttyadm command. The ttyadm command formats ttymon-specific information and writes it to the standard output, providing a means for presenting formatted ttymon-specific data to the sacadm and pmadm commands.

Thus, ttyadm does not administer ttymon directly; rather, it complements the generic administrative commands, sacadm and pmadm. See ttyadm(1M) for more details.

Network Listener Service: listen

The listen port monitor runs under SAC. It monitors the network for service requests, accepts requests when they arrive, and invokes servers in response to those service requests.

The listen port monitor is configured using the sacadm command. Each instance of listen can provide multiple services. These services are specified in the port monitor's administrative file. This administrative file is configured using the pmadm and nlsadmin commands.

The network listener process may be used with any connection-oriented transport provider that conforms to the Transport Layer Interface (TLI) specification. In the Solaris 2.x environment, listen port monitors provide additional network services not provided by inetd, such as print service.

Special listen-Specific Administrative Command: nlsadmin

The listen port monitor's administrative file is updated by sacadm and pmadm, as well as by the nlsadmin command. The nlsadmin command formats listen-specific information and writes it to the standard output, providing a means of presenting formatted listen-specific data to the sacadm and pmadm commands.

Thus, nlsadmin does not administer listen directly; rather, it complements the generic administrative commands, sacadm and pmadm. See nlsadmin(1M) for more details.

Each network has at least one instance of the network listener process associated with it. Each network is configured separately. The nlsadmin command controls the operational states of listen port monitors.

The nlsadmin command can establish a listen port monitor for a given network, configure the specific attributes of that port monitor, and start and kill the monitor. The nlsadmin command can also report on the listen port monitors on a machine. See nlsadmin(1M) for a detailed description.

Administering ttymon Port Monitors

Use the sacadm command to add, list, remove, kill, start, enable, disable, enable, and remove a ttymon port monitor.


Note -

You must be superuser to perform the following procedures.


How to Add a ttymon Port Monitor

To add a ttymon port monitor, type:


# sacadm -a -p mbmon -t ttymon -c /usr/lib/saf/ttymon -v `ttyadm
-V` -y "TTY Ports a & b"

-a

The add port monitor flag

-p

Specifies the pmtag mbmon as the port monitor tag

-t

Specifies the port monitor type as ttymon

-c

Defines the command string used to start the port monitor

-v

Specifies the version number of the port monitor

-y

Defines a comment to describe this instance of the port monitor 

How to View ttymon Port Monitor Status

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


# 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:


# 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:


# 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:


# 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:


# 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:


# 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:


# 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 /etc/ttydefs() 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.

Listing One Service

To list one service of a port monitor, type:


# 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

Listing All Services of All Port Monitors

To list all services of all port monitors, type:


# pmadm -l

-l

Lists service information 

Listing All Services of a Port Monitor

To list all services of a port monitor, type:


# 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 utmp 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 ttadm -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, supresses 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).

How to Enable a Port Monitor Service

To enable a disabled port monitor service, type:


# pmadm -e -p mbmon -s a

-e

The enable flag

-p

Specifies the pmtag mbmon as the port monitor tag

-s

Specifies the svctag a as the port monitor service tag

How to Disable a Port Monitor Service

To disable a port monitor service, type:


# pmadm -d -p mbmon -s a

-d

The disable flag

-p

Specifies the pmtag mbmon as the port monitor tag

-s

Specifies the svctag a as the port monitor service tag

Administering listen Port Monitors

Use the sacadm command to add, list, kill, start, enable, disable, or remove a listen port monitor.


Note -

You must be superuser to perform the following procedures.


How to Add a listen Port Monitor

To add a listen port monitor, type:


# sacadm -a -p tcp -t listen -c /usr/lib/saf/listen -v `nlsadmin
-V` -y "le0 ethernet"

-a

The add port monitor flag

-p

Specifies the pmtag tcp as the port monitor tag

-t

Specifies the port monitor type as listen

-c

Defines the command string used to start the port monitor

-v

Specifies the version number of the port monitor

-y

Defines a comment to describe this instance of the port monitor 

How to View listen Port Monitor Status

To list the status of a listen port monitor, type:


# sacadm -l -p tcp

-l

The list port monitor status flag

-p

Specifies the pmtag tcp as the port monitor tag

How to Stop a listen Port Monitor

To kill a listen port monitor, type:


# sacadm -k -p tcp

-k

The kill port monitor flag

-p

Specifies the pmtag tcp as the port monitor tag

How to Start a listen Port Monitor

To start a listen port monitor, type:


# sacadm -s -p tcp

-s

The start port monitor flag

-p

Specifies the pmtag tcp as the port monitor tag

How to Enable a listen Port Monitor

To enable a listen port monitor, type:


# sacadm -e -p tcp

-e

The enable port monitor flag

-p

Specifies the pmtag tcp as the port monitor tag

How to Disable a listen Port Monitor

To disable a listen port monitor, type:


# sacadm -d -p tcp

-e

The disable port monitor flag

-p

Specifies the pmtag tcp as the port monitor tag

How to Remove a listen Port Monitor

To remove a listen port monitor, type:


# sacadm -r -p tcp

-r

The remove port monitor flag

-p

Specifies the pmtag tcp as the port monitor tag

Administering listen Port Monitor Services

Use the pmadm command to add, enable, disable, and list the services associated with a listen port monitor.


Note -

You must be superuser to perform the following procedures.


How to Add a listen Port Monitor Service

To add a listen port monitor service, type:


# pmadm -a -p tcp -s lp -i root -v `nlsadmin -V` -m "`nlsadmin
-o /var/spool/lp/fifos/listenS5`"

In this example, a listen service is added for print requests from remote SunOS 5.x machines. This service does not listen for requests from SunOS 4.x machines.


Note -

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


-a

The add port monitor service flag

-p

Specifies the pmtag tcp as the port monitor tag

-s

Specifies the svctag lp as the port monitor service tag

-i

Specifies the identify to be assigned to svctag when it run 

-v

Specifies the version number of the port monitor

-m

Specifies the listen-specific configuration data formatted by nlsadmin

The above pmadm command contains an embedded nlsadmin command. In that embedded command -o specifies the full path name of a first-in first-out (FIFO) or named STREAM through which a standing server will receive the connection.

How to List listen Port Monitor Services

To list the services associated with a listen port monitor, type:


# pmadm -l -p tcp

-l

The list port monitor service flag

-p

Specifies the pmtag tcp as the port monitor tag

How to Enable a listen Port Monitor Service

To enable a listen port monitor service, type:


# pmadm -e -p tcp -s lp

-e

The enable flag

-p

Specifies the pmtag tcp as the port monitor tag

-s

Specifies the svctag lp as the port monitor service tag

How to Disable a listen Port Monitor Service

To disable a listen port monitor service, type:


# pmadm -d -p tcp -s lp

-d

The disable flag

-p

Specifies the pmtag tcp as the port monitor tag

-s

Specifies the svctag lp as the port monitor service tag

Troubleshooting the Network Listener: listen Port Monitor

Use the following tips to remedy listen port monitor difficulties.

  1. Begin with the network.

    The network listener is suspect when users report that they cannot print to a network printer. Begin by issuing the /usr/sbin/ping command from the print server to the client and back to determine if the network is up.

  2. Check the listen port monitor.

    Use sacadm to check that the listener is starting. Use pmadm to check that the print service is configured correctly and that the service is enabled.

  3. Check the print server's configuration.

    See Chapter 72, Troubleshooting Printing Problems, for more information.

Reference Material for Service Access Facility Administration

Files Associated With SAF

SAF uses configuration files which can be modified by using the sacadm and pmadm commands. You should not need to edit them manually.

File Name 

Description 

/etc/saf/_sysconfig

Per-system configuration script 

/etc/saf/_sactab

SAC's administrative file; contains configuration data for the port monitors that the SAC controls 

/etc/saf/pmtag

Home directory for port monitor pmtag

/etc/saf/pmtag/_config

Per-port monitor configuration script for port monitor pmtag if it exists 

/etc/saf/pmtag/_pmtab

Port monitor pmtag's administrative file; contains port monitor-specific configuration data for the services pmtag provides

/etc/saf/pmtag/svctag

Per-service configuration script for service svctag

/var/saf/log

SAC's log file 

/var/saf/pmtag

Directory for files created by pmtag, for example, log files

The /etc/saf/_sactab File

The /etc/saf/_sactab looks like this:


# VERSION=1
zsmon:ttymon::0:/usr/lib/saf/ttymon     #
tcp:listen::999:/usr/lib/saf/listen tcp #

# VERSION=1

Indicates the Service Access Facility version number. 

zsmon

tcp

Is the name of the port monitor. 

ttymon

listen

Is the type of port monitor. 

::

Indicates whether the following two flags are set: 

d, do not enable the port monitor

x, do not start the port monitor. No flags are set in this example.

0

999

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

/usr/lib/saf/ttymon

/usr/lib/saf/listen

Indicates the port monitor pathname 

The /etc/saf/pmtab/_pmtab File

The /etc/saf/pmtab/_pmtab file, such as /etc/saf/zsmon/_pmtab, looks like this:


# VERSION=1
ttya:u:root:reserved:reserved:reserved:/dev/term/a:I::/usr/bin/login::9600:ldterm,
ttcompat:ttya login\: ::tvi925:y:# 

# VERSION=1

Indicates the Service Access Facility version number. 

ttya

Indicates the service tag. 

x,u

Identifies whether the following flags are set: 

x, which means do not enable the service

u, which means create a utmp entry for the service

root

Indicates the identity assigned to the service tag. 

reserved

This field is reserved. 

reserved

This field is reserved. 

reserved

This field is reserved. 

/dev/term/a

Indicates the TTY port pathname. 

/usr/bin/login

Identifies the full pathname of the service to be invoked when a connection is received. 

:c,b,h,I,r:

Indicates whether the following flags are set 

c, sets the connect on carrier flag for the port

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

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

I, initializes the port

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

9600

Identifies the TTY label defined in /etc/ttydefs file

ldterm,ttcompat

Identifies the STREAMS modules to be pushed 

ttya login\:

Identifies the prompt to be displayed 

:y/n:

 

message

Identifies any inactive (disabled) response message 

tvi925

Identifies the terminal type. 

y

Indicates whether software carrier is set (y/n).

Service States

The sacadm command controls the states of services. The possible states are shown below.

State 

Notes 

Enabled 

Default state - When the port monitor is added, the service operates.

Disabled 

Default state - When the port monitor is removed, the service stops.

To determine the state of any particular service, use the following:


# pmadm -l -p portmon_name -s svctag

Port Monitor States

The sacadm command controls the states of ttymon and listen port monitors. The possible states are shown below.

State 

Notes 

Started

Default state - When the port monitor is added, it is automatically started.

Enabled

Default state - When the port monitor is added, it is automatically ready to accept requests for service.

Stopped

Default state - When the port monitor is removed, it is automatically stopped.

Disabled

Default state - When the port monitor is removed, it automatically continues existing services and refuses to add new services.

Starting

Intermediate state - The port monitor is in the process of starting.

Stopping

Intermediate state - The port monitor has been manually terminated, but it has not completed its shutdown procedure. It is on the way to becoming stopped.

Notrunning

Inactive state - The port monitor has been killed. All ports previously monitored are inaccessible. An external user cannot tell whether a port is disabled or notrunning.

Failed

Inactive state - The port monitor is unable to start and remain running.

To determine the state of any particular port monitor, use the following:


# sacadm -l -p portmon_name

Port States

Ports may be enabled or disabled depending on the state of the port monitor that controls them.

State 

Notes 

Serial (ttymon) Port States

 

Enabled

The ttymon port monitor sends a prompt message to the port and provides login service to it.

 

Disabled

Default state of all ports if ttymon is killed or disabled. If you specify this state, ttymon will send out the disabled message when it receives a connection request.

Network (listen) Port States

 

Enabled

The listen port monitor scans the network for service requests and invokes services in response to those requests.

 

Disabled

If the listen port monitor is killed or disabled, the ports it controls are automatically disabled. If you specify this state, listen will send out the Disabled message when it receives a connection request.