Source: haproxy
Version: 1.6.2-2
Followup-For: Bug #804530

Revise debdiff based on discussion; main work is from Louis Bouchard (see 
https://bugs.launchpad.net/ubuntu/+source/haproxy/+bug/1481737).

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

Kernel: Linux 4.2.0-16-generic (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -Nru haproxy-1.6.2/debian/haproxy.init haproxy-1.6.2/debian/haproxy.init
--- haproxy-1.6.2/debian/haproxy.init	2015-11-03 20:21:36.000000000 +0000
+++ haproxy-1.6.2/debian/haproxy.init	2015-11-09 14:35:13.000000000 +0000
@@ -29,6 +29,13 @@
 [ -f /etc/default/rcS ] && . /etc/default/rcS
 . /lib/lsb/init-functions
 
+tmp_pidfile=$(tempfile -s .haproxy.init)
+
+clean()
+{
+	rm -f $tmp_pidfile
+}
+trap clean EXIT
 
 check_haproxy_config()
 {
@@ -62,8 +69,9 @@
 
 	ret=0
 	for pid in $(cat $PIDFILE); do
-		start-stop-daemon --quiet --oknodo --stop \
-			--retry 5 --pid $pid --exec $HAPROXY || ret=$?
+		echo $pid > $tmp_pidfile
+  		start-stop-daemon --quiet --oknodo --stop \
+			--retry 5 --pidfile $tmp_pidfile --exec $HAPROXY || ret=$?
 	done
 
 	[ $ret -eq 0 ] && rm -f $PIDFILE

Reply via email to