From: Willy Tarreau Date: Fri, 1 May 2009 13:49:56 +0000 (+0200) Subject: [MINOR] rhel init script : support the reload operation X-Git-Tag: v1.3.18~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3909a2ab008e9fed1851bc68d5b6ff23c62c0a1e;p=thirdparty%2Fhaproxy.git [MINOR] rhel init script : support the reload operation The reload operation in the Red Hat init script caused a restart which is not always the best thing to do. Implement the reload. --- diff --git a/examples/haproxy.init b/examples/haproxy.init index 4de71ee160..942d959c8a 100644 --- a/examples/haproxy.init +++ b/examples/haproxy.init @@ -71,6 +71,15 @@ restart() { start } +reload() { + /usr/sbin/$BASENAME -c -q -f /etc/$BASENAME/$BASENAME.cfg + if [ $? -ne 0 ]; then + echo "Errors found in configuration file, check it with '$BASENAME check'." + return 1 + fi + /usr/sbin/$BASENAME -D -f /etc/$BASENAME/$BASENAME.cfg -p /var/run/$BASENAME.pid -sf $(cat /var/run/$BASENAME.pid) +} + check() { /usr/sbin/$BASENAME -c -q -V -f /etc/$BASENAME/$BASENAME.cfg } @@ -95,7 +104,7 @@ case "$1" in restart ;; reload) - restart + reload ;; condrestart) condrestart