Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4832

Haproxy seamless reload by changing unit file

$
0
0

@barapapupi wrote:

Hi, I have the following haproxy systemd unit file
Just the defaults.
[Unit]
Description=HAProxy Load Balancer
After=network.target

[Service]
Environment=“CONFIG=/etc/haproxy/haproxy.cfg” “PIDFILE=/run/haproxy.pid”
ExecStartPre=@SBINDIR@/haproxy -f $CONFIG -c -q
ExecStart=@SBINDIR@/haproxy -Ws -f $CONFIG -p $PIDFILE
ExecReload=@SBINDIR@/haproxy -f $CONFIG -c -q
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed
Restart=always
SuccessExitStatus=143
Type=notify

[Install]
WantedBy=multi-user.target

So just the defaults from version 1.8

using systemctl reload haproxy.service works fine and reloads a new process.
However I would like to change the unit file to do
Environment=“CONFIG=/etc/haproxy/haproxy_new.cfg” “PIDFILE=/run/haproxy.pid”

and then reload, after doing a daemon-reload.
However when I check the process running, its always running with the old /etc/haproxy/haproxy.cfg and not with the new /etc/haproxy/haproxy_new.cfg

I understand that this is not conventional, but I’m required to stick to creating a new config file and recreate the unit file and then do a reload.
Can someone help me on how to achieve the above?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4832

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>