1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

remove checking for filesystems and filesystem health from the cnfs script.

remove the gpfsmount and gpfsumount entry points

(This used to be ctdb commit 7db5a4832a9555be53c301f198f72b9e075a8ae7)
This commit is contained in:
Ronnie Sahlberg 2010-10-18 11:57:38 +11:00
parent ef0ab7eee1
commit d32a4dd501

View File

@ -8,20 +8,8 @@ loadconfig
STATEDIR=$CTDB_VARDIR/state/gpfs
# filesystems needed by nfs
NFS_FSS=`cat /etc/exports | egrep -v "^#" | sed -e "s/[ \t]*[^ \t]*$//" -e "s/\"//g"`
check_if_healthy() {
mkdir -p $STATEDIR/fs
FS=`(cd $STATEDIR/fs ; ls )`
[ -z "$FS" ] || {
MISSING=`echo $FS | sed -e "s/@/\//g"`
logger Filesystems required for NFS are missing. Node is UNHEALTHY. [$MISSING]
$CTDB_BASE/events.d/62.cnfs unhealthy "GPFS filesystems required for NFS are not mounted : [$MISSING]"
exit 0
}
[ -f "$STATEDIR/gpfsnoquorum" ] && {
logger No GPFS quorum. Node is UNHEALTHY
@ -40,64 +28,6 @@ case "$1" in
;;
# This event is called from the GPFS callbacks when a filesystem is
# unmounted
gpfsumount)
# is this a filesystem we need for nfs?
echo "$NFS_FSS" | egrep "^$2" >/dev/null || {
# no
exit 0
}
logger "GPFS unmounted filesystem $2 used by NFS. Mark node as UNHEALTHY"
MFS=`echo $2 | sed -e "s/\//@/g"`
mkdir -p $STATEDIR/fs
touch "$STATEDIR/fs/$MFS"
$CTDB_BASE/events.d/62.cnfs unhealthy "GPFS unmounted filesystem $2 used by NFS"
;;
# This event is called from the GPFS callbacks when a filesystem is
# mounted
gpfsmount)
# is this a filesystem we need for nfs?
echo "$NFS_FSS" | egrep "^$2" >/dev/null || {
# no
exit 0
}
logger "GPFS mounted filesystem $2 used by NFS."
MFS=`echo $2 | sed -e "s/\//@/g"`
mkdir -p $STATEDIR/fs
rm -f "$STATEDIR/fs/$MFS"
check_if_healthy
;;
# This event is called from the gpfs callback when GPFS is being shutdown.
gpfsshutdown)
logger "GPFS is shutting down. Marking node as UNHEALTHY and trigger a CTDB failover"
$CTDB_BASE/events.d/62.cnfs unhealthy "GPFS was shut down!"
;;
# This event is called from the gpfs callback when GPFS has started.
# It checks that all required NFS filesystems are mounted
# and flags the node healthy if so.
gpfsstartup)
# assume we always have quorum when starting
# we are only interested in the case when we explicitely
# lost quorum in an otherwise happy cluster
mkdir -p $STATEDIR
rm -f "$STATEDIR/gpfsnoquorum"
logger "GPFS is is started."
check_if_healthy
;;
gpfsquorumreached)
mkdir -p $STATEDIR
rm -f "$STATEDIR/gpfsnoquorum"
@ -112,10 +42,6 @@ case "$1" in
$CTDB_BASE/events.d/62.cnfs unhealthy "GPFS quorum was lost! Marking node as UNHEALTHY."
;;
unhealthy)
# Mark the node as UNHEALTHY which means all public addresses
# will be migrated off the node.