Gitweb:
http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 23adebdb29dcc8dc34d1508037434121c7a95ec7
Parent: b5a948214b9573970122c8c4fc07acfb56f049fc
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Feb 10 12:11:33 2010 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Wed Feb 10 12:11:33 2010 -0500
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#562237
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/clusterfs.sh | 15 +++++++++++----
rgmanager/src/resources/fs.sh.in | 13 ++++++++++---
2 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/rgmanager/src/resources/clusterfs.sh b/rgmanager/src/resources/clusterfs.sh
index 8558d5f..0ccc93d 100644
--- a/rgmanager/src/resources/clusterfs.sh
+++ b/rgmanager/src/resources/clusterfs.sh
@@ -424,8 +424,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
@@ -444,8 +445,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
@@ -468,7 +471,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.in b/rgmanager/src/resources/fs.sh.in
index 65cff9c..1454295 100644
--- a/rgmanager/src/resources/fs.sh.in
+++ b/rgmanager/src/resources/fs.sh.in
@@ -620,6 +620,7 @@ isMounted () {
#
isAlive()
{
+ declare errcode
declare mount_point
declare file=".writable_test"
declare rw
@@ -640,8 +641,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
@@ -664,7 +667,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