[Dovecot] Set repl health on start

master
andryyy 2020-04-14 17:32:15 +02:00
parent 1fc846e1c8
commit 56e4963423
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
2 changed files with 15 additions and 1 deletions

View File

@ -7,6 +7,20 @@ while ! mysqladmin status --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${D
sleep 2
done
# Do not attempt to write to slave
if [[ ! -z ${REDIS_SLAVEOF_IP} ]]; then
REDIS_CMDLINE="redis-cli -h ${REDIS_SLAVEOF_IP} -p ${REDIS_SLAVEOF_PORT}"
else
REDIS_CMDLINE="redis-cli -h redis -p 6379"
fi
until [[ $(${REDIS_CMDLINE} PING) == "PONG" ]]; do
echo "Waiting for Redis..."
sleep 2
done
${REDIS_CMDLINE} SET DOVECOT_REPL_HEALTH 1 > /dev/null
# Create missing directories
[[ ! -d /etc/dovecot/sql/ ]] && mkdir -p /etc/dovecot/sql/
[[ ! -d /etc/dovecot/lua/ ]] && mkdir -p /etc/dovecot/lua/

View File

@ -189,7 +189,7 @@ services:
- sogo
dovecot-mailcow:
image: mailcow/dovecot:1.119
image: mailcow/dovecot:1.120
depends_on:
- mysql-mailcow
dns: