Ubuntu Pastebin

Paste from ubuntu at Fri, 6 Nov 2015 20:04:32 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
--- /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
 
Download as text