From: asteroide Date: Thu, 27 Jul 2017 07:32:00 +0000 (+0200) Subject: Add commands to wait for the database to set up X-Git-Tag: opnfv-5.1.RC1~20 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F55%2F38255%2F1;p=moon.git Add commands to wait for the database to set up Change-Id: Ifa6453f4399b203611745820f4ea4ad8afcf49c8 --- diff --git a/moonv4/templates/moon_keystone/run.sh b/moonv4/templates/moon_keystone/run.sh index ea9b7984..2a61901e 100644 --- a/moonv4/templates/moon_keystone/run.sh +++ b/moonv4/templates/moon_keystone/run.sh @@ -18,6 +18,13 @@ max_age = 3600 allow_methods = POST,GET,DELETE EOF +until echo status | mysql -h${DB_HOST} -u${DB_USER_ROOT} -p${DB_PASSWORD_ROOT}; do + >&2 echo "MySQL is unavailable - sleeping" + sleep 1 +done + +>&2 echo "Mysql is up - executing command" + mysql -h $DB_HOST -u$DB_USER_ROOT -p$DB_PASSWORD_ROOT <