summaryrefslogtreecommitdiffstats
path: root/lcm/docker/docker-entrypoint.sh
diff options
context:
space:
mode:
authoryangyan <yangyanyj@chinamobile.com>2020-03-03 15:27:02 +0800
committeryangyan <yangyanyj@chinamobile.com>2020-03-03 15:27:10 +0800
commitbc270e9b83a9142c3de24d1060555d2ddcc52057 (patch)
tree993edeb53389762932b5795200b26d9ca0959502 /lcm/docker/docker-entrypoint.sh
parent28d2b811d021dd4e47b1600e59b06543ce485673 (diff)
Modify DB initialization completion judgment flag1.3.7
Change-Id: I8724a2885aebcf0dadacbe84b8e5344b22c76e79 Issue-ID: VFC-1639 Signed-off-by: yangyan <yangyanyj@chinamobile.com>
Diffstat (limited to 'lcm/docker/docker-entrypoint.sh')
-rwxr-xr-xlcm/docker/docker-entrypoint.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/lcm/docker/docker-entrypoint.sh b/lcm/docker/docker-entrypoint.sh
index 0e1abc93..4ba07578 100755
--- a/lcm/docker/docker-entrypoint.sh
+++ b/lcm/docker/docker-entrypoint.sh
@@ -33,8 +33,8 @@ done
# Wait for DB initialization
echo "Wait for DB initialization"
for i in {1..5}; do
- curl -sS -m 1 $MYSQL_ADDR > /dev/null && break
- sleep $i
+ mysql -u$MYSQL_ROOT_USER -p$MYSQL_ROOT_PASSWORD -h`echo $MYSQL_ADDR | cut -d: -f 1` -P`echo $MYSQL_ADDR | cut -d: -f 2` -e "show databases;" > /dev/null && echo "DB initialization completed" && break
+ sleep $i && echo "`echo $MYSQL_ADDR | cut -d: -f 1` connection failed"
done
# Configure service based on docker environment variables