diff options
| author | Michal Jastrzebski (inc0) <michal.jastrzebski@intel.com> | 2015-07-17 12:20:31 +0200 |
|---|---|---|
| committer | Sam Yaple <sam@yaple.net> | 2015-07-28 15:46:42 +0000 |
| commit | 2d920745a45eec166e2c381aa7b15b1168b03887 (patch) | |
| tree | 71612a929fe71a0fffc1261e89acfd408457b321 /docker/common/haproxy/start.sh | |
| parent | 4d6eaa25fc881dec699e5b0a4a4f196881338b2c (diff) | |
| download | kolla-2d920745a45eec166e2c381aa7b15b1168b03887.tar.gz kolla-2d920745a45eec166e2c381aa7b15b1168b03887.zip | |
Ansible install of HAProxy
This commit consists HAProxy ansible bits including config generation,
container deployment and hot reloads.
Closes-Bug: #1477915
Co-Authored-By: Sam Yaple <sam@yaple.net>
Change-Id: Ie93fa68fdb6b2885889c992ff1267d38b68e0cbc
Partially-implements: blueprint ansible-service
Diffstat (limited to 'docker/common/haproxy/start.sh')
| -rwxr-xr-x | docker/common/haproxy/start.sh | 15 |
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 |
