aboutsummaryrefslogtreecommitdiff
path: root/docker/common/haproxy
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-07-22 18:25:56 +0000
committerGerrit Code Review <review@openstack.org>2015-07-22 18:25:56 +0000
commit6d4a55060e13723138facd90dc9786e7f2c3684b (patch)
tree12c9216c2be6f79d7b7ac8d1d8a5d21fdc1035fc /docker/common/haproxy
parent3803663c5d586ac5ba11b3151064bff453f0af0b (diff)
parent38bed674bd522d8e23d5c9ca66d356c4c5884ce7 (diff)
downloadkolla-6d4a55060e13723138facd90dc9786e7f2c3684b.tar.gz
kolla-6d4a55060e13723138facd90dc9786e7f2c3684b.zip
Merge "HAProxy container"
Diffstat (limited to 'docker/common/haproxy')
-rwxr-xr-xdocker/common/haproxy/config-external.sh11
-rwxr-xr-xdocker/common/haproxy/start.sh17
2 files changed, 28 insertions, 0 deletions
diff --git a/docker/common/haproxy/config-external.sh b/docker/common/haproxy/config-external.sh
new file mode 100755
index 000000000..d267eb195
--- /dev/null
+++ b/docker/common/haproxy/config-external.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+SOURCE="/opt/kolla/haproxy/haproxy.cfg"
+TARGET="/etc/haproxy/haproxy.cfg"
+OWNER="root"
+
+if [[ -f "$SOURCE" ]]; then
+ rm $TARGET
+ cp $SOURCE $TARGET
+ chown ${OWNER}: $TARGET
+ chmod 0644 $TARGET
+fi
diff --git a/docker/common/haproxy/start.sh b/docker/common/haproxy/start.sh
new file mode 100755
index 000000000..68600f44e
--- /dev/null
+++ b/docker/common/haproxy/start.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+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"
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+# Config-internal script exec out of this function, it does not return here.
+set_configs
+
+exec $CMD $ARGS