[root@TEST-eachap1t]/>$ cat /opt/VRTSvcs/bin/CFSMount/monitor
#!/usr/bin/ksh
# @(#)src/common/vxfs/CFSMount/scripts/monitor 1.14 03/28/06 13:37:49 - 1999-2004
#ident "@(#)vcscvm:src/common/vxfs/CFSMount/scripts/monitor 1.14"
#
# Copyright (c) 1999-2004 Symantec Corporation.
# All rights reserved.
#
# THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE SECRETS OF
# SYMANTEC CORPORATION. USE, DISCLOSURE OR REPRODUCTION IS PROHIBITED
# WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SYMANTEC CORPORATION.
#
# The Licensed Software and Documentation are deemed to be "commercial
# computer software" and "commercial computer software documentation"
# as defined in FAR Sections 12.212 and DFARS Section 227.7202.
#
#
# Verify that the file system specified by the MountPoint attribute
# is mounted as a cluster mount.
#
# This should be re-written in C++ so that the VCS daemon can
# run it more efficiently.
# We want to use the VX_CFS_MOUNT_INFO ioctl, which means we
# want both vxfs/3 header files and thor/0.2 header files.
# Refer to incident 41878.
# A fallback would be to just use "stat", which tells us if
# "something" is mounted, but doesn't tell us if a CFS resource
# is mounted.
#
# $1 = resource name
# $2 = MountPoint
# $3 = BlockDevice
# $4 = MountOpt
#
. /opt/VRTSvcs/bin/CFSMount/CFSMount.env
. /opt/VRTSvxfs/cfs/lib/tr_lib.sh
VCSHOME="${VCS_HOME:-/opt/VRTSvcs}"
CFSRES="$1"
MOUNTPOINT="$2"
HARES=${VCSHOME}/bin/hares
. $VCSHOME/bin/ag_i18n_inc.sh
VCSAG_SET_ENVS $CFSRES
MOUNTTYPE=`$FSCLUSTADM mounttype $MOUNTPOINT 2>/dev/null`
echo "$4" | egrep "snapof=" > /dev/null 2>&1
if [ $? -eq 0 ] && [ "$MOUNTTYPE" = "local" ]
then
exit 110;
fi
primary_name=`vx_ha_read "$HARES -value $CFSRES Primary"`
current_primary=`$FSCLUSTADM -v showprimary $MOUNTPOINT 2>/dev/null`
if [ "$MOUNTTYPE" = "primary" ]
then
if [ "$primary_name" != "$current_primary" ]
then
vx_ha_write "$HARES -modify $CFSRES Primary \
"$current_primary""
fi
fi
if [ "$MOUNTTYPE" = "primary" ] || [ "$MOUNTTYPE" = "secondary" ]
then
exit 110;
else
if [ "$MOUNTTYPE" = "disabledFs" ]
then
VCSAG_LOG_MSG "E" "File System Disabled: \
MountPoint : $MOUNTPOINT" \
5507 "$MOUNTPOINT"
fi
exit 100;
fi