Setting up HP SIM 5.x on an HP-UX Serviceguard Cluster (448492-002, February 2008)

23
# The DRCheckDiskStatus script has the exit values as follow:
#
# 0
-
success; package starts
# 1
-
global error; package cannot start on any node in the cluster
# 2
-
local error; package cannot start on
this node but allow to
# start on other node in the cluster
#
exit_val=$?
if [[ $exit_val
-
ne 0 ]]
then
if [[ $exit_val
-
eq 1 ]]
then
echo
"ERROR: The package cannot $1 data replication on any
node in the cluster."
else
echo "ERROR: The package cannot $1 data replication on this
node."
fi
echo "###### Node
\
"$(hostname)
\
": Package s
tart FAILED at $(date)
######"
exit $exit_val
fi
else
echo "ERROR: The package is configured to use remote data
replication,"
echo
-
e "
\
tbut the file ${SGSBIN}/DRCheckDiskStatus does not exist
or"
echo
-
e "
\
tis not executable."
let 0
test_return 41
fi
fi
}
# This function tests whether the package uses a HA server toolkit (such as
# NFS, Apache) or not. If the value of the HA server enable flag (HA_APP_SER
VER)
# equals to either "pre
-
IP" or "post
-
IP" and the Toolkit Interface Script
# (toolkit.sh) exists in the package directory then the package will be
# configured for use with the HA server, and the interface script will be
# invoked as a sub
-
script.
#
#
This function has one parameter passed to it, which then will be passed to the
# toolkit.sh script:
#
#
-
start
-
to indicate the package is starting up
#
-
stop
-
to indicate the package is shutting down
#
function verify_ha_server
{
HA_APP_SCRIPT="/
etc/init.d/sgsim"
if [[
-
x $HA_APP_SCRIPT ]]
then
$HA_APP_SCRIPT $1
test_return 50
else
echo
-
e "ERROR: The Toolkit Interface Script
\
"$HA_APP_SCRIPT
\
" "
echo
-
e "
\
t does not exist or is not executable. To run HA
server on this
node,"
echo
-
e "
\
t either copy the
\
"toolkit.sh
\
" to this package directory or
use the"
echo
-
e "
\
t chmod(1) command to make file $HA_APP_SCRIPT executable."
let 0
test_return 50
fi
}
# Sanity Check on L
VM. Will check for LVM version and metadata type.