Hitachi

For Linux(R) (x86) Systems HA Monitor Cluster Software


6.15.2 How to create a program restart command

For a program restart command, you must specify a shell that codes processing for starting the UAP after the UAP has terminated.

Specify in the shell the operating environment required for restarting the program. In RHEL7 or a later version, you can specify environment variables in the Unit settings file. However, the Unit settings file is overwritten when an overwrite installation of HA Monitor is performed. Therefore, we recommend that you specify an operating environment (environment variables) within the shell.

For details about the environment variables that are inherited when the program restart command is executed, see (2) How to create a server termination command in 6.13.2 Creating a server termination command.

To acquire core files for investigation in the event of a UAP failure, add ulimit -c unlimited before the process for starting the UAP. The kernel parameter's default setting does not collect core files.

For the processing for terminating the UAP, if the UAP creates processes, also specify the processing to terminate those processes. Because HA Monitor waits for completion of the shell specified in the program restart command, make sure that the shell returns control after the UAP startup processing has been performed.

To use a program restart command to restart a UAP that issues APIs, specify the program name in a UAP environment variable. For details about the UAP environment variables, see 6.16.2 Specifying UAP environment variables.

Specify the created program restart command in the restartcommand operand in the monitor-mode program environment definition. You can also specify in the restart_timeout operand in the monitor-mode program environment definition a timeout value before the program restart command is terminated since it was started and before the hamon_patrolstart function is issued.

HA Monitor checks the return value of the program restart command specified in the restartcommand operand. The following explains HA Monitor processing depending on the return value.