Bug 187271

Summary: `service clvmd status` returns 0 when clvmd is NOT running (should return non 0)
Product: [Retired] Red Hat Cluster Suite Reporter: Stanko Kupcevic <kupcevic>
Component: lvm2-clusterAssignee: Alasdair Kergon <agk>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: adas, agk, dwysocha, jbrassow, mbroz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0046 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-10 21:06:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stanko Kupcevic 2006-03-29 18:12:57 UTC
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 07:39:38 UTC
Pass this to Chris as I think he knows where the init scripts live.

Comment 2 Chris Feist 2006-04-11 14:46:23 UTC
Reassigning to agk as he develops and builds clvm.

Comment 5 Jonathan Earl Brassow 2006-06-05 16:58:46 UTC
agk please see patches

Comment 6 Alasdair Kergon 2006-07-19 18:49:55 UTC
fixed 'status' in upstream cvs

Comment 7 Corey Marthaler 2006-11-08 23:19:44 UTC
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-09 00:04:32 UTC
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 19:37:59 UTC
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 18:42:11 UTC
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 21:06:40 UTC
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