Package: haproxy
Version: 1.5.4-1
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu utopic ubuntu-patch

Dear Maintainer,

pacemaker was running haproxy.  haproxy was killed by oom.  pacemaker
tries to stop then start haproxy, but fails because stop failed with 4
rather than exiting with 0.  Since haproxy was in fact stopped after
the 'service haproxy stop' call, 0 should be returned rather than 4
(by my reading of http://www.debian.org/doc/debian-policy/ch-opersys.html)

*** /tmp/tmpykD9sX/bug_body

In Ubuntu, the attached patch was applied to achieve the following:

  * haproxy.init: return 0 on stop if haproxy was not running.  (LP: #1038139)


Thanks for considering the patch.


-- System Information:
Debian Release: jessie/sid
  APT prefers utopic-updates
  APT policy: (500, 'utopic-updates'), (500, 'utopic-security'), (500, 
'utopic'), (100, 'utopic-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-16-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Description: check whether haproxy is running before killing it
 If 'service haproxy stop' is called when haproxy is already not
 running, then stop currently returns 4.  This patch will make it
 return 0, since 'stop' had the expected end result (haproxy is stopped)
Author: ariel-cafelug
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/haproxy/+bug/1038139

diff -Nru haproxy-1.5.4/debian/haproxy.init haproxy-1.5.4/debian/haproxy.init
--- haproxy-1.5.4/debian/haproxy.init	2014-09-02 12:26:00.000000000 -0500
+++ haproxy-1.5.4/debian/haproxy.init	2014-09-23 12:06:14.000000000 -0500
@@ -60,7 +60,9 @@
 		return 0
 	fi
 	for pid in $(cat $PIDFILE) ; do
-		/bin/kill $pid || return 4
+                if kill -0 $pid 2>/dev/null; then
+		    /bin/kill $pid || return 4
+                fi
 	done
 	rm -f $PIDFILE
 	return 0

Reply via email to