Browse Source

haproxy: patches from upstream

 -[PATCH 1/2] BUG/MEDIUM: systemd: set KillMode to 'mixed'
 -[PATCH 2/2] BUG/MEDIUM: config: avoid skipping disabled proxies

Signed-off-by: Thomas Heil <heil@terminal-consulting.de>
Thomas Heil 10 years ago
parent
commit
0e45b40fb5

+ 1
- 1
net/haproxy/Makefile View File

10
 
10
 
11
 PKG_NAME:=haproxy
11
 PKG_NAME:=haproxy
12
 PKG_VERSION:=1.5.5
12
 PKG_VERSION:=1.5.5
13
-PKG_RELEASE:=00
13
+PKG_RELEASE:=02
14
 PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
14
 PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
15
 PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.5/src/
15
 PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.5/src/
16
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
16
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)

+ 41
- 0
net/haproxy/patches/0001-BUG-MEDIUM-systemd-set-KillMode-to-mixed.patch View File

1
+From 1f24e3fee3aba83fb3338d17589d0ad0f34f6c73 Mon Sep 17 00:00:00 2001
2
+From: Apollon Oikonomopoulos <apoikos@debian.org>
3
+Date: Wed, 8 Oct 2014 15:14:41 +0300
4
+Subject: [PATCH 1/2] BUG/MEDIUM: systemd: set KillMode to 'mixed'
5
+
6
+By default systemd will send SIGTERM to all processes in the service's
7
+control group. In our case, this includes the wrapper, the master
8
+process and all worker processes.
9
+
10
+Since commit c54bdd2a the wrapper actually catches SIGTERM and survives
11
+to see the master process getting killed by systemd and regard this as
12
+an error, placing the unit in a failed state during "systemctl stop".
13
+
14
+Since the wrapper now handles SIGTERM by itself, we switch the kill mode
15
+to 'mixed', which means that systemd will deliver the initial SIGTERM to
16
+the wrapper only, and if the actual haproxy processes don't exit after a
17
+given amount of time (default: 90s), a SIGKILL is sent to all remaining
18
+processes in the control group. See systemd.kill(5) for more
19
+information.
20
+
21
+This should also be backported to 1.5.
22
+(cherry picked from commit 74f016985ab1fa7a6a5afa301d982e77eba9c96a)
23
+---
24
+ contrib/systemd/haproxy.service.in | 1 +
25
+ 1 file changed, 1 insertion(+)
26
+
27
+diff --git a/contrib/systemd/haproxy.service.in b/contrib/systemd/haproxy.service.in
28
+index 1a3d2c0..0bc5420 100644
29
+--- a/contrib/systemd/haproxy.service.in
30
++++ b/contrib/systemd/haproxy.service.in
31
+@@ -5,6 +5,7 @@ After=network.target
32
+ [Service]
33
+ ExecStart=@SBINDIR@/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
34
+ ExecReload=/bin/kill -USR2 $MAINPID
35
++KillMode=mixed
36
+ Restart=always
37
+ 
38
+ [Install]
39
+-- 
40
+1.8.5.5
41
+

+ 39
- 0
net/haproxy/patches/0002-BUG-MEDIUM-config-avoid-skipping-disabled-proxies.patch View File

1
+From 4ab232ce2fbdaf9b871c411fc7284096219bb854 Mon Sep 17 00:00:00 2001
2
+From: Willy Tarreau <w@1wt.eu>
3
+Date: Fri, 10 Oct 2014 14:54:25 +0200
4
+Subject: [PATCH 2/2] BUG/MEDIUM: config: avoid skipping disabled proxies
5
+
6
+Paul Taylor and Bryan Talbot found that after commit 419ead8 ("MEDIUM:
7
+config: compute the exact bind-process before listener's maxaccept"),
8
+a backend marked "disabled" would cause the next backend to be skipped
9
+and if it was the last one it would cause a segfault.
10
+
11
+The reason is that the commit above changed the "while" loop for a "for"
12
+loop but a "continue" statement still incrementing the current proxy was
13
+left in the code for disabled proxies, causing the next one to be skipped
14
+as well and the last one to try to dereference NULL when seeking ->next.
15
+
16
+The quick workaround consists in not disabling backends, or adding an
17
+empty dummy one after a disabled section.
18
+
19
+This fix must be backported to 1.5.
20
+(cherry picked from commit 06cc905813f1858c0606b44d1e271bd0b6a25224)
21
+---
22
+ src/cfgparse.c | 1 -
23
+ 1 file changed, 1 deletion(-)
24
+
25
+diff --git a/src/cfgparse.c b/src/cfgparse.c
26
+index ec6d923..392a692 100644
27
+--- a/src/cfgparse.c
28
++++ b/src/cfgparse.c
29
+@@ -6104,7 +6104,6 @@ int check_config_validity()
30
+ 		if (curproxy->state == PR_STSTOPPED) {
31
+ 			/* ensure we don't keep listeners uselessly bound */
32
+ 			stop_proxy(curproxy);
33
+-			curproxy = curproxy->next;
34
+ 			continue;
35
+ 		}
36
+ 
37
+-- 
38
+1.8.5.5
39
+