From 8702b4320d86ed098a6294966f52b66dccbc8ba2 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Thu, 4 Aug 2016 14:06:52 +0200 Subject: [PATCH] Wait for all mysql jobs to be finished --- setup/start.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup/start.sh b/setup/start.sh index 47f8d7923..35c914f0c 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -63,6 +63,12 @@ echo "Cleaning up snapshots" find "${DATA_DIR}/snapshots" -mindepth 1 -maxdepth 1 | xargs --no-run-if-empty btrfs subvolume delete # restart mysql to make sure it has latest config +# wait for all running mysql jobs +while true; do + if ! systemctl list-jobs | grep mysql; then break; fi + echo "Waiting for mysql jobs..." + sleep 1 +done systemctl restart mysql readonly mysql_root_password="password"