From 3af9b793bb8eb817a48fe5ca5875cc7aa2a96bda Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Thu, 8 Feb 2018 14:44:31 +0100 Subject: [PATCH] TT#18774 Check mysql using proper my.cnf file On migration to systemd we have separated mysqld1 and mysqld2 by separate my.cnf files. We have to use the accordingly here. Change-Id: I6d291e3b7c9601c09b82103cd32a775ba44911ef --- helper/check-for-mysql | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/helper/check-for-mysql b/helper/check-for-mysql index 0cd38382..c2a1970e 100755 --- a/helper/check-for-mysql +++ b/helper/check-for-mysql @@ -2,14 +2,10 @@ if [ $# -gt 0 ] ; then COUNT=$1 - MYSQLID="$2" + CONF="$2" else COUNT=60 -fi - -if [ "$MYSQLID" = "2" ] ; then - # [client2] on /etc/mysql/debian.cnf - SUFF="2" + CONF="/etc/mysql/my.cnf" fi if [ $COUNT -le 0 ] ; then @@ -28,7 +24,7 @@ if ! which mysqladmin >/dev/null 2>&1 ; then fi mysqld_get_param() { - mysqld --defaults-group-suffix=$SUFF --print-defaults 2>/dev/null \ + mysqld --defaults-file="${CONF}" --print-defaults 2>/dev/null \ | tr " " "\n" \ | grep -- "--$1" \ | tail -n 1 \ @@ -36,8 +32,7 @@ mysqld_get_param() { } mysqld_status () { - if mysqladmin --defaults-group-suffix=$SUFF \ - --defaults-file=/etc/mysql/debian.cnf ping 2>&1 ; then + if mysqladmin --defaults-file="${CONF}" ping 2>&1 ; then ping_alive=1 else ping_alive=0