Bug 846043

Summary: Init scripts return the wrong value on the status of a stopped service.
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Ben Turner <bturner>
Component: gluster-swiftAssignee: Vivek Agarwal <vagarwal>
Status: CLOSED WONTFIX QA Contact: SATHEESARAN <sasundar>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 2.0CC: gluster-bugs, ndevos, nlevinki, ppai, rhs-bugs, rwheeler, sankarshan, vagarwal, vbellur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-23 07:03:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Turner 2012-08-06 16:07:49 UTC
Description of problem:  It looks like the following gluster init scripts are returning the wrong value when service myservice status is run on a stopped service:

gluster-swift-account	
gluster-swift-container	
gluster-swift-object	
gluster-swift-proxy	
gluster-system-settings	
glusterd     

The expected return for a status on a stopped service is 3 based on:

http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

Version-Release number of selected component (if applicable):

gluster-swift-plugin-1.0-5.noarch
gluster-swift-proxy-1.4.8-4.el6.noarch
gluster-swift-account-1.4.8-4.el6.noarch
glusterfs-3.3.0rhs-25.el6rhs.x86_64
glusterfs-server-3.3.0rhs-25.el6rhs.x86_64
gluster-swift-1.4.8-4.el6.noarch
gluster-swift-object-1.4.8-4.el6.noarch

How reproducible:

Every time.

Steps to Reproduce:
1.  Stop the any of the mentioned services
2.  Run service myservice status on the stopped service
3.
  
Actual results:

[root@hp-dl380g7-1 initscripts]# service gluster-swift-account stop
Stopping swift-account-server:                             [  OK  ]
[root@hp-dl380g7-1 initscripts]# service gluster-swift-account status
account-server is stopped
[root@hp-dl380g7-1 initscripts]# echo $?
1

Expected results:

[root@hp-dl380g7-1 initscripts]# service gluster-swift-account stop
Stopping swift-account-server:                             [  OK  ]
[root@hp-dl380g7-1 initscripts]# service gluster-swift-account status
account-server is stopped
[root@hp-dl380g7-1 initscripts]# echo $?
3

Additional info:

Comment 2 Niels de Vos 2012-10-23 07:47:09 UTC
From Linux Standard Base Core Specification 3.1, Chapter 20. System Initialization
- http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

If the status action is requested, the init script will return the following exit status codes.

0	program is running or service is OK
1	program is dead and /var/run pid file exists
2	program is dead and /var/lock lock file exists
3	program is not running
4	program or service status is unknown

--

So yes, the return value of 'service gluster-swift-account status' should be '3'.

Comment 4 Prashanth Pai 2015-02-23 07:03:09 UTC
Change cannot be made against gluster-swift to fix this, has to be made in Openstack Swift.