Bug 151104

Summary: LSB: 'functions' should return 0 if a program isn't running and 'stop' is called
Product: Red Hat Enterprise Linux 4 Reporter: Lon Hohberger <lhh>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED NEXTRELEASE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: alanr, axel.thimm, herrold, jbacik, jos, kupcevic, nstrug, omer, rvokal, tao, troels, trondeg, tvr1
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-14 22:20:13 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:
Attachments:
Description Flags
Patch from Alan Robertson none

Description Lon Hohberger 2005-03-14 22:11:59 UTC
Description of problem:

Quoting:
http://refspecs.freestandards.org/LSB_2.0.1/LSB-Core/LSB-Core/iniscrptact.html

[quote]
In the case of init script commands other than "status" (i.e., "start", "stop",
"restart", "try-restart", "reload", and "force-reload"), the init script shall
return an exit status of zero if the action described by the argument has been
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 runnin
[/quote]

Example:

[root@red daemons]# service httpd status
httpd (pid 19925 19922 19919) is running...
[root@red daemons]# service httpd stop
Stopping httpd:                                            [  OK  ]
[root@red daemons]# service httpd stop
Stopping httpd:                                            [FAILED]

An example of a real-world problem this causes:

This prevents 'stop' from succeeding when not-running, which prevents
stop-before-start and stop-after-stop actions from succeeding in high
availability environments.

Comment 1 Lon Hohberger 2005-03-14 22:11:59 UTC
Created attachment 111998 [details]
Patch from Alan Robertson

Comment 2 Bill Nottingham 2005-03-14 22:20:13 UTC
True. 

However, changing this post-release in RHEL is *begging* for regressions and
customer confusion, as it's a rather obvious behavior change. Hence, WONTFIX for
RHEL 4 (and by extension, RHEL 3.)

Comment 3 Bill Nottingham 2005-03-14 22:22:10 UTC
Fixed in CVS for Fedora Core. Will run with this for a while, we'll see what
happens with the change for RHEL 5 or later.

Comment 4 Lon Hohberger 2005-03-14 22:35:17 UTC
Rad, thanks.

Comment 5 Nick Strugnell 2005-11-23 16:57:06 UTC
*** Bug 173991 has been marked as a duplicate of this bug. ***

Comment 6 Nick Strugnell 2005-11-23 17:04:05 UTC
Bug 173991 (which is a dupe) notes that this breaks the restart service
functionality in clustersuite.

Comment 9 Omer Faruk Sen 2006-02-15 08:45:15 UTC
Patch in the URL https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=111998
doesn't work with mysqld init script it seems that all scripts should be revised
if it is working or not with this patch. Httpd seems to work with this page
though.. (returning 0 even if service is not working..)

Comment 12 Bill Nottingham 2006-07-14 16:33:08 UTC
*** Bug 170735 has been marked as a duplicate of this bug. ***

Comment 13 Bill Nottingham 2006-08-24 13:56:39 UTC
*** Bug 203901 has been marked as a duplicate of this bug. ***

Comment 19 Lon Hohberger 2007-03-19 16:59:44 UTC
Fixed in RHEL5

Comment 20 Alan Robertson 2007-03-20 12:53:39 UTC
Thanks Lon!  Thanks Bill!

Comment 21 Bill Nottingham 2007-04-19 18:14:58 UTC
*** Bug 237149 has been marked as a duplicate of this bug. ***