Hi list,

I don't use systemd myself but I think the attached patch might be still very useful.

--
Regards,
Christian Ruppert

#gernePerDu / #CallMeByMyFirstName
From a0e57ca4958e22107ee117e2bbe14b4525496a9a Mon Sep 17 00:00:00 2001
From: Christian Ruppert <[email protected]>
Date: Tue, 9 Jun 2026 17:36:39 +0200
Subject: [PATCH] MEDIUM: systemd: Check for CFGDIR and create it if necessary

90c5618 adds a new config directory, CFGDIR / conf.d. As it is
mandatory, upgrading from <3.4 to >=3.4 and not having it might cause a
downtime because during a restart, systemd will stop haproxy and try to
start it again, which fails due to the directory being missing.
See e.g. https://bugs.gentoo.org/977119
So using ConfigurationDirectory (relative to /etc/) will make sure it
exists and if not, it's being created by systemd.
This should make upgrades less painful

Signed-off-by: Christian Ruppert <[email protected]>
---
 admin/systemd/haproxy.service.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/admin/systemd/haproxy.service.in b/admin/systemd/haproxy.service.in
index b5dddfb79..7593cdfe7 100644
--- a/admin/systemd/haproxy.service.in
+++ b/admin/systemd/haproxy.service.in
@@ -4,6 +4,7 @@ After=network-online.target
 Wants=network-online.target
 
 [Service]
+ConfigurationDirectory=haproxy/conf.d
 EnvironmentFile=-/etc/default/haproxy
 EnvironmentFile=-/etc/sysconfig/haproxy
 Environment="CONFIG=/etc/haproxy/haproxy.cfg" "PIDFILE=/run/haproxy.pid" "CFGDIR=/etc/haproxy/conf.d" "EXTRAOPTS=-S /run/haproxy-master.sock"
-- 
2.53.0

Reply via email to