Skip to content

Commit

Permalink
Merge pull request #719 from jcmoraisjr/jm-fix-reload
Browse files Browse the repository at this point in the history
Fix reload failure if admin socket refuses connection
  • Loading branch information
jcmoraisjr authored Jan 10, 2021
2 parents dc17e35 + f9f7478 commit 00e0a95
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rootfs/haproxy-reload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ set -e
HAPROXY_SOCKET=/var/run/haproxy/admin.sock
HAPROXY_STATE=/var/lib/haproxy/state-global
if [ -S $HAPROXY_SOCKET ]; then
echo "show servers state" | socat $HAPROXY_SOCKET - > $HAPROXY_STATE
else
echo "show servers state" | socat $HAPROXY_SOCKET - > /tmp/state && mv /tmp/state $HAPROXY_STATE
fi
if [ ! -s $HAPROXY_STATE ]; then
echo "#" > $HAPROXY_STATE
fi
case "$1" in
Expand Down

0 comments on commit 00e0a95

Please sign in to comment.