[Next] [Previous] [Up] [Top] [Contents]

CHAPTER 17 Service Access Facility

17.5 Setting Up a Terminal


To configure an ASCII terminal for login service perform the following steps.

1. Connect the terminal to the system. Here we'll assume that it is serial port A.

Issue the sacadm command to add a ttymon port monitor named zsmon:
# sacadm -a -p zsmon -t ttymon -c /usr/lib/saf/ttymon -v 'ttyadm -V'
where
-a is the flag to add the port
-p specifies the pmtag zsmon as the port monitor tag
-t specifies the type of port monitor as ttymon
-c defines the command string to start the port monitor
-v specifies the version number of the port monitor (provided by ttyadm -V)
You can use the sacadm program to report the status for a port monitor:
# sacadm -l
PMTAG PMTYPE FLGS RCNT STATUS COMMAND
zsmon ttymon - 0 ENABLED /usr/lib/saf/ttymon

Should you need to you can remove any existing service for ttya do the following:
# pmadm -r -p zsmon -s ttya
where
-r indicates to remove a service from the port monitors administrative file
-p specifies the pmtag zsmon associated with the port monitor
-s specifies the service tag

Use pmadm to associate the port monitor with the new service:
# pmadm -a -p zsmon -s a -i root -fu -v 'ttyadm -V' -m "'ttyadm -l 9600 -d /dev/term/a -i 'terminal disabled' -s /usr/bin/login -T tvi925 -S y'"
where for pmadm we have the options
-a indicates to add a service to the port monitor administrative file
-i is the identity assigned to the service tag when it's started (must be in
/etc/passwd)
-f specifies one or both of the two flags:
x do not enable the service through the port monitor
u create a utmp entry for the service
-v specifies the version number (using ttyadm for ttymon, nlsadmin for listen)
-m specifies the part of the port monitor administrative file entry for this service,
and for ttyadm we have the options
-l specifies the label in the /etc/ttydefs file to use as the starting point for the baud rate
-d specifies the full path name of the device file for the TTY port
-i specifies the inactive (disabled) message to sent to the port when it is disabled
-s specifies the service to be invoked when a connection request is received by the port
-T sets the default terminal type
-S sets the software carrier value
y turns software carrier on
n turns software carrier off

This puts an entry in /etc/saf/zsmon/_pmtab and enables the terminal. You can read this file with:

# pmadm -l
PMTAG PMTYPE SVCTAG FLGS ID <PMSPECIFIC>
zsmon ttymon ttya u root /dev/term/a I - /usr/bin/login - 9600 ldterm,ttcompat ttya login: - tvi925 y #

The actual entry in the _pmtab file is:

# VERSION=1

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

Rather than typing in the sacadm and pmadm commands on the command line as done above, with all the possibilities for error, you can edit their control files and add your entries. To have these take effect you execute the sacadm command with the -x option, telling it to reread it's database files for the -p pmtag specified, e.g.:

1. Create /etc/saf/_sactab:
# cat <<EOF_SACTAB > /etc/saf/_sactab
# VERSION=1
zsmon:ttymon::0:/usr/lib/saf/ttymon: # TTY Port Monitor
EOF_SACTAB

Make a directory for the zsmon port monitor
# mkdir /etc/saf/zsmon

Change to the new directory and create the _pmtab file
# cd /etc/saf/zsmon
# cat <<EOF_PMTAB > _pmtab

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

Create the log directory and file
# mkdir /var/saf/zsmon
# touch /var/saf/zsmon/log

Re-initialize SAF
# sacadm -x -p zsmon

17.5.1 - TTY Monitor Control Commands
17.5.2 - Removing a TTY Monitor
17.5.3 - Adding Services to a TTY Monitor
17.5.4 - Disable/Enable a TTY Service

Unix System Administration - 8 AUG 1996
[Next] [Previous] [Up] [Top] [Contents]