Skip to content

Instantly share code, notes, and snippets.

@wiennat
Created December 16, 2017 06:26
Show Gist options
  • Select an option

  • Save wiennat/0c87a7dbe131719210ac096a934a20c4 to your computer and use it in GitHub Desktop.

Select an option

Save wiennat/0c87a7dbe131719210ac096a934a20c4 to your computer and use it in GitHub Desktop.
haproxy unit file for ubuntu
[Unit]
Description=HAProxy Load Balancer
Documentation=man:haproxy(1)
Documentation=file:/usr/share/doc/haproxy/configuration.txt.gz
After=network.target rsyslog.service
[Service]
# You can point the environment variable HAPROXY_STATS_SOCKET to a stats
# socket if you want seamless reloads.
EnvironmentFile=-/etc/default/haproxy
Environment="CONFIG=/etc/haproxy/haproxy.cfg" "PIDFILE=/run/haproxy.pid"
ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS
ExecStart=/usr/sbin/haproxy -Ws -f $CONFIG -p $PIDFILE $EXTRAOPTS
ExecReload=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed
Restart=always
Type=notify
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment