HPlogo DTC Device File Access Utilities and Telnet Port Identification: HP 9000 Computers > Chapter 4 Defining and Executing DDFA Parameters

Managing Outgoing Dedicated Ports With dpp and ocd

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

Each outgoing dedicated port is managed by an outgoing connection daemon, ocd.

Once all outgoing dedicated ports have been defined in the dedicated port file, /etc/ddfa/dp, the DDFA Utilities can be started with the dpp command (see next paragraph). The result of this step will be that one outgoing connection daemon (ocd) process will be running for each valid outgoing entry defined in the dedicated port file. The dedicated port parser, dpp, scans the dedicated port file and spawns an ocd process for each outgoing entry in the file.

The dpp program can be run manually, or to start it up automatically at system bootup, set the system variable DDFA (to 1) in the /etc/rc.config.d/netdaemons file.

The syntax for dpp is:

dpp <dp_file> [-l <logfile>] [-c] [-k] [-p<ocd>]
dp_file

Name of the dedicated port configuration file to use. Typically, the dp file is /etc/ddfa/dp.

-l logfile

Name of the log file to which dpp should log errors. If not specified, the error messages are logged to standard error (stderr) screen.

-c

Parses the dp file and logs all bad entries without executing dpp fully. It is useful to debug the dp file before starting the ocds. The -p option is ignored if -c is used.

-k

Removes each device file from the /dev/telnet directory which is also in the dp file. Then, dpp spawns an ocd daemon for each valid entry in the dp file. Refer also to "Using dpp" later in this chapter.

The ocd daemon normally creates and removes the pty device files associated with server ports. However, if the ocd process is killed improperly, a device file may remain. If the system is rebooted, the -k option may be specified to delete any remaining device files and to restart all the dp file entries correctly.

-p <ocd>

The default path for ocd is /usr/sbin/ocd. If the path is different, it must be specified with the -p option. The ocd must have execute permission set.

Full path names must be specified for the dp file and log files.

The dpp command performs the following actions for each outgoing dedicated port defined in the dp file:

  • Checks the validity of the device file name.

  • Runs an ocd process on the pty which was created. The ocd process manages the outgoing Telnet connection to the server port, establishing it when the pty file is opened.

    In addition, ocd maps the predefined pseudonyms to the ptys in the pty pool (in /dev/pty and /dev/ptym). Therefore, it is important to ensure that the number of ptys defined in the system pool in the uxgen file is sufficient. Consult the insf command man page for more information on creating ptys for the system pool.

After running dpp, you can check to see that the ocd processes are running by using the HP-UX ps -ef command from the Shell prompt as follows:

ps -ef | grep ocd

After the ocd processes have been started, accessing the pseudonym (opening the slave side of the pty) results in access to the associated device.

Preparing to Use dpp

Dpp cannot execute an ocd process for an entry in the dp file if the pty device file specified in that entry already exists. The existence of such a file could indicate that an ocd process is already running for that entry, or that another application is already using the device file. Therefore, it is important to kill all running ocd daemons properly and remove the device files they use before using dpp to start or restart the ocd daemons.

Stopping the DDFA Utilities involves two steps.

  • First, the ocd processes must be killed.

  • Second, the device files that the ocd processes use must be deleted from the file system.

Sending a signal 15 to an ocd process causes both of these things to happen automatically. For example,

kill -15 <ocd pid>

The pid is the process identification number of the ocd daemon. It can be found by executing ps -ef.

The kill -9 command also kills the ocd process, but does not remove the device file. If the kill -9 command is used, you will have to remove the device file manually from the /dev/telnet directory using the HP-UX rm command. Therefore, the kill -15 command is more complete.

Using dpp to Kill and Restart ocds

Running the dpp program with the -k option causes dpp to kill all ocd processes for ports defined in the dp file and remove their associated pty device files. In addition, it restarts ocd processes.

Using dpp -k at system startup time is an excellent way to start up the ocd processes. Then all ocd processes defined in the dp file are started properly and old files removed even if the ocd processes were previously aborted. The syntax is:

/usr/sbin/dpp   /etc/ddfa/dp -k

Using dpp to Start Up New ocds

After adding entries for outgoing dedicated ports to the dp file, run dpp without the -k option. The -k option causes ocd processes for existing entries to be killed. Aborting the existing ocd processes disrupts service to any current active sessions. To start ocd processes for the newly added entries to the dp file, execute dpp without the -k option. The syntax is:

/usr/sbin/dpp   /etc/ddfa/dp

Ocd processes will be started only for the newly added entries. Dpp will ignore entries that already exist.

Using dpp to Remove Existing ocds

If you remove outgoing entries from the dp file by running dpp, be sure to kill their associated ocd processes using the kill -15 command. This command will ensure that the ocd processes and their associated device files are removed properly. The syntax is:

kill -15 <ocd pid>

The <ocd pid> is the process identification number of the ocd daemon whose entry was removed from the dp file.

© 1995 Hewlett-Packard Development Company, L.P.