Hi,

Please consider merging the attached patch which allows users to set the 
location of
haproxy.cfg and pidfile files by providing a systemd overwrite file
/etc/systemd/system/haproxy.service.d/overwrite.conf with the following content:

    [Service]
    Environment=CONFIG=/etc/foobar/haproxy.cfg


Cheers,
Pavlos
From 9ddd9e802cbd86d30acb56053b513b18253c4892 Mon Sep 17 00:00:00 2001
From: Pavlos Parissis <[email protected]>
Date: Tue, 14 Jun 2016 13:28:20 +0200
Subject: [PATCH] MINOR: systemd: Use variable for config and pidfile paths

Users can set the location of haproxy.cfg and pidfile files by providing
a systemd overwrite file /etc/systemd/system/haproxy.service.d/overwrite.conf
with the following content:

    [Service]
    Environment=CONFIG=/etc/foobar/haproxy.cfg
---
 contrib/systemd/haproxy.service.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/systemd/haproxy.service.in b/contrib/systemd/haproxy.service.in
index 85937e4..5f6c7d9 100644
--- a/contrib/systemd/haproxy.service.in
+++ b/contrib/systemd/haproxy.service.in
@@ -3,8 +3,9 @@ Description=HAProxy Load Balancer
 After=network.target
 
 [Service]
-ExecStartPre=@SBINDIR@/haproxy -f /etc/haproxy/haproxy.cfg -c -q
-ExecStart=@SBINDIR@/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
+Environment="CONFIG=/etc/haproxy/haproxy.cfg" "PIDFILE=/run/haproxy.pid"
+ExecStartPre=@SBINDIR@/haproxy -f $CONFIG -c -q
+ExecStart=@SBINDIR@/haproxy-systemd-wrapper -f $CONFIG -p $PIDFILE
 ExecReload=/bin/kill -USR2 $MAINPID
 KillMode=mixed
 Restart=always
-- 
2.1.4

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to