From 60373eb6808fddc2ebe25a65e1e2c18bd1ec952a Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Tue, 18 Apr 2017 12:53:44 +0200 Subject: [PATCH] Add missing directory files Signed-off-by: Petr "Stone" Hracek --- files/docker-entrypoint.sh | 15 +++++++++++++++ files/haproxy.sh | 14 ++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 files/docker-entrypoint.sh create mode 100755 files/haproxy.sh diff --git a/files/docker-entrypoint.sh b/files/docker-entrypoint.sh new file mode 100755 index 0000000..581edc9 --- /dev/null +++ b/files/docker-entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +# first arg is `-f` or `--some-option` +if [ "${1#-}" != "$1" ]; then + set -- haproxy "$@" +fi + +if [ "$1" = 'haproxy' ]; then + # if the user wants "haproxy", let's use "haproxy-systemd-wrapper" instead so we can have proper reloadability implemented by upstream + shift # "haproxy" + set -- "$(which haproxy-systemd-wrapper)" -p /run/haproxy.pid "$@" +fi + +exec "$@" \ No newline at end of file diff --git a/files/haproxy.sh b/files/haproxy.sh new file mode 100755 index 0000000..f3623c1 --- /dev/null +++ b/files/haproxy.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [[ ! -z "${DEBUG_MODE}" ]]; then + rpm -q syslog-ng + if [[ $? -ne 0 ]]; then + dnf -y --setopt=tsflags=nodocs install syslog-ng && \ + dnf -y clean all + syslog-ng + fi + +fi + +# Run haproxy binary +/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg