From 5aeab5aaa6dda91aa6629b81c53a0e44f57147ca Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Tue, 26 Jan 2016 18:21:28 +0100 Subject: [PATCH] Add SST check to mysql_status Change-Id: Ib7dd20a0322ecb57748188290d5c52467b82c765 Closes-Bug: #1478310 (cherry picked from commit 0039c23202739fd47df54183ab6e3c7070fc4579) --- files/fuel-ha-utils/ocf/mysql-wss | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/files/fuel-ha-utils/ocf/mysql-wss b/files/fuel-ha-utils/ocf/mysql-wss index cf382c1852..7a4ef49b4b 100644 --- a/files/fuel-ha-utils/ocf/mysql-wss +++ b/files/fuel-ha-utils/ocf/mysql-wss @@ -426,7 +426,13 @@ mysql_status() { i=${2:-3} sleeptime=${3:-5} while [ $i -gt 0 ]; do + if [ -f "${OCF_RESKEY_datadir}"/sst_in_progress ]; then + ocf_log info 'SST is in progress' + return $OCF_SUCCESS + fi + if [ -f "$OCF_RESKEY_pid" ]; then + ocf_log info 'MySQL PID found' break fi sleep $sleeptime @@ -434,7 +440,6 @@ mysql_status() { ocf_log info "PIDFile ${OCF_RESKEY_pid} of MySQL server not found. Sleeping for $sleeptime seconds. ${i} retries left" done - if [ $i -eq 0 ]; then ocf_log $1 "MySQL is not running" return $OCF_NOT_RUNNING; @@ -461,9 +466,8 @@ mysql_monitor() { status_loglevel="info" fi - if [ -f "${OCF_RESKEY_datadir}"/sst_in_progress ]; then - ocf_log 'SST is in progress' + ocf_log info 'SST is in progress' return $OCF_SUCCESS fi