Bug 462812 - [5.3] Init scripts shall ensure that they will behave sensibly with stop when not running
[5.3] Init scripts shall ensure that they will behave sensibly with stop when...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kexec-tools (Show other bugs)
5.2
All Linux
medium Severity medium
: rc
: ---
Assigned To: Neil Horman
Martin Jenner
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-18 22:27 EDT by CAI Qian
Modified: 2008-09-21 20:20 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-09-21 20:20:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description CAI Qian 2008-09-18 22:27:40 EDT
Description of problem:
From LSB specification,

"Init scripts shall ensure that they will behave sensibly if invoked with start when the service is already running, or with stop when not running, and that they do not kill similarly-named user processes."

http://refspecs.linux-foundation.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

However, kexec-tools init scripts do not,

# service kdump stop
Stopping kdump:[  OK  ]
# service kdump stop
Stopping kdump:[  OK  ]


Version-Release number of selected component (if applicable):
kexec-tools-1.102pre-21.el5

How reproducible:
always
Comment 1 CAI Qian 2008-09-18 22:29:48 EDT
Propose it for 5.3 exception. It should be a fairly simple fix.
Comment 2 Neil Horman 2008-09-19 11:22:30 EDT
wait a second...This is NOTABUG
 

from http://refspecs.linux-foundation.org/LSB_3.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

We already stopped, so the stop action reports success, as per the spec.
Comment 3 CAI Qian 2008-09-20 23:09:34 EDT
(In reply to comment #2)
> wait a second...This is NOTABUG
> 
> 
> from
> http://refspecs.linux-foundation.org/LSB_3.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:
> 

I believe this is talking about the exit code. Looking at other daemons,

[root@walsinh ~]# /etc/init.d/nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
[root@walsinh ~]# /etc/init.d/nfs stop
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
[root@walsinh ~]# /etc/init.d/nfs stop
Shutting down NFS mountd:                                  [FAILED]
Shutting down NFS daemon:                                  [FAILED]
Shutting down NFS services:                                [FAILED]
[root@walsinh ~]# echo $?
0

[root@walsinh ~]# /etc/init.d/httpd start
Starting httpd:                                            [  OK  ]
[root@walsinh ~]# /etc/init.d/httpd stop
Stopping httpd:                                            [  OK  ]
[root@walsinh ~]# /etc/init.d/httpd stop
Stopping httpd:                                            [FAILED]
[root@walsinh ~]# echo $?
0

They look like behaving sensibly when the service is with stop when not running.
Comment 4 Neil Horman 2008-09-21 20:20:43 EDT
I think you're really spliting hairs here on what is implied in the word 'sensibly'.  The fact that other daemons report failure when stopping an already stopped service but exit with a success exit code is confusing and rather not sensible.  Regardless, the fact that we successfully stop when kexec wasn't running to begin with still makes perfectly good sense.  After stopping the service the kdump kernel is removed from the kernels reserved memory and unavailable, weather or not it was before.  This is NOTABUG

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