diff -Nru haproxy-1.4.24/debian/changelog haproxy-1.4.24/debian/changelog --- haproxy-1.4.24/debian/changelog 2015-07-22 18:12:26.000000000 +0200 +++ haproxy-1.4.24/debian/changelog 2015-09-23 17:49:32.000000000 +0200 @@ -1,3 +1,11 @@ +haproxy (1.4.24-2ubuntu0.3) trusty; urgency=medium + + * debian/haproxy.init: + - Loops through all PIDs present in the PIDFILE when + nproc > 1 (LP: #1481737) + + -- Louis Bouchard Wed, 23 Sep 2015 17:45:41 +0200 + haproxy (1.4.24-2ubuntu0.2) trusty; urgency=high * debian/haproxy.init: diff -Nru haproxy-1.4.24/debian/haproxy.init haproxy-1.4.24/debian/haproxy.init --- haproxy-1.4.24/debian/haproxy.init 2015-07-22 18:12:24.000000000 +0200 +++ haproxy-1.4.24/debian/haproxy.init 2015-09-23 18:11:22.000000000 +0200 @@ -30,6 +30,15 @@ [ -f /etc/default/rcS ] && . /etc/default/rcS . /lib/lsb/init-functions +clean() +{ +if [ -e "$tmp" ];then + rm -f "$tmp" +fi +exit +} + +trap clean EXIT check_haproxy_config() { @@ -52,14 +61,19 @@ haproxy_stop() { + tmp=$(tempfile -s .haproxy.init) + if [ ! -f $PIDFILE ] ; then # This is a success according to LSB return 0 fi ret=0 - start-stop-daemon --quiet --oknodo --stop \ - --retry 5 --pidfile $PIDFILE --exec $HAPROXY || ret=$? + for pid in $(cat $PIDFILE); do + echo $pid > "$tmp" + start-stop-daemon --quiet --oknodo --stop \ + --retry 5 --pidfile "$tmp" --exec $HAPROXY || ret=$? + done [ $ret -eq 0 ] && rm -f $PIDFILE