Previous Table of Contents Next


Service Access Controller

The sac daemon controls the overall state of arbitrary processes that are started in response to connection requests. The sac daemon receives all of the requests to enable, disable, start, or stop port monitors and takes the appropriate action. If port monitor processes are terminated, sac is responsible for restarting them.

The sac is started from this entry in the /etc/inittab file:

sc:234:respawn:/usr/lib/saf/sac -t 3ØØ


NOTE:  The rc scripts do not start or control the sac process.

When sac is started, it first customizes its own environment by reading the /etc/saf/_sysconfig configuration file. Each system has one /etc/saf/_sysconfig file. When the sac process is started, this file is interpreted and used for all of the port monitors on the system. Modifications to the environment from this file are inherited by all of sac's child processes.

Then sac starts all of the designated port monitors using information from the /etc/saf/_sactab file. For each port monitor to be started, sac forks a port monitor child process. The ttymon port monitor reads its configuration information from the /etc/saf/pmtag/_pmtab port monitor table. If configured, the listen port monitor reads its configuration information from the /etc/saf/ pmtag/_pmtab file. You set the value of the pmtag variable when you use the sacadm command to create the port monitor. The default name for the ttymon port monitor for serial ports is zsmon; the default name for the listen port monitor is tcp.

Once the port monitors are running, sac polls them periodically for status information. If a port monitor that should be running has stopped, sac restarts it if a non-zero restart count was specified using the -n count option to the sacadm command when the port monitor was created.

Port Monitors

Port monitors monitor a set of homogeneous incoming requests on a system port, detect incoming requests, and connect them to the appropriate service process. As already mentioned, Solaris 2.x system software provides a TTY port monitor daemon named ttymon, and a network port monitor daemon named listen.

To find out which port monitors are running and to show their status, type sacadm -l and press Return.

oak% /usr/sbin/sacadm -l
PMTAG          PMTYPE         FLGS RCNT STATUS     COMMAND
zsmon          ttymon         -    Ø    ENABLED    /usr/lib/saf/ttymon #
oak%

In this example, only the ttymon monitor, which is identified by the default port monitor tag of zsmon, is started, and the status is ENABLED. Table 9-1 describes the fields shown in the output of the sacadm -l command.

Table 9-1 Fields in the sacadm -l Output

Field Description
PMTAG A unique tag that identifies a particular port monitor. The system administrator assigns the name of the port monitor. The pmtag is used by the sac to identify the port monitor for all of the administration. Use the default ttymon pmtag, zsmon, for ttymon ports A and B; use the listen pmtag, tcp, for listen ports in the United States. PMTAG can contain up to 14 alphanumeric characters.
The default ttymon pmtag, zsmon, was chosen because SPARCstation serial port chips are made by Zilog. In practice, a server may have hundreds of serial ports. If so, SunSoft recommends creating one port monitor for each serial port device. For example, consider a server that has two built-in serial ports and two add-in serial port boards, known as asynchronous line multiplexers, or ALMs. You could set up three port monitors and name them zsmon, alm1, and alm1. The service tag, svctag, could be named a and b for zsmon, and 0 -7 for alm1 and alm2. (An alm usually has eight ports, numbered 0 through 7.)
The default listen pmtag, tcp, was chosen because the device associated with it is the network. In the United States, the network is usually tcp. In Europe, the network is usually X.25. Always create the pmtag listen variable in such a way that it describes the network.
PMTYPE The type of the port monitor: ttymon or listen.
FLGS If no flag is specified, the port monitor is started and enabled. The d flag specifies that when the port monitor is started, it is not enabled. The x flag specifies that the port monitor is not to be started.
RCNT Retry count specifies the number of times a port monitor can fail before its state is changed to FAILED. If no count is specified, the field is set to 0 and the port monitor is not restarted if it fails.
STATUS The status of activity for the port monitor. Possible states are STARTING, ENABLED, DISABLED, STOPPING, NOTRUNNING, and FAILED. The FAILED message is displayed if the SAC cannot start the port monitor after the number of tries specified by RCNT.
COMMAND The complete pathname of the command that starts the port monitor, which is followed by a # and any comment that was entered when the port monitor was configured.


Previous Table of Contents Next