Sun Cluster Data Services Developer's Guide for Solaris OS

Guidelines for Implementing a Fini Method

The Fini method that you implement needs to determine whether to perform only cleanup of node-specific configuration or cleanup of both node-specific and cluster-wide configuration.

When a resource becomes unmanaged on only a particular node or zone, the Fini method can clean up local, node-specific configuration. However, the Fini method must not clean up global, cluster-wide configuration, because the resource remains managed on other nodes. If the resource becomes unmanaged cluster-wide, the Fini method can perform cleanup of both node-specific and global configuration. Your Fini method code can distinguish these two cases by determining whether the resource group's node list contains the local node or zone on which your Fini method is executing.

If the local node or zone appears in the resource group's node list, the resource is being deleted or is moving to an unmanaged state. The resource is no longer active on any node or zone. In this case, your Fini method needs to clean up any node-specific configuration on the local node as well as cluster-wide configuration.

If the local node or zone does not appear in the resource group's node list, your Fini method can clean up node-specific configuration on the local node or zone. However, your Fini method must not clean up cluster-wide configuration. In this case, the resource remains active on other nodes or zones.

You must also code the Fini method so that it is idempotent. In other words, even if the Fini method has cleaned up a resource during a previous execution, subsequent calls to the Fini method exit successfully.