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

35
# This function will set variables to t
he required settings if
# GFS is being used.
function check_gfs
{
typeset
-
i i=0
typeset
-
i num=0
if [[ ${GFS} == "YES" ]]; then
DATA_REP="none"
unset RAIDTAB
num=${#VG[@]}
i=0
while (( i < num ))
do
unset VG[$i]
(( i = i + 1 ))
done
num=${#MD[@]}
i=0
while (( i < num ))
do
unset MD[$i]
(( i = i + 1 ))
done
FS_UMOUNT_COUNT=1
FS_MOUNT_R
ETRY_COUNT=0
CONCURRENT_FSCK_OPERATIONS=1
fi
}
# END OF HALT FUNCTIONS.
# FUNCTIONS COMMON TO BOTH RUN AND HALT.
# Test return value of functions and exit with NO RESTART if bad.
# Return value of 0
-
50 are reserved for use by Hewlett
-
Packa
rd.
# System administrators can use numbers above 50 for return values.
#
function test_return
{
if (( $? != 0 ))
then
local to_exit=0
case $1 in
1)
echo "ERROR: Function activate_volume_group; Failed to activate $I"
deacti
vate_volume_group
deactivate_md
verify_physical_data_replication stop
to_exit=1
;;
2)
echo "ERROR: Function check_and_mount; Failed to fsck one of the
devices."
deactivate_volume_group
deactivate_md
verify_
physical_data_replication stop
exit_value=1
;;
3)
echo "ERROR: Function check_and_mount; Failed to mount $I to
${FS[$F]}"
umount_fs
deactivate_volume_group
deactivate_md
verify_physical_data_rep
lication stop