2020-09-11 12:29:29 -04:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# start solr in the foreground
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [[ "$VERBOSE" == "yes" ]]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Starting Solr $SOLR_VERSION"
|
|
|
|
# determine TINI default. If it is already set, assume the user knows what they want
|
|
|
|
if [[ -z "${TINI:-}" ]]; then
|
|
|
|
if [[ "$$" == 1 ]]; then
|
|
|
|
# Default to running tini, so we can run with an OOM script and have 'kill -9' work
|
|
|
|
TINI=yes
|
|
|
|
else
|
|
|
|
# Presumably we're already running under tini through 'docker --init', in which case we
|
|
|
|
# don't need to run it twice.
|
|
|
|
# It's also possible that we're run from a wrapper script without exec,
|
|
|
|
# in which case running tini would not be ideal either.
|
|
|
|
TINI=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ "$TINI" == yes ]]; then
|
2020-11-04 18:20:16 -05:00
|
|
|
exec tini -- solr -f "$@"
|
2020-09-11 12:29:29 -04:00
|
|
|
elif [[ "$TINI" == no ]]; then
|
2020-11-04 18:20:16 -05:00
|
|
|
exec solr -f "$@"
|
2020-09-11 12:29:29 -04:00
|
|
|
else
|
|
|
|
echo "invalid value TINI=$TINI"
|
|
|
|
exit 1
|
|
|
|
fi
|