X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fmsb%2Fcomponents%2Fmsb-consul%2Fresources%2Fdocker-entrypoint.sh;h=18692d8afad47b6cca99d68c3fbc7e9c49b5c33c;hb=85b1492555d765b14864e0d2d59db7a50cdccaf0;hp=0cd46167e41067d5c87283c98c079a0d82252eef;hpb=fd2f8b8d029ea7e83da16d40cd023cebe4b2f75e;p=oom.git diff --git a/kubernetes/msb/components/msb-consul/resources/docker-entrypoint.sh b/kubernetes/msb/components/msb-consul/resources/docker-entrypoint.sh index 0cd46167e4..18692d8afa 100755 --- a/kubernetes/msb/components/msb-consul/resources/docker-entrypoint.sh +++ b/kubernetes/msb/components/msb-consul/resources/docker-entrypoint.sh @@ -1,16 +1,11 @@ +#!/bin/sh + #!/usr/bin/dumb-init /bin/sh +# As of docker 1.13, using docker run --init achieves the same outcome than dumb-init. + set -e set -x -# Note above that we run dumb-init as PID 1 in order to reap zombie processes -# as well as forward signals to all processes in its session. Normally, sh -# wouldn't do either of these functions so we'd leak zombies as well as do -# unclean termination of all our sub-processes. -# As of docker 1.13, using docker run --init achieves the same outcome. - -# You can set CONSUL_BIND_INTERFACE to the name of the interface you'd like to -# bind to and this will look up the IP and pass the proper -bind= option along -# to Consul. CONSUL_BIND= if [ -n "$CONSUL_BIND_INTERFACE" ]; then CONSUL_BIND_ADDRESS=$(ip -o -4 addr list $CONSUL_BIND_INTERFACE | head -n1 | awk '{print $4}' | cut -d/ -f1) @@ -48,12 +43,12 @@ CONSUL_CONFIG_DIR=/consul/config # You can also set the CONSUL_LOCAL_CONFIG environemnt variable to pass some # Consul configuration JSON without having to bind any volumes. if [ -n "$CONSUL_LOCAL_CONFIG" ]; then - echo "$CONSUL_LOCAL_CONFIG" > "$CONSUL_CONFIG_DIR/local.json" + echo "$CONSUL_LOCAL_CONFIG" > "$CONSUL_CONFIG_DIR/local.json" fi # If the user is trying to run Consul directly with some arguments, then # pass them to Consul. -if [ "${1:0:1}" = '-' ]; then +if echo "$1" | grep '^-' >/dev/null; then set -- consul "$@" fi