Bug 237149

Summary: killproc returns wrong status code in case where service is already stopped
Product: Red Hat Enterprise Linux 4 Reporter: Tarun Reddy <tvr1>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED DUPLICATE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://refspecs.freestandards.org/LSB_2.0.1/LSB-Core/LSB-Core/iniscrptact.html
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-19 18:14:45 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 Tarun Reddy 2007-04-19 18:04:13 UTC
Description of problem:
When doing an /etc/init.d/<service> stop on a stopped service, the script
returns incorrectly $?=1 instead of the correct 0 (per LSB in URL). This is
changed in RHEL5 to the correct behavior.

Version-Release number of selected component (if applicable):
initscripts-7.93.25.EL

How reproducible:
Always

Steps to Reproduce:
1./etc/init.d/httpd start  (returns 0)
2./etc/init.d/httpd stop   (returns 0)
3./etc/init.d/httpd stop   (returns 1!)
  
Actual results:
echo $? returns 1

Expected results:
echo $? should return 0

Additional info:
This causes issues in a clustered environment such as RHCS where the cluster
manager tries to stop the service and gets a failed error code and refuses to
continue. You must manually bring up the service (so that the stop returns a 0)
before being able to re-enable the clustered service.

Comment 1 Bill Nottingham 2007-04-19 18:14:45 UTC
Correct. However, this is a behavior change that could affect existing scripts,
so the decision was made to not change this for RHEL 4.

*** This bug has been marked as a duplicate of 151104 ***