This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RHEL5 - cmirror init script: Fix bug 460229 - add status output


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=29b4608b93abf8517b735c9c7065c96f8be1c529
Commit:        29b4608b93abf8517b735c9c7065c96f8be1c529
Parent:        397b8111d2d69b9dd25e7b074822be571f274032
Author:        Jonathan Brassow <jbrassow@redhat.com>
AuthorDate:    Wed Aug 27 14:25:50 2008 -0500
Committer:     Jonathan Brassow <jbrassow@redhat.com>
CommitterDate: Wed Aug 27 14:26:47 2008 -0500

cmirror init script: Fix bug 460229 - add status output

Also noticed that the return code wasn't always correct
when doing 'service cmirror status'.
---
 cmirror/init.d/cmirror |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/cmirror/init.d/cmirror b/cmirror/init.d/cmirror
index e8ba827..fba99e1 100644
--- a/cmirror/init.d/cmirror
+++ b/cmirror/init.d/cmirror
@@ -79,6 +79,23 @@ stop()
         return $rtrn
 }
 
+cmirror_status()
+{
+	ps -C clogd >& /dev/null
+	if [ $? -ne 0 ]; then
+		echo "Cluster log server is not running.  (Cluster mirrors will not work.)"
+		return 1
+	fi
+
+	modprobe dm-log-clustered
+	if [ $? -ne 0 ]; then
+		echo "Cluster log module is not loaded.  (Cluster mirrors will not work.)"
+		return 1
+	fi
+
+	return 0
+}
+
 rtrn=1
 
 # See how we were called.
@@ -100,7 +117,11 @@ case "$1" in
         ;;
 
   status)
-        rtrn=1
+	cmirror_status
+        rtrn=$?
+	if [ $rtrn -eq 0 ]; then
+		echo "cmirror is running."
+	fi
         ;;
 
   *)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]