mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-11 08:19:29 +00:00
2c9744fe56
Make the systemd wrapper chech if HAPROXY_STATS_SOCKET if set. If set, it will use it as an argument to the "-x" option, which makes haproxy asks for any listening socket, on the stats socket, in order to achieve reloads with no new connection lost.
18 lines
523 B
SYSTEMD
18 lines
523 B
SYSTEMD
[Unit]
|
|
Description=HAProxy Load Balancer
|
|
After=network.target
|
|
|
|
[Service]
|
|
# You can point the environment variable HAPROXY_STATS_SOCKET to a stats
|
|
# socket if you want seamless reloads.
|
|
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=@SBINDIR@/haproxy -f $CONFIG -c -q
|
|
ExecReload=/bin/kill -USR2 $MAINPID
|
|
KillMode=mixed
|
|
Restart=always
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|