Bug 151104 - LSB: 'functions' should return 0 if a program isn't running and 'stop' is called
LSB: 'functions' should return 0 if a program isn't running and 'stop' is called
Status: CLOSED NEXTRELEASE
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: initscripts (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
: 170735 173991 203901 237149 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-14 17:11 EST by Lon Hohberger
Modified: 2014-03-16 22:52 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-14 17:20:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch from Alan Robertson (312 bytes, patch)
2005-03-14 17:11 EST, Lon Hohberger
no flags Details | Diff

  None (edit)
Description Lon Hohberger 2005-03-14 17:11:59 EST
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 17:11:59 EST
Created attachment 111998 [details]
Patch from Alan Robertson
Comment 2 Bill Nottingham 2005-03-14 17:20:13 EST
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 17:22:10 EST
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 17:35:17 EST
Rad, thanks.
Comment 5 Nick Strugnell 2005-11-23 11:57:06 EST
*** Bug 173991 has been marked as a duplicate of this bug. ***
Comment 6 Nick Strugnell 2005-11-23 12:04:05 EST
Bug 173991 (which is a dupe) notes that this breaks the restart service
functionality in clustersuite.
Comment 9 Omer Faruk Sen 2006-02-15 03:45:15 EST
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 12:33:08 EDT
*** Bug 170735 has been marked as a duplicate of this bug. ***
Comment 13 Bill Nottingham 2006-08-24 09:56:39 EDT
*** Bug 203901 has been marked as a duplicate of this bug. ***
Comment 19 Lon Hohberger 2007-03-19 12:59:44 EDT
Fixed in RHEL5
Comment 20 Alan Robertson 2007-03-20 08:53:39 EDT
Thanks Lon!  Thanks Bill!
Comment 21 Bill Nottingham 2007-04-19 14:14:58 EDT
*** Bug 237149 has been marked as a duplicate of this bug. ***

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