Hitachi

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


6.14.1 Creating a command that is executed when the standby server starts

By creating a command that is to be executed when the standby server starts, you can execute process startup and other desired processing when the standby server starts.

This subsection describes how to create a command that is to be executed when the standby server starts and when the created command is called.

Organization of this subsection

(1) Timing at which the command to be executed when the standby server starts is called

If you create the command, HA Monitor executes it with the superuser permissions.

The command is called after the shared resources are disconnected in the following cases:

(2) How to create a command to be executed when the standby server starts

Create a command that is to be executed when the standby server starts so that startup of monitoring-target programs and other processing are executed by that command.

Specify an operating environment needed to start the program within the shell. 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 standby server start command is executed, see (2) How to create a server start command in 6.13.1 Creating a server start command.

If you have created a command, specify it for the sby_actcommand operand in the server environment definition. HA Monitor evaluates the return value from the command specified for the sby_actcommand operand in the server environment definition. The following describes the HA Monitor processing that depends on the return value.

If the return value is 0:

HA Monitor assumes that the command processing succeeded and completes startup of the standby server.

If the return value is other than 0:

HA Monitor assumes that the command processing failed and stops startup of the standby server. If an attempt was made to restart the standby server, the attempt has failed. If restart fails, HA Monitor executes the command specified for the sby_termcommand operand in the server environment definition. For details about the handling of a restart failure, see 7.5.2 Handling server restart errors.

You can use the sby_start_timeout operand in the server environment definition to specify the timeout value for the command.