Created attachment 883444 [details] An experimental patch of /etc/rc.d/init.d/pulp-server Description of problem: /etc/rc.d/init.d/pulp-server does not follow the LSB init script spec [1] and returns wrong exit code (1) with 'status' argument passed when the service is stopped (is not running). This causes trouble to monitor the pulp-server service from outside. [root@rhua ~]# service pulp-server stop Stopping httpd: [ OK ] Stopping Qpid AMQP daemon: [ OK ] Stopping mongod: [ OK ] [root@rhua ~]# service pulp-server status; echo $? mongod is stopped 1 [root@rhua ~]# [1] http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html Version-Release number of selected component (if applicable): [root@rhua ~]# rpm -qf /etc/rc.d/init.d/pulp-server pulp-0.0.263-43.el6_5.noarch [root@rhua ~]# How reproducible: Always Steps to Reproduce: 1. service pulp-server stop 2. service pulp-server status; echo $? Actual results: pulp-server exits with the exit code '1' when stopped. Expected results: It should exits with the exit code '3' (means stopped). Additional info: I wrote an experimental patch may fix this issue. pulp-server is modified version and pulp-server.save is original in the following: [root@rhua ~]# service pulp-server status mongod (pid 23606) is running... httpd (pid 23646) is running... qpidd (pid 23613) is running... [root@rhua ~]# echo $? 0 [root@rhua ~]# service pulp-server stop Stopping httpd: [ OK ] Stopping Qpid AMQP daemon: [ OK ] Stopping mongod: [ OK ] [root@rhua ~]# service pulp-server status; echo $? mongod is stopped httpd is stopped qpidd is stopped 3 [root@rhua ~]# /etc/rc.d/init.d/pulp-server.save status ; echo $? mongod is stopped 1 [root@rhua ~]# /etc/rc.d/init.d/pulp-server help; echo $? Usage: pulp-server {init|start|stop|status|restart} # I don't think this is an error but I'm not sure. 0 [root@rhua ~]#
Created attachment 883445 [details] The patch for /etc/rc.d/init.d/pulp-server to make it compatible with LSB init script spec. I missed the explanation of the LSB init script spec [1], In case of an error while processing any init-script action except for status, the init script shall print an error message and exit with a non-zero status code: 1 generic or unspecified error (current practice) 2 invalid or excess argument(s) 3 unimplemented feature (for example, "reload") ... and updated the patch to make it comply with the above. [1] http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html Example session log of /etc/rc.d/init.d/pulp-server with the patch applied: [root@rhua ~]# service pulp-server try-restart; echo $? Not implemented: try-restart 3 [root@rhua ~]# service pulp-server reload; echo $? Not implemented: reload 3 [root@rhua ~]# service pulp-server force-reload; echo $? Not implemented: force-reload 3 [root@rhua ~]# service pulp-server monitor; echo $? Usage: pulp-server {init|start|stop|status|restart} 2 [root@rhua ~]#
This should be resolved by the newer pulp version in RHUI-3
>> for i in httpd qpidd mongod; do systemctl stop $i; done ... >> systemctl status httpd; echo $1 ... 3 >> systemctl status qpidd; echo $1 ... 3 >> systemctl status mongod; echo $1 ... 3 Checked on RHUI3 iso 20160531
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:0367