Managing Serviceguard 14th Edition, June 2007

Planning and Documenting an HA Cluster
Package Configuration Planning
Chapter 4182
return 0
}
typeset -i exit_val=0
case ${1} in
start)
start_command $*
exit_val=$?
;;
stop)
stop_command $*
exit_val=$?
;;
validate)
validate_command $*
exit_val=$?
;;
*)
sg_log 0 "Unknown entry point $1"
;;
esac
exit $exit_val
For more information about integrating an application with
Serviceguard, see the white paper Framework for HP Serviceguard
Toolkits, which includes a suite of customizable scripts. The white paper
is included in the Serviceguard Developer’s Toolkit, which you can
download free of charge from http://www.hp.com/go/softwaredepot.
Using Serviceguard Commands in an External Script
You can use Serviceguard commands (such as cmmodpkg) in an external
script run from a package. These commands must not interact with that
package itself.
If a Serviceguard command interacts with another package, be careful to
avoid command loops. For instance, a command loop might occur under
the following circumstances. Suppose a script run by pkg1 does a
cmmodpkg -d of pkg2, and a script run by pkg2 does a cmmodpkg -d of
pkg1. If both pkg1 and pkg2 start at the same time, the pkg1 script now
tries to cmmodpkg pkg2. But that cmmodpkg command has to wait for
pkg2 startup to complete. The pkg2 script tries to cmmodpkg pkg1, but
pkg2 has to wait for pkg1 startup to complete, thereby causing a
command loop.