From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22250 invoked by alias); 27 Aug 2008 19:27:57 -0000 Received: (qmail 22243 invoked by alias); 27 Aug 2008 19:27:57 -0000 X-Spam-Status: No, hits=-0.9 required=5.0 tests=BAYES_05,KAM_MX,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com X-Spam-Level: Subject: RHEL5 - cmirror init script: Fix bug 460229 - add status output To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL5 X-Git-Reftype: branch X-Git-Oldrev: 397b8111d2d69b9dd25e7b074822be571f274032 X-Git-Newrev: 29b4608b93abf8517b735c9c7065c96f8be1c529 From: Jonathan Brassow Message-Id: <20080827192654.856FF12036B@lists.fedorahosted.org> Date: Wed, 27 Aug 2008 19:49:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2008-q3/txt/msg00339.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=29b4608b93abf8517b735c9c7065c96f8be1c529 Commit: 29b4608b93abf8517b735c9c7065c96f8be1c529 Parent: 397b8111d2d69b9dd25e7b074822be571f274032 Author: Jonathan Brassow AuthorDate: Wed Aug 27 14:25:50 2008 -0500 Committer: Jonathan Brassow 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 ;; *)