Oracle® Solaris Cluster Data Service for Oracle Solaris Zones Guide

Exit Print View

Updated: July 2014, E39657-01

Writing a Service Probe for the Zone SMF Resource

The zone SMF resource provides the ability to enable, disable, and probe an SMF service within a zone that is of brand type solaris, solaris10 or solaris-kz . The zone SMF resource depends on the zone boot resource. Probing the SMF service is performed by running a command or script against the SMF service. The SMF service and probe command or script names are passed to the zone SMF resource when the resource is registered. The probe command or script must meet the following requirements.

  • The probe command or script must contain the fully qualified path within the zone.

  • The probe command or script must be executable by root.

  • The probe command or script must return one of the following return codes.

Table 1-4  Return codes
Successful completion
An error occurred that requires a resource restart
An error has occurred that requires an immediate failover of the resource group

Note -  For an immediate failover of the zone SMF resource, you must configure the resource properties Failover_mode and Failover_enabled to meet the required behavior. Refer to the r_properties (5) man page when setting the Failover_mode property and the SUNW.gds (5) man page when setting the Failover_enabled property.
Example 1-4  Zone SMF Probe Script for Apache2

This example shows a simple script to test that the SMF Apache2 service is running, beyond the process tree existing. The script /var/tmp/probe-apache2 must exist and being executable within the zone.

# cat /var/tmp/probe-apache2
# !/usr/bin/ksh
if echo "GET; exit" | mconnect -p 80 > /dev/null 2>&1
exit 0
exit 100

# chmod 755 /var/tmp/probe-apache2