]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: don't start haproxy on reload
authorAdam Spiers <aspiers@suse.com>
Mon, 23 Feb 2015 15:28:41 +0000 (15:28 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 Feb 2015 17:13:14 +0000 (18:13 +0100)
If haproxy is not already running, reload should not start it.
Unfortunately the LSB spec does not explicitly cover this case:

  http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

but it seems like the more correct behaviour, and actually fixes a
real-world issue we saw in SUSE Cloud.

Signed-off-by: Adam Spiers <aspiers@suse.com>
examples/haproxy.init

index bf13b151318f969a69940a0b297e69c6bf3f2f62..d02c36710974db6e01941f8d494372f08bf0c3e3 100644 (file)
@@ -78,6 +78,10 @@ restart() {
 }
 
 reload() {
+  if ! [ -s $PIDFILE ]; then
+    return 0
+  fi
+
   quiet_check
   if [ $? -ne 0 ]; then
     echo "Errors found in configuration file, check it with '$BASENAME check'."