mirror of
https://github.com/Misterblue/opensim-docker.git
synced 2026-07-30 03:12:41 +00:00
Add code to initializeDb.sh to wait for the mysql database
to be ready before trying to initialize it. This fixes
a first time startup problem.
This commit is contained in:
@@ -16,9 +16,6 @@ if [[ ! -z "$MYSQL_ROOT_PASSWORD" ]] ; then
|
||||
rm -f "$SQLCMDS"
|
||||
rm -f "$SQLOPTIONS"
|
||||
|
||||
# If the database is started at the same time, what for it to initialize
|
||||
sleep 10
|
||||
|
||||
cat > "$SQLCMDS" <<EOFFFF
|
||||
CREATE DATABASE opensim;
|
||||
USE opensim;
|
||||
@@ -33,6 +30,14 @@ password=$MYSQL_ROOT_PASSWORD
|
||||
host=$MYSQL_DB_SOURCE
|
||||
EOFFFF
|
||||
|
||||
# If the database is started at the same time, what for it to initialize
|
||||
until mysql --defaults-extra-file=$SQLOPTIONS -e "show databases" ; do
|
||||
echo "initializeDb.sh: Waiting on database to be ready"
|
||||
sleep 2
|
||||
done
|
||||
echo "initializeDb.sh: Database is ready"
|
||||
|
||||
|
||||
HASDB=$(mysql --defaults-extra-file=$SQLOPTIONS -e "show databases" | grep "^opensim$")
|
||||
|
||||
if [[ -z "$HASDB" ]] ; then
|
||||
|
||||
Reference in New Issue
Block a user