Bug 187271 - `service clvmd status` returns 0 when clvmd is NOT running (should return non 0)
`service clvmd status` returns 0 when clvmd is NOT running (should return non 0)
Status: CLOSED ERRATA
Product: Red Hat Cluster Suite
Classification: Red Hat
Component: lvm2-cluster (Show other bugs)
4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-29 13:12 EST by Stanko Kupcevic
Modified: 2010-01-11 23:04 EST (History)
5 users (show)

See Also:
Fixed In Version: RHBA-2007-0046
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-10 17:06:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stanko Kupcevic 2006-03-29 13:12:57 EST
Description of problem: 
`/etc/init.d/clvmd stop` returns 1 when clvmd is not running (should return 0).
`/etc/init.d/clvmd status` returns 0 when clvmd is NOT running (0 s/b for
"service OK" only).

This causes problems for conga, when it determines cluster status and
starts/stops a node. 

Although 'stop' might not get fixed for RHEL4 (to preserve backwards
compatibility - see
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=151104), 'status' deviates
from behavior of other init scripts, and so is a bug. 


Version-Release number of selected component (if applicable):
lvm2-cluster-2.02.01-1.2.RHEL4

How reproducible:
Always

Additional info:
Comment 1 Christine Caulfield 2006-03-31 02:39:38 EST
Pass this to Chris as I think he knows where the init scripts live.
Comment 2 Chris Feist 2006-04-11 10:46:23 EDT
Reassigning to agk as he develops and builds clvm.
Comment 5 Jonathan Earl Brassow 2006-06-05 12:58:46 EDT
agk please see patches
Comment 6 Alasdair Kergon 2006-07-19 14:49:55 EDT
fixed 'status' in upstream cvs
Comment 7 Corey Marthaler 2006-11-08 18:19:44 EST
agk, are these fixes in lvm2-cluster-2.02.13-1?

I attempted to verify this bz however the '/etc/init.d/clvmd stop' still "fails"
and returns 1 because of 213737.

The '/etc/init.d/clvmd status' does however ro the "correct" thing and give a
non zero when not running.
Comment 8 Alasdair Kergon 2006-11-08 19:04:32 EST
When I looked at it and compared with other scripts etc. I couldn't see
justification for changing 'stop'.  Someone needs to make the case with
reference to standards, other scripts etc.
Comment 9 Corey Marthaler 2007-01-04 14:37:59 EST
From this mornings bz meeting, I checked and rhel5 and rhel4 are different in
the way that they report error codes (at least in the service stop cmd). The
status part of this bug has been fixed for awhile. As for the stop part of this
bug, it appears that the other CS init scripts do not give a non zero error code
either when attempting to stop non started services, although, they didn't give
output that says "FAILED" either so I could see the argument either way.
Regardless, it's different between rhel4 and rhel5 so one or the other needs to
be changed.

RHEL5:
[root@taft-01 ~]# service clvmd status
clvmd is stopped
active volumes: (none)
[root@taft-01 ~]# echo $?
3
[root@taft-01 ~]# service clvmd stop
Stopping clvm:                                             [FAILED]
[root@taft-01 ~]# echo $?
0

# while not running...
[root@taft-01 ~]# service cman stop
Stopping cluster:
   Stopping fencing... done
   Stopping cman... done
   Stopping ccsd... done
   Unmounting configfs... done
                                                           [  OK  ]
[root@taft-01 ~]# service rgmanager stop
Cluster Service Manager is stopped.
[root@taft-01 ~]# echo $?
0


RHEL4:
[root@link-08 ~]# service clvmd status
clvmd is stopped
active volumes: (none)
[root@link-08 ~]# echo $?
3
[root@link-08 ~]# service clvmd stop
Stopping clvm:                                             [FAILED]
[root@link-08 ~]# echo $?
1
Comment 10 Alasdair Kergon 2007-01-30 13:42:11 EST
Refer to 151104 comment #2:

  RHEL5 returns 0

  RHEL4 returns 1, as that was standard practice in RHEL4.
Comment 13 Red Hat Bugzilla 2007-05-10 17:06:40 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0046.html

Note You need to log in before you can comment on or make changes to this bug.