aboutsummaryrefslogtreecommitdiff
path: root/docker/haproxy/extend_start.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker/haproxy/extend_start.sh')
-rw-r--r--docker/haproxy/extend_start.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/docker/haproxy/extend_start.sh b/docker/haproxy/extend_start.sh
new file mode 100644
index 000000000..cf50a5c9f
--- /dev/null
+++ b/docker/haproxy/extend_start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+# We are intentionally not using exec so we can reload the haproxy config later
+echo "Running command: '${CMD}'"
+$CMD
+
+# 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
+
+# Based on the above loop this point should never be reached
+exit 1