summaryrefslogtreecommitdiff
path: root/docker/redis/redis-sentinel/extend_start.sh
blob: 9044f39908e57a628d966f53051a6f517a5e6b38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

if [[ ! -d "/var/log/kolla/redis" ]]; then
    mkdir -p /var/log/kolla/redis
fi

if [[ $(stat -c %a /var/log/kolla/redis) != "755" ]]; then
    chmod 755 /var/log/kolla/redis
fi

# The CONFIG REWRITE command rewrites the redis.conf
# file the server was started with, applying the minimal
# changes needed to make it reflect the configuration
# currently used by the server, which may be different
# compared to the original one because of the use of
# the CONFIG SET command.
#
# https://redis.io/commands/config-rewrite/
#
# Because of above behaviour it's needed to
# hack kolla's CMD.
#
# Without this hack
# /usr/local/bin/kolla_set_configs --check
# is always reporting changed.
#
# Therefore redis-sentinel is always restarted
# even if configuration is not changed from
# kolla-ansible side.
if [ ! -z "${REDIS_CONF}" ] && [ ! -z ${REDIS_GEN_CONF} ]; then
    cp ${REDIS_CONF} ${REDIS_GEN_CONF}
fi