The user must create commands for resource managers to be monitored and define them in the RM-to-be-monitored definition. Following are the notes on creating these commands:
(a) Startup command
The startup command must be created so that the following conditions are satisfied:
- When the startup command is completed, the termination command can be executed.
- When the startup command is completed, all processes to be monitored have been activated.
- When the startup command is completed, the resource manager can monitor processes.
- The startup command terminates normally if termination code exit() is 0, and abnormally if the code is not 0.
While awaiting for the startup command to terminate, the RMM service assumes normal termination when the termination code is 0" or abnormal termination when the code is not 0.
If the startup command terminates normally but if system fails to obtain the process ID of the process to be monitored, the startup process will be unsuccessful. OpenTP1 checks the time until the startup command terminates; if the maximum check-time is exceeded, the startup process will also be unsuccessful.
(b) Termination command
The termination command must be created so that the following conditions are satisfied:
- When the termination command is completed, the startup command can be executed.
- When the termination command is completed, all processes to be monitored have been terminated.
- When the termination command is completed, the system resources for all processes to be monitored have been released.
- The termination command terminates normally if termination code exit() is 0, and abnormally if the code is not 0.
While awaiting for the termination command to complete, the RMM service assumes normal termination when the termination code is 0 or abnormal termination when the code is not 0.
If the termination command terminates normally but if any process to be monitored remains, the termination process will be unsuccessful. OpenTP1 checks the time until the termination command terminates; if the maximum check-time is exceeded, the termination process will also be unsuccessful.
(c) Forced termination command
The forced termination command must be created so that the following conditions are satisfied:
- When the forced termination command is completed, the startup command can be executed.
- When the forced termination command is completed, the system resources for all processes to be monitored have been released.
- The forced termination command terminates normally if termination code exit() is 0, and abnormally if the code is not 0.
The forced termination command can be executed even when there are no processes to be monitored.
While awaiting for the forced termination command to complete, the RMM service assumes normal termination when the termination code is 0 or abnormal termination when the code is not 0.
If the forced termination command terminates normally but if any process to be monitored remains, the forced termination process will be unsuccessful. OpenTP1 checks the time until the forced termination command terminates; if the maximum check-time is exceeded, the forced termination process will also be unsuccessful.
(d) Process ID acquisition command
- Creation of process ID acquisition command
The process ID acquisition command must be created so that the following conditions are satisfied:
RMM provides rmmoraid as a model process ID acquisition command. This command has been created so that the following conditions are satisfied:
- The process ID of every process to be monitored is output to the standard output.
- The process ID is output in the format shown in Figure 6-1.
- If the process name of a process is described in the command, its process ID is acquired by using /bin/ps.
- The exit() termination code has the following meaning:
0
- All process IDs have been acquired.
1
- Not all process IDs have been acquired.
2
- No process IDs have been acquired.
- Restart of the resource manager to be monitored
When the resource manager to be monitored has a facility that performs automatic full recovery at an error, the RMM service does not need to restart the resource manager. If an error occurs, the facility of the resource manager automatically performs full recovery. First output 0 as the standard output of the process ID acquisition command. This prohibits the RMM service from performing full recovery of the resource manager to be monitored.
To perform full recovery using the facility of the resource manager to be monitored, satisfy the following conditions:
- There is only one process to be monitored.
- The termination code of exit() is 0 or 2.
If the exit() process ID acquisition command terminates with a termination code of 0, the RMM service assumes it to be completion of the automatic full recovery of the resource manager to be monitored.
The following figure shows the format of the standard output of the process ID acquisition command.
Figure 6-2 Format of standard output of process ID acquisition command
(e) Other commands
- The RMM service provides these four commands that can be used for ORACLE definitions:
- Startup command
- $DCDIR/etc/RMmonitor/rmmorast
- Termination command
- $DCDIR/etc/RMmonitor/rmmorasp
- Forced termination command
- $DCDIR/etc/RMmonitor/rmmoraab
- Process ID acquisition command
- $DCDIR/etc/RMmonitor/rmmoraid
All of these commands are implemented in a shell script using Bourne shells. # CHANGEABLE is written in each changeable area; the user can change the description in such an area according to an appropriate environment.
- The RMM service provides these four commands that can be used for the HiRDB (single mode) definitions:
- Startup command
- $DCDIR/etc/RMmonitor/rmmhirst
- Termination command
- $DCDIR/etc/RMmonitor/rmmhirsp
- Forced termination command
- $DCDIR/etc/RMmonitor/rmmhirab
- Process ID acquisition command
- $DCDIR/etc/RMmonitor/rmmhirid
All of these commands are implemented in a shell script using Bourne shells. "#CHANGEABLE" is written in each changeable area; the user can change the description in such an area according to an appropriate environment.
- HiRDB has a facility that performs automatic full recovery at an error. First output 0 as the standard output of the process ID acquisition command. HiRDB performs full recovery at an error.
- The shell script created is forked & executed by the RMM service and is different in seven points from command execution from a normal shell:
- The following environment variables are available:
DCSVNAME
- _rmm (unchangeable)
DCDIR
- Set uniquely for OpenTP1 (unchangeable)
DCCONFPATH
- Set uniquely for OpenTP1 (unchangeable)
LANG
- Set uniquely for OpenTP1 (changeable)
TZ
- Default value for OS (changeable)
PATH
- Follows the specification of prcsvpath in the process service definition (changeable)
- The current directory is $DCDIR/tmp/home/_rmm.xxx (xxx: process ID of RMM service).
- The standard input, standard output or standard error output of a process is a console.
- The user ID and group ID follow the RM-to-be-monitored definition.
- There is no control terminal.
- umask is 000.
- Any operations at signal reception is an OS default.
All of the above conventions for the variables affect the commands to be used in the shell script and the processes to be activated. The user can change the setting of a variable only in the shell script or a user-provided command.
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.