Setting up an HP SIM server 6.0 or greater on a Linux-based Serviceguard Cluster White Paper 444847-004, February 2010

29
numvg=$(vgdisplay | grep
-
w
-
e ${vgname} | wc
-
l)
if (( numvg == 0 && ${#MD[*]} > 0 ))
then
# First
let’s
do a sanity check to see if the vg really has
# a configuration backup. If not then we report this and
# exit.
It is a prereq that a vgcfgbackup be done after
# the vg configuration is built and before sg is started.
# Perform a check to see if it is LVM Version 2 or LVM version
1
# and execute the appropriate commands.
if (( LVM_
VER == 2 ))
then
vgcfgrestore
-
ll
-
t ${vgname} >/dev/null 2>&1
test_return 27
vgcfgrestore ${vgname} >/dev/null 2>&1
else
vgcfgrestore
-
n ${vgname}
-
ll
-
t >/dev/null 2>&1
test_return 2
7
vgcfgrestore
-
n ${vgname}
-
ll |
\
awk '/PV Name/ {print $3}' | while read pvname
do
vgcfgrestore
-
n ${vgname} ${pvname} >/dev/null 2>&1
done
fi
fi
activation_check $I
test_return 53
echo "$(date '+%b %e %T')
-
Node
\
"$(hostname)
\
": Activating
volume group $I ."
result=$($VGCHANGE $I 2>&1)
test_return 1
case $result in
*volume*group*does*not*exist*)
echo
-
e "
\
t$result"
#
this will set $? to 1
let 0
test_return 1
;;
esac
done
}
#This function is used to kill the user to freeup a mountpoint
#that could be busy and then do the mount operation.
#freeup_busy_mountpo
int_and_mount_fs(w, x, z)
#
w = Logical volume group to be mounted.
#
x = File System where the logical volume is to be mounted.
# z = Mount Options to be used for mount operation, including
#
file system type if applicable
#
function fr
eeup_busy_mountpoint_and_mount_fs
{
local vol_to_mount
local mount_pt