Sun Cluster 3.0 12/01 Data Services Developer's Guide

The STOP Method

The STOP callback method of a resource type implementation is called by the RGM on a cluster node to stop the application. The callback semantics for the STOP method demands that

The DSDL utility scds_pmf_stop() should suffice for most applications as it first attempts to softly (via SIGTERM) stop the application (it assumes that it was started under PMF via scds_pmf_start()) followed by a delivering a SIGKILL to the process. See "PMF Functions " for details about this utility.

Following the model of the code we have been using so far, assuming that the application specific routine to stop the application is called svc_stop() (whether the implementation of svc_stop() uses the scds_pmf_stop() is besides the point here, and would depend upon whether or not the application was started under PMF via the START method)) the STOP method can be implemented as

if (scds_initialize(&handle, argc, argv)!= SCHA_ERR_NOERR)
{
	return (1);	/* Initialization Error */
}
return (svc_stop(handle));

The svc_validate() method is not used in the implementation of the STOP method, because even if the system currently has a problem, the STOP method should attempt to STOP the application on this node.