The System Resource Controller (SRC) supports three communication types: signals, sockets, and interprocess communication (IPC) message queues. The communication type chosen determines to what degree the subsystem takes advantage of SRC functions.
Note: All subsystems, regardless of the communication type specified in the subsystem environment object, must be capable of supporting limited signals communication. A signal-catcher routine must be defined to handle SIGTERM (stop cancel) signals. The SIGTERM signal indicates a subsystem should clean up all resources and terminate.
To learn more about SRC communication types, see:
The Communications Between the srcmstr Daemon and Subsystems table summarizes communication type actions associated with SRC functions.
Communications Between the srcmstr Daemon and Subsystems | ||
Function | Using IPC or Sockets | Using Signals |
start | ||
subsystem | SRC forks and execs to create subsystem process. | SRC forks and execs to create subsystem process. |
subserver | Uses IPC message queue or socket to send request to subsystem. | Not supported |
stop normal | ||
subsystem | Uses IPC message queue or socket to send request to subsystem. | Sends SIGNORM to the subsystem. |
subserver | Uses IPC message queue or socket to send request to subsystem. | Not supported. |
stop forced | ||
subsystem | Uses IPC message queue or socket to send request to subsystem. | Sends SIGFORCE to the subsystem. |
subserver | Uses IPC message queue or socket to send request to subsystem. | Not supported. |
stop cancel | ||
subsystem | Sends SIGTERM followed by SIGKILL to the process group of the subsystem. | Sends SIGTERM followed by SIGKILL to the process group of the subsystem. |
status short | ||
subsystem | Implemented by SRC (no subsystem request). | Implemented by SRC (no subsystem request). |
subserver | Uses IPC message queue or socket to send request to subsystem. | Not supported. |
status long | ||
subsystem | Uses IPC message queue or socket to send request to subsystem. | Not supported. |
subserver | Uses IPC message queue or socket to send request to subsystem. | Not supported. |
traceon/traceoff | ||
subsystem | Uses IPC message queue or socket to send request to subsystem. | Not supported. |
subserver | Uses IPC message queue or socket to send request to subsystem. | Not supported. |
refresh | ||
subsystem | Uses IPC message queue or socket to send request to subsystem. | Not supported. |
subserver | Uses IPC message queue or socket to send request to subsystem. | Not supported. |
notify | ||
subsystem | Implemented by subsystem-provided method. | Implemented by subsystem-provided method. |
The most basic type of communication between a subsystem and the srcmstr daemon is accomplished with signals. Because signals constitute a one-way communication scheme, the only SRC command that signals subsystems recognize is a stop request. Subsystems using signals do not recognize long status, refresh, or trace requests. Nor do they recognize subservers.
Signals subsystems must implement a signal-catcher routine, such as the sigaction, sigvec, or signal subroutine, to handle SIGNORM and SIGFORCE requests.
Signals subsystems are specified in the SRC subsystem object class by issuing a mkssys -Snf command string or by using the defssys and addssys subroutines.
Increasingly, the communication option of choice for subsystem programmers is sockets. This is also the default communication type for the srcmstr daemon. See the "Sockets Overview" in AIX Communications Programming Concepts for more information.
The srcmstr daemon uses sockets to receive work requests from a command process. When this communication type is chosen, the srcmstr daemon creates the subsystem socket in which the subsystem will receive srcmstr daemon requests. UNIX sockets (AF_UNIX) are created for local subsystems. Internet sockets (AF_INET) are created for remote subsystems. The following steps describe the command processing sequence:
The file access permissions and addresses of the sockets used by the srcmstr daemon are maintained in the /dev/SRC and /dev/.SRC-unix temporary directories. Though displayable using the ls command, the information contained in these directories is for internal SRC use only.
Message queues and sockets offer equal subsystem functionality.
The Sockets Subsystem Communication Model for SRC figure depicts this process. See "Programming Subsystem Communication with the SRC" for more information.
IPC message queue functionality is similar to sockets functionality. Both communication types support a full-function SRC environment.
When the communication type is IPC message queue, the srcmstr daemon uses sockets to receive work requests from a command process, then uses an IPC message queue in which the subsystem receives SRC messages. The message queue is created when the subsystem is started, and is used thereafter. Message queue subsystems use the following command-processing sequence to communicate with the srcmstr daemon:
The IPC Message Queue Subsystem Communication Model for SRC figure depicts this process. See "Message Queue Kernel Services" in AIX Kernel Extensions and Device Support Programming Concepts for additional information on this communication type. See "Programming Subsystem Communication with the SRC" for the next step in establishing communication with the srcmstr daemon.
System Resource Controller (SRC) Overview for Programmers.
Programming Subsystem Communication with the SRC
Defining Your Subsystem to the SRC.
The spc.h file.
The msgrcv subroutine, signal subroutine, socket subroutine, srcrrqs subroutine, srcsrpy subroutine.