--- /etc/init.d/haproxy.dist 2015-11-06 19:35:57.368000000 +0000
+++ /etc/init.d/haproxy 2015-11-06 20:04:15.216000000 +0000
@@ -61,10 +61,17 @@
fi
ret=0
+
+ # older versions of start-stop-daemon do not have --pid flag
+ # the ubuntu delta here is to implement --pid with a loop over
+ # --pidfile and a temp file.
+ tmpf=$(mktemp) || return 1
for pid in $(cat $PIDFILE); do
+ echo "$pid" > "$tmpf"
start-stop-daemon --quiet --oknodo --stop \
- --retry 5 --pid $pid --exec $HAPROXY || ret=$?
+ --retry 5 --pidfile "$tmpf" --exec $HAPROXY || ret=$?
done
+ rm -f "$tmpf"
[ $ret -eq 0 ] && rm -f $PIDFILE