]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] rhel init script : support the reload operation
authorWilly Tarreau <w@1wt.eu>
Fri, 1 May 2009 13:49:56 +0000 (15:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 May 2009 13:49:56 +0000 (15:49 +0200)
The reload operation in the Red Hat init script caused a restart
which is not always the best thing to do. Implement the reload.

examples/haproxy.init

index 4de71ee1602662de6c36d607be19dd08fce7d7be..942d959c8a535829404395883119b1f254f9b84b 100644 (file)
@@ -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