Description of problem: The glusterd init script returns 1 regardless of success/fail Version-Release number of selected component (if applicable): glusterfs-server-3.4.0qa5-1.el6rhs.x86_64 How reproducible: always Steps to Reproduce: 1. service glusterd stop (if running) 2. service glusterd start; echo $? Actual results: the init script returns 1 with both pass or fail of glusterd startup Expected results: The init script returns 0 with successful glusterd start The init script returns 1 with unsuccessful glusterd start Additional info: The issue appears to be in the way the init script handles the return of the start() function. With the line in the start() function... [ $RETVAL -ne 0 ] && exit $RETVAL If RETVAL is 1, the line exits the script immediately with 1 If RETVAL is 0, the && condition is not met and start() falls through with a return value of 1 The line after the start function call assigns that return code to RETVAL and then the script exits with $RETVAL (which is the 1 the failed conditional returns and not the 0 the deamon glusterd command returns) case $1 in start) start RETVAL=$? ;; ... exit $RETVAL Prior versions did not assign RETVAL after the return of the start() function and ended the script with an exit 0
http://review.gluster.org/4349 for review
CHANGE: http://review.gluster.org/4349 (extras: Don't update RETVAL with invalid value.) merged in master by Anand Avati (avati)
marking it fixed for 2.1.0. Moving to MODIFIED. Won't change it in 2.0.z right now.
Per 03/05 email exchange w/ PM, targeting for Arches.
Per 04-10-2013 Storage bug triage meeting, targeting for Big Bend.
Tested version: glusterfs-server-3.4.0.14rhs Steps taken to reproduce/verify: 1. Stop glusterd 2. Start glusterd [root ~]# service glusterd start; echo $?; service glusterd status Starting glusterd:[ OK ] 0 glusterd (pid 31690) is running... 3. Stop glusterd [root ~]# service glusterd stop; echo $? Stopping glusterd:[ OK ] 0 4. Edit /etc/glusterfs/glusterd.vol and add line with xxxxxxxxxxxx [root ~]# service glusterd start; echo $?; service glusterd status Starting glusterd:[FAILED] 1 glusterd is stopped 5. Remove erroneous line from /etc/glusterfs/glusterd.vol 6. Start glusterd [root ~]# service glusterd start; echo $?; service glusterd status Starting glusterd:[ OK ] 0 glusterd (pid 31887) is running... 7. ps to confirm process is running. Result: Unable to reproduce original issue. Fail returns 1. Success returns 0 as expected. Moving to verified.
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