Sun Cluster Data Services Developer's Guide for Solaris OS

Declaring the PMF_TAG and SYSLOG_TAG Variables

All the method scripts, except Validate, use the pmfadm command to start or to stop either the data service or the monitor, and to pass the name of the resource. Each script defines a variable, PMF_TAG, that can be passed to the pmfadm command to identify either the data service or the monitor.

Likewise, each method script uses the logger command to log messages in the system log. Each script defines a variable, SYSLOG_TAG, that can be passed to logger with the -t option to identify the resource type, resource name, and resource group of the resource for which the message is being logged.

All methods define SYSLOG_TAG in the same way, as shown in the following sample code. The dns_probe, dns_svc_start, dns_svc_stop, and dns_monitor_check methods define PMF_TAG as follows (the use of pmfadm and logger is from the dns_svc_stop method).

#########################################################################
# MAIN
#########################################################################

PMF_TAG=$RESOURCE_NAME.named

SYSLOG_TAG=$RESOURCETYPE_NAME,$RESOURCEGROUP_NAME,$RESOURCE_NAME

   # Send a SIGTERM signal to the data service and wait for 80% of the
   # total timeout value.
   pmfadm -s $PMF_TAG.named -w $SMOOTH_TIMEOUT TERM
   if [ $? -ne 0 ]; then
      logger -p ${SYSLOG_FACILITY}.info \
          -t [$SYSLOG_TAG] \
          “${ARGV0} Failed to stop HA-DNS with SIGTERM; Retry with \
           SIGKILL”

The dns_monitor_start, dns_monitor_stop, and dns_update methods define PMF_TAG as follows (the use of pmfadm is from the dns_monitor_stop method):

#####################################################################
# MAIN
#####################################################################

PMF_TAG=$RESOURCE_NAME.monitor
SYSLOG_TAG=$RESOURCETYPE_NAME,$RESOURCEGROUP_NAME,$RESOURCE_NAME
...
# See if the monitor is running, and if so, kill it. 
if pmfadm -q $PMF_TAG.monitor; then
   pmfadm -s $PMF_TAG.monitor KILL