The Sun Cluster framework uses a callback mechanism to provide communication between a data service and the RGM. The framework defines a set of callback methods, including their arguments and return values, and the circumstances under which the RGM calls each method.
You create a data service by coding a set of individual callback methods and implementing each method as a control program that the RGM can call. That is, the data service does not consist of a single executable, but a number of executable scripts (ksh) or binaries (C), each of which the RGM can call directly.
Callback methods are registered with the RGM through the RTR file. In the RTR file you identify the program for each method that you have implemented for the data service. When a cluster administrator registers the data service on a cluster, the RGM reads the RTR file, which provides the identity of the callback programs and other information.
The only required callback methods for a resource type are a start method (Start or Prenet_start) and a stop method (Stop or Postnet_stop).
The callback methods can be grouped into the following categories:
Control and initialization methods
The Start and Stop methods start and stop resources in a group that is being brought online or offline.
The Init, Fini, and Boot methods execute initialization and termination code on resources.
Administrative support methods
The Validate method verifies properties that are set by administrative action.
The Update method updates the property settings of an online resource.
Net-relative methods
Prenet_start and Postnet_stop perform special startup or shutdown operations before network addresses in the same resource group are configured to go up or after they are configured to go down.
Monitor control methods
Monitor_start and Monitor_stop start or stop the monitor for a resource.
Monitor_check assesses the reliability of a node before a resource group is moved to the node.
See Chapter 3, Resource Management API Reference and the rt_callbacks(1HA) man page for more information about the callback methods. Also see Chapter 5, Sample Data Service and Chapter 8, Sample DSDL Resource Type Implementation for callback methods in sample data services.