cluster: RHEL48 - Revert "rgmanager: Kill correct PIDs during force_unmount"

Lon Hohberger lon at fedoraproject.org
Mon Jun 14 20:19:22 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=458ed7e8c9801db88aa741ab6473ef7512612f90
Commit:        458ed7e8c9801db88aa741ab6473ef7512612f90
Parent:        1ebe0d71a2cc822e3c805da33b815af3e3393ef0
Author:        Lon Hohberger <lhh at redhat.com>
AuthorDate:    Mon Jun 14 16:18:32 2010 -0400
Committer:     Lon Hohberger <lhh at redhat.com>
CommitterDate: Mon Jun 14 16:18:32 2010 -0400

Revert "rgmanager: Kill correct PIDs during force_unmount"

This reverts commit 04d4b4acc681f8af1a467ffac077e5898ad19592.
---
 rgmanager/src/resources/fs.sh |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/rgmanager/src/resources/fs.sh b/rgmanager/src/resources/fs.sh
index 46a5189..5b3a3bc 100755
--- a/rgmanager/src/resources/fs.sh
+++ b/rgmanager/src/resources/fs.sh
@@ -690,7 +690,6 @@ killMountProcesses()
 	typeset have_lsof=""
 	typeset have_fuser=""
 	typeset try
-	typeset command pid user line
 
 	if [ $# -ne 1 ]; then
 		ocf_log err \
@@ -727,30 +726,30 @@ killMountProcesses()
 			#
 			# Use lsof to free up mount point
 			#
-			while read line
+	    		while read command pid user
 			do
-				path=$(echo $line | awk '{for (i=9;i<NF+1;i++) {printf "%s ",$i};}')
-				#if [ -z $(echo $path | grep -E "$mp(/| |$)") ]
-				if [ -z $(echo $path | grep -E "^$mp/.*") ]; then
+				if [ -z "$pid" ]; then
 					continue
 				fi
-				command=$(echo $line | awk '{print $1}')
-				pid=$(echo $line | awk '{print $2}')
-				user=$(echo $line | awk '{print $3}')
+
 				if [ $try -eq 1 ]; then
-					ocf_log warn "killing process $pid ($user $command $mp)"
+					ocf_log warn \
+			 	  "killing process $pid ($user $command $mp)"
 				elif [ $try -eq 3 ]; then
-					ocf_log crit "Could not clean up mountpoint $mp"
-					ret=$FAIL
+					ocf_log crit \
+		    		  "Could not clean up mountpoint $mp"
+				ret=$FAIL
 				fi
+
 				if [ $try -gt 1 ]; then
 					kill -9 $pid
 				else
 					kill -TERM $pid
 				fi
-			done< <(lsof -bn 2>/dev/null | \
-				grep -E " $mp(/| |$)" | \
-				sort -u -k 1,3) 
+			done < <(lsof -bn 2>/dev/null | \
+			    grep -E "$mp(/.*|)\$" | \
+			    awk '{print $1,$2,$3}' | \
+			    sort -u -k 1,3)
 		elif [ -n "$have_fuser" ]; then
 			#
 			# Use fuser to free up mount point


More information about the cluster-commits mailing list