27 lines
514 B
Bash
Executable File
27 lines
514 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# shellcheck disable=SC1091
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
# set -o xtrace # Uncomment this line for debugging purpose
|
|
|
|
# Load libraries
|
|
. /libredissentinel.sh
|
|
. /liblog.sh
|
|
. /libos.sh
|
|
|
|
# Load Redis environment
|
|
eval "$(redis_env)"
|
|
|
|
EXEC=$(command -v redis-sentinel)
|
|
args=("$REDIS_SENTINEL_CONF_FILE" "--daemonize" "no" "$@")
|
|
|
|
info "** Starting redis sentinel **"
|
|
if am_i_root; then
|
|
exec gosu "$REDIS_SENTINEL_DAEMON_USER" "$EXEC" "${args[@]}"
|
|
else
|
|
exec "$EXEC" "${args[@]}"
|
|
fi
|