let scheduler wait for memcached server

This commit is contained in:
André Bauer 2018-04-14 17:24:05 +02:00
parent b647a87c3d
commit 274e216394

View File

@ -7,6 +7,7 @@ set -e
: "${MEMCACHED_HOST:=zammad-memcached}" : "${MEMCACHED_HOST:=zammad-memcached}"
: "${MEMCACHED_PORT:=11211}" : "${MEMCACHED_PORT:=11211}"
: "${POSTGRESQL_HOST:=zammad-postgresql}" : "${POSTGRESQL_HOST:=zammad-postgresql}"
: "${POSTGRESQL_PORT:=5432}"
: "${POSTGRESQL_USER:=postgres}" : "${POSTGRESQL_USER:=postgres}"
: "${POSTGRESQL_PASS:=}" : "${POSTGRESQL_PASS:=}"
: "${POSTGRESQL_DB:=zammad_production}" : "${POSTGRESQL_DB:=zammad_production}"
@ -30,7 +31,7 @@ if [ "$1" = 'zammad-init' ]; then
rsync -a --delete --exclude 'public/assets/images/*' --exclude 'storage/fs/*' ${ZAMMAD_TMP_DIR}/ ${ZAMMAD_DIR} rsync -a --delete --exclude 'public/assets/images/*' --exclude 'storage/fs/*' ${ZAMMAD_TMP_DIR}/ ${ZAMMAD_DIR}
rsync -a ${ZAMMAD_TMP_DIR}/public/assets/images/ ${ZAMMAD_DIR}/public/assets/images rsync -a ${ZAMMAD_TMP_DIR}/public/assets/images/ ${ZAMMAD_DIR}/public/assets/images
until (echo > /dev/tcp/${POSTGRESQL_HOST}/5432) &> /dev/null; do until (echo > /dev/tcp/${POSTGRESQL_HOST}/${POSTGRESQL_PORT}) &> /dev/null; do
echo "zammad railsserver waiting for postgresql server to be ready..." echo "zammad railsserver waiting for postgresql server to be ready..."
sleep 5 sleep 5
done done
@ -115,6 +116,11 @@ fi
if [ "$1" = 'zammad-scheduler' ]; then if [ "$1" = 'zammad-scheduler' ]; then
check_zammad_ready check_zammad_ready
until (echo > /dev/tcp/${MEMCACHED_HOST}/${MEMCACHED_PORT}) &> /dev/null; do
echo "zammad scheduler waiting for memcached server to be ready..."
sleep 5
done
cd ${ZAMMAD_DIR} cd ${ZAMMAD_DIR}
echo "starting scheduler..." echo "starting scheduler..."