aboutsummaryrefslogtreecommitdiff
path: root/docker/common/haproxy/start.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker/common/haproxy/start.sh')
-rwxr-xr-xdocker/common/haproxy/start.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/docker/common/haproxy/start.sh b/docker/common/haproxy/start.sh
index 68600f44e..c39184767 100755
--- a/docker/common/haproxy/start.sh
+++ b/docker/common/haproxy/start.sh
@@ -2,11 +2,7 @@
set -o errexit
CMD='/usr/sbin/haproxy'
-# Parameters:
-# -db for non-daemon execution and logging to stdout
-# -p pidfile to specify pidfile and allow hot reconfiguration
-# loop which generates -f file.conf for each file in /etc/haproxy and /etc/haproxy/conf.d
-ARGS="-db -f /etc/haproxy/haproxy.cfg"
+ARGS="-f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid"
# Loading common functions.
source /opt/kolla/kolla-common.sh
@@ -14,4 +10,11 @@ source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
set_configs
-exec $CMD $ARGS
+# We are intentionally not using exec so we can reload the haproxy config later
+$CMD $ARGS
+
+# TODO(SamYaple): This has the potential for a race condition triggered by a
+# config reload that could cause the container to exit
+while [[ -e "/proc/$(cat /run/haproxy.pid)" ]]; do
+ sleep 5
+done