IBM Books

Administration Guide


Creating a special subsystem

Read this section if you write your own special subsystem and want the cshutdown command to notify the subsystem when nodes are being halted or rebooted. The SP system has no predefined special subsystems.

The special subsystem interface is a user-provided command that is invoked during the subsystem phase of SP system shutdown processing. The command is defined in the /etc/subsysSeq file and must reside on all nodes of the SP system; the cshutdown command invokes the subsystem interface on a randomly selected node in the current system partition.

The following sections define the interface to a special subsystem. This interface consists of:

Note:
The special subsystem interface is called after nonroot processes are killed. If you want your subsystem to take advantage of shutdown notification, some part of it must be running as root.

Input to the special subsystem interface

The cshutdown command invokes the special subsystem interface with the following standard parameters:

-r  or  -h
Indicates whether the cshutdown command is halting (-h) or restarting (-r) the target nodes.

-b IPaddress
Specifies, in dotted decimal form, the IP address of the calling program, in this case, the control workstation.

-f /var/adm/SPlogs/cs/cshut.MMDDhhmmss.pid
Specifies the log file to which the subsystem interface program should append a record of status and activities.

target_nodes
The list of node numbers of the target nodes specified on the cshutdown command line. The numbers are passed at the end of the argument list.

For example, if the /etc/subsysSeq file contains the following line:

ssgroupA: /full/pathname/subsystemA

and this cshutdown command is issued on the control workstation whose IP address is 129.40.64.70:

cshutdown -h -N 1 2 3

the cshutdown command issues the following command on a randomly selected node during the subsystem phase of shutdown processing:

/full/pathname/subsystemA -h -b 129.40.64.70 \
                          -f /var/adm/SPlogs/cs/cshut.time.pid \
                          1 2 3

What your special subsystem must do

In addition to any processing specific to the subsystem, the special subsystem must call the csLogger command to record its activities. Your program must call csLogger with the following required parameters:

-b IPaddress
Specifies, in dotted decimal form, the IP address of the calling program, in this case, the control workstation.

-f /var/adm/SPlogs/cs/cshut.MMDDhhmmss.pid
Specifies the log file to which the subsystem interface program should append a log of status and activities.

logString
Specifies a string that will be appended to the specified log file. This is the last parameter.

Using the example previously started, if the cshutdown command calls your program with this command:

/full/pathname/subsystemA -h -b 129.40.64.70 \
                          -f /var/adm/SPlogs/cs/cshut.time.pid \
                          1 2 3

then the /full/pathname/subsystemA command could log the start and completion of subsystem shutdown by making calls similar to these:

csLogger -b 129.40.64.70 \
         -f /var/adm/SPlogs/cs/cshut.time.pid \
         subsystemA:  initiating shutdown at 15:43.55 on 1 Apr 99.
 
csLogger -b 129.40.64.70 \
         -f /var/adm/SPlogs/cs/cshut.time.pid \
         subsystemA:  shutdown complete at 15:46.23 on 1 Apr 99.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]