Commit 2a2147cb authored by Thomas Goirand's avatar Thomas Goirand

Fix waiting for db status in Buster.

parent a1df4e57
#!/bin/sh
set -e
SQL_QUERY=${1}
RESULT_CONTAINS=${2}
DB_NAME=${3}
TIMEOUT=${4}
STARTSTAMP=$(date +%s)
TMPFILE=$(mktemp)
echo "${SQL_QUERY}" >${TMPFILE}
ENLAPSTED=0
while [ "${ENLAPSTED}" -lt "${TIMEOUT}" ] ; do
if /usr/bin/mysql --defaults-extra-file=/root/.my.cnf --database=${DB_NAME} <${TMPFILE} | grep -q ${2} ; then
rm ${TMPFILE}
exit 0
fi
CURTIMESTAMP=$(date +%s)
ENLAPSTED=$((${CURTIMESTAMP} - ${STARTSTAMP}))
sleep 2
done
rm ${TMPFILE}
echo "Timed out..."
exit 1
This diff is collapsed.
This diff is collapsed.
......@@ -1518,8 +1518,12 @@ https://salsa.debian.org/openstack-team/debian/openstack-cluster-installer
}
copy("/usr/bin/oci-auto-join-rabbitmq-cluster", "$template_path/oci-in-target/usr/bin/oci-auto-join-rabbitmq-cluster");
chmod("$template_path/oci-in-target/usr/bin/oci-auto-join-rabbitmq-cluster",0755);
# This is for wait operations to make sure the SQL cluster is up...
copy("/usr/bin/oci-wait-for-sql", "$template_path/oci-in-target/usr/bin/oci-wait-for-sql");
}
##################################################################
### If the machine is a swiftstore, we need the facts.d helper ###
##################################################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment