From 31f137976c4b289e83a90ab5901d9a32922d2d1e Mon Sep 17 00:00:00 2001 From: Zach Dykstra Date: Sun, 8 Aug 2021 23:52:29 -0500 Subject: [PATCH] haproxy: enable hitless reloads Switch HAProxy to a master/worker (-W) model, allowing for correct handling of HUP signals. To do listening FD handoff, a stats socket with 'expose-fd listeners' needs to be part of the configuration file. --- srcpkgs/haproxy/files/haproxy.cfg | 1 + srcpkgs/haproxy/files/haproxy/run | 4 +++- srcpkgs/haproxy/template | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/srcpkgs/haproxy/files/haproxy.cfg b/srcpkgs/haproxy/files/haproxy.cfg index 039a2d1e0870..3706f7eb3ca3 100644 --- a/srcpkgs/haproxy/files/haproxy.cfg +++ b/srcpkgs/haproxy/files/haproxy.cfg @@ -2,6 +2,7 @@ global chroot /var/lib/haproxy user haproxy group haproxy + stats socket /var/run/haproxy.sock mode 0600 level admin expose-fd listeners process 1/1 defaults mode http diff --git a/srcpkgs/haproxy/files/haproxy/run b/srcpkgs/haproxy/files/haproxy/run index 34307dbdaac9..59d6f810fcce 100755 --- a/srcpkgs/haproxy/files/haproxy/run +++ b/srcpkgs/haproxy/files/haproxy/run @@ -1,3 +1,5 @@ #!/bin/sh -exec haproxy -f /etc/haproxy/haproxy.cfg +exec haproxy -W \ + -p /var/run/haproxy.pid \ + -f /etc/haproxy/haproxy.cfg diff --git a/srcpkgs/haproxy/template b/srcpkgs/haproxy/template index b4e2d8929dc3..c155186f100d 100644 --- a/srcpkgs/haproxy/template +++ b/srcpkgs/haproxy/template @@ -1,7 +1,7 @@ # Template file for 'haproxy' pkgname=haproxy version=2.4.2 -revision=1 +revision=2 build_style=gnu-makefile make_install_args="SBINDIR=${DESTDIR}/usr/bin DOCDIR=${DESTDIR}/usr/share/doc/${pkgname}" hostmakedepends="lua53-devel"