cluster: RHEL4 - rgmanager: isAlive error logging for file systems

Lon Hohberger lon at fedoraproject.org
Thu Oct 21 22:11:30 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=44a5db04457aa4003f551b0debf2bb0a996d8e99
Commit:        44a5db04457aa4003f551b0debf2bb0a996d8e99
Parent:        bf3e09fcbcf0b661df5b45febd825569d31ac74d
Author:        Lon Hohberger <lhh at redhat.com>
AuthorDate:    Wed Feb 10 12:11:33 2010 -0500
Committer:     Lon Hohberger <lhh at redhat.com>
CommitterDate: Thu Oct 21 18:02:14 2010 -0400

rgmanager: isAlive error logging for file systems

This change adapts two different patch sets, one
contributed by Nick Downs.

It fixes:
- isAlive logging for all file systems
- file naming during isAlive checks for cluster
  file systems

Resolves: rhbz#469815

Signed-off-by: Lon Hohberger <lhh at redhat.com>
---
 rgmanager/src/resources/clusterfs.sh |   15 +++++++++++----
 rgmanager/src/resources/fs.sh        |   13 ++++++++++---
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/rgmanager/src/resources/clusterfs.sh b/rgmanager/src/resources/clusterfs.sh
index 3fa35b1..fa2994d 100755
--- a/rgmanager/src/resources/clusterfs.sh
+++ b/rgmanager/src/resources/clusterfs.sh
@@ -439,8 +439,9 @@ Device $dev is mounted on $tmp_mp instead of $mp"
 # 
 isAlive()
 {
+	declare errcode
 	declare mount_point
-	declare file=".writable_test"
+	declare file=".writable_test.$(hostname)"
 	declare rw
 	
 	if [ $# -ne 1 ]; then
@@ -459,8 +460,10 @@ isAlive()
 	
 	# depth 10 test (read test)
 	ls $mount_point > /dev/null 2> /dev/null
-	if [ $? -ne 0 ]; then
-	       return $NO
+	errcode=$?
+	if [ $errcode -ne 0 ]; then
+		ocf_log err "clusterfs:${OCF_RESKEY_name}: isAlive failed read test on [$mount_point]. Return code: $errcode"
+		return $NO
 	fi
 	
 	[ $OCF_CHECK_LEVEL -lt 20 ] && return $YES
@@ -483,7 +486,11 @@ isAlive()
 			fi
 		done
 		touch $file > /dev/null 2> /dev/null
-		[ $? -ne 0 ] && return $NO
+		errcode=$?
+		if [ $errcode -ne 0 ]; then
+			ocf_log err "clusterfs:${OCF_RESKEY_name}: isAlive failed write test on [$mount_point]. Return code: $errcode"
+			return $NO
+		fi
 		rm -f $file > /dev/null 2> /dev/null
 	fi
 	
diff --git a/rgmanager/src/resources/fs.sh b/rgmanager/src/resources/fs.sh
index 0490c3b..2c380b7 100755
--- a/rgmanager/src/resources/fs.sh
+++ b/rgmanager/src/resources/fs.sh
@@ -635,6 +635,7 @@ isMounted () {
 # 
 isAlive()
 {
+	declare errcode
 	declare mount_point
 	declare file=".writable_test"
 	declare rw
@@ -655,8 +656,10 @@ isAlive()
 	
 	# depth 10 test (read test)
 	ls $mount_point > /dev/null 2> /dev/null
-	if [ $? -ne 0 ]; then
-	       return $NO
+	errcode=$?
+	if [ $errcode -ne 0 ]; then
+		ocf_log err "fs:${OCF_RESKEY_name}: isAlive failed read test on [$mount_point]. Return code: $errcode"
+		return $NO
 	fi
 	
 	[ $OCF_CHECK_LEVEL -lt 20 ] && return $YES
@@ -679,7 +682,11 @@ isAlive()
 			fi
 		done
 		touch $file > /dev/null 2> /dev/null
-		[ $? -ne 0 ] && return $NO
+		errcode=$?
+		if [ $errcode -ne 0 ]; then
+			ocf_log err "fs:${OCF_RESKEY_name}: isAlive failed write test on [$mount_point]. Return code: $errcode"
+			return $NO
+		fi
 		rm -f $file > /dev/null 2> /dev/null
 	fi
 	


More information about the cluster-commits mailing list