[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/rgmanager/src resources/fs.sh utils/cl ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	STABLE
Changes by:	lhh sourceware org	2006-08-11 15:00:59

Modified files:
	rgmanager/src/resources: fs.sh 
Added files:
	rgmanager/src/utils: clunfslock.sh 

Log message:
	Merge from RHEL4U4 branch

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/fs.sh.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.4.2.6.4.5&r2=1.4.2.6.4.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/utils/clunfslock.sh.diff?cvsroot=cluster&only_with_tag=STABLE&r1=NONE&r2=1.2.2.1

--- cluster/rgmanager/src/resources/fs.sh	2006/06/16 20:07:46	1.4.2.6.4.5
+++ cluster/rgmanager/src/resources/fs.sh	2006/08/11 15:00:59	1.4.2.6.4.6
@@ -1061,7 +1061,8 @@
 	typeset -i ret_val=0
 	typeset -i try=1
 	typeset -i max_tries=3		# how many times to try umount
-	typeset -i sleep_time=2		# time between each umount failure
+	typeset -i sleep_time=5		# time between each umount failure
+	typeset -i nfslock_reclaim=0
 	typeset done=""
 	typeset umount_failed=""
 	typeset force_umount=""
@@ -1157,11 +1158,8 @@
 	          		    mkdir -p $mp/.clumanager/statd
 				    # Copy out the notify list; our 
 				    # IPs are already torn down
-				    if notify_list_store $mp/.clumanager/statd
-				    then
-				      notify_list_broadcast \
-				        $mp/.clumanager/statd
-				    fi
+				    notify_list_store $mp/.clumanager/statd
+				    nfslock_reclaim=1
 				  fi
 				fi
 			fi
@@ -1186,6 +1184,11 @@
 		fi
 	done # while 
 
+	if [ $nfslock_reclaim -eq 1 ]; then
+		# If we have this flag set, do a full reclaim broadcast
+		notify_list_broadcast $mp/.clumanager/statd
+	fi
+
 	if [ -n "$umount_failed" ]; then
 		ocf_log err "'umount $mp' failed, error=$ret_val"
 
/cvs/cluster/cluster/rgmanager/src/utils/clunfslock.sh,v  -->  standard output
revision 1.2.2.1
--- cluster/rgmanager/src/utils/clunfslock.sh
+++ -	2006-08-11 15:00:59.669113000 +0000
@@ -0,0 +1,73 @@
+#!/bin/bash
+#
+# (C) 2006 Red Hat, Inc. 
+#
+# Licensed under the GNU General Public License, Version 2.
+#
+# rpc.statd -H $0 to enable.  This provides the HA-callout capability
+# for RHCS-managed NFS services.  Note that you must edit
+# /etc/sysconfig/nfs in order to make this work; clumanager/rgmanager
+# will not interfere with a running nfs statd.
+#
+# Arg 3 (server as known to client) does not work; it's always 127.0.0.1
+# so we traverse all cluster mount points.
+#
+
+clustered_mounts()
+{
+	declare dev mp
+
+	while read dev mp; do
+		if [ "${dev:0:4}" != "/dev" ]; then
+			continue
+		fi
+
+		# XXX Need clumanager to create this on mount
+		if [ -d "$mp/.clumanager" ]; then
+			echo $dev $mp
+		fi
+	done < <(cat /proc/mounts | awk '{print $1,$2}')
+}
+
+
+add-client()
+{
+	declare dev mp
+
+	while read dev mp; do
+		[ -d "$mp/.clumanager/statd/sm" ] || \
+			mkdir -p $mp/.clumanager/statd/sm
+		touch $mp/.clumanager/statd/sm/$1
+	done < <(clustered_mounts)
+}
+
+
+del-client()
+{
+	while read $dev $mp; do
+		[ -d "$mp/.clumanager/statd/sm" ] || \
+			mkdir -p $mp/.clumanager/statd/sm
+		rm -f $mp/.clumanager/statd/sm/$1
+	done < <(clustered_mounts)
+}
+
+case "$1" in
+	add-client)
+		:
+		;;
+	del-client)
+		:
+		;;
+	*)
+		echo "Usage: $0 <add-client|del-client> <host> [server]"
+		exit 0
+esac
+
+
+if [ -z "$2" ]; then
+	echo "Usage: $0 <add-client|del-client> <host> [server]"
+	exit 1
+fi
+
+$1 $2 $3
+exit 0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]