From: Pavlos Parissis Date: Tue, 14 Jun 2016 11:28:20 +0000 (+0200) Subject: MINOR: systemd: Use variable for config and pidfile paths X-Git-Tag: v1.7-dev4~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc23a79f34cc5a34572526e8f13b97e28dd09aca;p=thirdparty%2Fhaproxy.git 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 --- diff --git a/contrib/systemd/haproxy.service.in b/contrib/systemd/haproxy.service.in index 85937e41e0..5f6c7d9761 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