Bug 846043 - Init scripts return the wrong value on the status of a stopped service.
Init scripts return the wrong value on the status of a stopped service.
Status: CLOSED WONTFIX
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: gluster-swift (Show other bugs)
2.0
Unspecified Unspecified
medium Severity unspecified
: ---
: ---
Assigned To: Vivek Agarwal
SATHEESARAN
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-06 12:07 EDT by Ben Turner
Modified: 2016-02-17 19:02 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-23 02:03:09 EST
Type: Bug
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 Ben Turner 2012-08-06 12:07:49 EDT
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 03:47:09 EDT
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 02:03:09 EST
Change cannot be made against gluster-swift to fix this, has to be made in Openstack Swift.

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