diff -Nru haproxy-1.5.4/debian/changelog haproxy-1.5.4/debian/changelog --- haproxy-1.5.4/debian/changelog 2014-09-23 14:06:46.000000000 -0300 +++ haproxy-1.5.4/debian/changelog 2015-06-08 14:25:20.000000000 -0300 @@ -1,3 +1,11 @@ +haproxy (1.5.4-1ubuntu2) utopic; urgency=medium + + * debian/haproxy.init: Backport of vivid stop routine, + uses start-stop-daemon to reliable terminate all haproxy processes + and return the proper exit code. (LP: #1462495) + + -- Jorge Niedbalski Mon, 08 Jun 2015 14:19:56 -0300 + haproxy (1.5.4-1ubuntu1) utopic; urgency=medium * haproxy.init: return 0 on stop if haproxy was not running. (LP: #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-23 14:06:14.000000000 -0300 +++ haproxy-1.5.4/debian/haproxy.init 2015-06-08 14:25:40.000000000 -0300 @@ -59,13 +59,16 @@ # This is a success according to LSB return 0 fi - for pid in $(cat $PIDFILE) ; do - if kill -0 $pid 2>/dev/null; then - /bin/kill $pid || return 4 - fi + + ret=0 + for pid in $(cat $PIDFILE); do + start-stop-daemon --quiet --oknodo --stop \ + --retry 5 --pid $pid --exec $HAPROXY || ret=$? done - rm -f $PIDFILE - return 0 + + [ $ret -eq 0 ] && rm -f $PIDFILE + + return $ret } haproxy_reload()