# From http://www.bolthole.com/linux # This is for haproxy demons NOT compiled with systemd support. # So no "-Ws" option # Install to /etc/systemd/system/haproxy2.service [Unit] Description=HAProxy 2 Load Balancer After=network.target [Service] Environment="CONFIG=/etc/haproxy/conf.d" "PIDFILE=/var/run/haproxy.pid" # validate config file first ExecStartPre=/usr/local/sbin/haproxy -f /etc/haproxy/conf.d -c -q ExecStart=/usr/local/sbin/haproxy -W -f /etc/haproxy/conf.d ExecReload=/usr/local/sbin/haproxy -f /etc/haproxy/conf.d -c -q ExecReload=/bin/kill -USR2 $MAINPID ExecStop=/bin/kill -USR1 $MAINPID KillMode=process Restart=always Type=forking [Install] WantedBy=multi-user.target