-
-
Save jpuskar/00f0ab95a8b02d9e30691d89116426c1 to your computer and use it in GitHub Desktop.
Seamless haproxy on marathon-lb w/ systemd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/haproxy.service.d/haproxy_cluster_vars.conf | |
[Service] | |
Environment="PIDFILE=/run/haproxy.pid" | |
Environment="HAPROXY_SOCKET=/var/run/haproxy/socket" | |
# Get rid of the socket on start/stop | |
ExecStartPre=/bin/bash -c "rm -f $HAPROXY_SOCKET" | |
ExecStopPost=/bin/bash -c "rm -f $HAPROXY_SOCKET" | |
# XXX: Do seamless reloads | |
ExecReload= | |
ExecReload=/usr/sbin/haproxy -c -f ${CONFIG} | |
ExecReload=-/bin/bash -c 'echo > /var/state/haproxy/global && \ | |
/usr/bin/socat /var/run/haproxy/socket - <<< "show servers state" > /var/state/haproxy/global' | |
ExecReload=/bin/kill -USR2 $MAINPID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment