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

30
local fs_mount_opt
vol_to_mount=$1
mount_pt=$2
shift 2
fs_mount_opt=$*
echo "WARNING: Running fuser on ${mount_pt} to remove anyone using
the busy mount
point directly."
UM_COUNT=0
RET=1
# The control script exits, if the mount failed after
# retrying FS_MOUNT_RETRY_COUNT times.
while (( $UM_COUNT < $FS_MOUNT_RETRY_COUNT ))
do
(( UM_COUNT = $UM_COUNT + 1 ))
fuser
-
kuv
${mount_pt}
if (($UM_COUNT == $FS_MOUNT_RETRY_COUNT))
then
mount ${fs_mount_opt} ${vol_to_mount} ${mount_pt}
test_return 17
else
mount ${fs_mount_opt} ${vol_to_mount} ${mount_pt}
(( RET = $? ))
if (( $RET == 0 ))
then
break
else
sleep 1
fi
fi
done
}
# For each {file system/device} pair, fsck the file system
# and mount it.
#
# If the underlying file
system is Red Hat GFS, mount the file system
# if it is not already mounted; fsck operations are not performed for
# GFS.
#
# If the mount point is busy and if FS_MOUNT_RETRY_COUNT = 0,
# mounting of the file system will fail and the control script
# will
exit with an error.
#
function check_and_mount
{
typeset
-
i j=0
typeset pids_list
if [[ ${GFS} == "NO" ]]
then
# Verify that there is at least one file system to check and what
type.
if (( ${#LV[*]} > 0 ))
then
echo "$(date '+%b %e %T')
-
Node
\
"$(hostname)
\
":
Checking filesystems:"