Bug 845653 - Glusterd init script returns 1 when service start is executed on running a glusterd service.
Glusterd init script returns 1 when service start is executed on running a gl...
Status: CLOSED ERRATA
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: glusterd (Show other bugs)
2.0
All All
low Severity low
: ---
: ---
Assigned To: Raghavendra Talur
Ben Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-03 14:13 EDT by Ben Turner
Modified: 2013-09-23 18:41 EDT (History)
5 users (show)

See Also:
Fixed In Version: glusterfs-3.4.0qa8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-23 18:38:56 EDT
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)
Change return code from 1 to 0 (402 bytes, patch)
2012-08-03 14:13 EDT, Ben Turner
no flags Details | Diff

  None (edit)
Description Ben Turner 2012-08-03 14:13:13 EDT
Created attachment 602174 [details]
Change return code from 1 to 0

Description of problem: Glusterd init script returns 1 when service start is executed on running a glusterd service, this should return 0 if the service is already running.  

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

glusterfs-server-3.3.0rhs-25.el6rhs.x86_64

How reproducible:

Every time.

Steps to Reproduce:
1.  Start the glusterd service
2.  Run service glusterd start on the already started service.
3.  Run echo $? to verify the return code.
  
Actual results:

[root@hp-dl380g7-1 initscripts]# service glusterd start
glusterd service is already running with pid 3841
[root@hp-dl380g7-1 initscripts]# echo $?
1
[root@hp-dl380g7-1 initscripts]# service glusterd start
glusterd service is already running with pid 3841
[root@hp-dl380g7-1 initscripts]# echo $?
1

Expected results:

[root@hp-dl380g7-1 initscripts]# service glusterd start
glusterd service is already running with pid 3841
[root@hp-dl380g7-1 initscripts]# echo $?
0
[root@hp-dl380g7-1 initscripts]# service glusterd start
glusterd service is already running with pid 3841
[root@hp-dl380g7-1 initscripts]# echo $?
0


Additional info:  I tested this on several other service and confirmed that they all return 0.  I also attached a patch that should resolve this.
Comment 2 Niels de Vos 2012-10-31 07:44:45 EDT
From http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

For all other init-script actions, the init script shall return an exit status of zero if the action was successful. Otherwise, the exit status shall be non-zero, as defined below. In addition to straightforward success, the following situations are also to be considered successful:

    restarting a service (instead of reloading it) with the force-reload argument

    running start on a service already running

    running stop on a service already stopped or not running

    running restart on a service already stopped or not running

    running try-restart on a service already stopped or not running


-> so, yes, if the service was started successfully before, next attempts should detect the running service and return 0 (success)
Comment 3 Raghavendra Talur 2012-12-21 04:22:16 EST
Posted for review at http://review.gluster.org/4348
Comment 4 Vijay Bellur 2013-01-11 12:12:51 EST
CHANGE: http://review.gluster.org/4348 (extras: Changed the exit status in start function to 0.) merged in master by Vijay Bellur (vbellur@redhat.com)
Comment 5 Ben Turner 2013-07-31 21:25:01 EDT
Verified on glusterfs-3.4.0.14rhs-1.el6rhs.x86_64.rpm
Comment 6 Scott Haines 2013-09-23 18:38:56 EDT
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. 

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1262.html
Comment 7 Scott Haines 2013-09-23 18:41:32 EDT
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. 

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1262.html

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