[Unit]
Description=HAProxy Load Balancer
After=network.target

[Service]
Environment="HAPROXY_CONF=/etc/haproxy/haproxy.cfg" "PIDFILE=/run/haproxy.pid"
ExecStartPre=/usr/sbin/haproxy -f $HAPROXY_CONF -c -q
# -W: master-worker mode
ExecStart=/usr/sbin/haproxy -Ws -f $HAPROXY_CONF -p $PIDFILE
ExecReload=/usr/sbin/haproxy -f $HAPROXY_CONF -c -q
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed
Type=notify

[Install]
WantedBy=multi-user.target
