Managing HP Serviceguard for Linux, Sixth Edition, August 2006

Configuring Packages and Their Services
Writing the Package Control Script
Chapter 6188
Writing the Package Control Script
The package control script contains all the information necessary to run
all the services in the package, monitor them during operation, react to a
failure, and halt the package when necessary.
Each package must have a separate control script, which must be
executable. The control script is placed in the package directory and is
given the same name as specified in the RUN_SCRIPT and HALT_SCRIPT
parameters in the package ASCII configuration file. For security reasons,
the control script must reside in a directory with the string cmcluster in
the path.
The package control script template contains both the run instructions
and the halt instructions for the package. You can use a single script for
both run and halt operations, or, if you wish, you can create separate
scripts. After completing the script, you must propagate it to all the
nodes. For more information See “Copying Package Control Scripts with
Linux commands” on page 205.
Use the following procedure to create a control script for the sample
package
pkg1
.
First, generate a control script template:
# cmmakepkg -s $SGCONF/pkg1/pkg1.sh
You may customize the script, as described in the next section.