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
Propose it for 5.3 exception. It should be a fairly simple fix.
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.
(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.
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