Last active
January 6, 2024 04:19
-
-
Save ezhuk/6480290 to your computer and use it in GitHub Desktop.
Reload HAProxy configuration with no downtime.
This file contains hidden or 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
#!/bin/bash | |
# | |
# The trick here is to dump pids of all haproxy processes into a file | |
# (-p option) and then tell them to finish their work and exit (-sf). | |
HAPROXY=/usr/sbin/haproxy | |
HAPROXY_PID=/var/run/haproxy.pid | |
HAPROXY_CONFIG=/etc/haproxy/haproxy.cfg | |
$HAPROXY -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment