Sun Cluster 3.1 10/03 Data Services Developer's Guide

Control and Initialization Callback Methods

The primary control and initialization callback methods start and stop a resource. Other methods execute initialization and termination code on a resource.

Start

This required method is invoked on a cluster node when the resource group containing the resource is brought online on that node. This method activates the resource on that node.

A Start method should not exit until the resource it activates has been started and is available on the local node. Therefore, before exiting, the Start method should poll the resource to determine that it has started. In addition, you should set a sufficiently long time-out value for this method. For example, certain resources, such as database daemons, take more time to start, and thus require that the method have a longer timeout value.

The way in which the RGM responds to failure of the Start method depends on the setting of the Failover_mode property.

The START_TIMEOUT property in the resource type registration file sets the time-out value for a resource's Start method.

Stop

This required method is invoked on a cluster node when the resource group containing the resource is brought offline on that node. This method deactivates the resource if it is active.

A Stop method should not exit until the resource it controls has completely stopped all its activity on the local node and has closed all file descriptors. Otherwise, because the RGM assumes the resource has stopped, when in fact it is still active, data corruption can result. The safest way to avoid data corruption is to terminate all processes on the local node related to the resource.

Before exiting, the Stop method should poll the resource to determine that it has stopped. In addition, you should set a sufficiently long time-out value for this method. For example, certain resources, such as database daemons, take more time to stop, and thus require that the method have a longer time-out value.

The way in which the RGM responds to failure of the Stop method depends on the setting of the Failover_mode property (see Table A–2).

The STOP_TIMEOUT property in the resource type registration file sets the time-out value for a resource's Stop method.

Init

This optional method is invoked to perform a one-time initialization of the resource when the resource becomes managed—either when the resource group it is in is switched from an unmanaged to a managed state, or when the resource is created in a resource group that is already managed. The method is called on nodes determined by the Init_nodes resource property.

Fini

This optional method is invoked to clean up after the resource when the resource becomes unmanaged—either when the resource group it is in is switched to an unmanaged state or when the resource is deleted from a managed resource group. The method is called on nodes determined by the Init_nodes resource property.

Boot

This optional method, similar to Init, is invoked to initialize the resource on nodes that join the cluster after the resource group containing the resource has already been put under the management of the RGM. The method is invoked on nodes determined by the Init_nodes resource property. The Boot method is called when the node joins or rejoins the cluster as the result of being booted or rebooted.


Note –

Failure of the Init, Fini, or Boot methods causes the syslog() function to generate an error message but does not otherwise affect RGM management of the resource.