Managing HP Serviceguard for Linux, Seventh Edition, July 2007

Cluster and Package Maintenance
Configuring a Legacy Package
Chapter 7 269
# replaced with the appropriate multipath device name.
#
# For example:
# RAIDTAB="/usr/local/cmcluster/conf/raidtab.sg"
#
#RAIDTAB=""
# MD (RAID) COMMANDS
# Specify the method of activation and deactivation for md.
# Leave the default (RAIDSTART="raidstart", "RAIDSTOP="raidstop") if you want
# md to be started and stopped with default methods.
#
RAIDSTART="raidstart -c ${RAIDTAB}"
RAIDSTOP="raidstop -c ${RAIDTAB}"
Adding Customer Defined Functions to the Package Control
Script
You can add additional shell commands to the package control script to
be executed whenever the package starts or stops. Enter these
commands in the CUSTOMER DEFINED FUNCTIONS area of the script.
If your package needs to run short-lived processes, such as commands to
initialize or halt a packaged application, you can also run these from the
CUSTOMER DEFINED FUNCTIONS.
An example of this portion of the script follows, showing the date and
echo commands logging starts and halts of the package to a file.
# START OF CUSTOMER DEFINED FUNCTIONS
# This function is a place holder for customer defined functions.
# You should define all actions you want to happen here, before the service is
# started. You can create as many functions as you need.
function customer_defined_run_cmds
{
# ADD customer defined run commands.
: # do nothing instruction, because a function must contain some command.
date >> /tmp/pkg1.datelog
echo 'Starting pkg1' >> /tmp/pkg1.datelog
test_return 51
}
# This function is a place holder for customer defined functions.