# HG changeset patch
# User Marian Marinov <[email protected]>
# Date 1267491017 -7200
# Branch mysql-ms
# Node ID b45e84f55882e98cbd57a71ab3e483f192945f04
# Parent 0c1c598c4f5ab4e758f7140b29aab86b2d8cd1a5
Medium: RA: mysql: fixed wrong parameters in is_slave
Fixed wrong comparation parameter $a(which is undefined), replaced by $k (which
is the right value)
Removed the awk from this command since grep is now enough
diff -r 0c1c598c4f5a -r b45e84f55882 heartbeat/mysql
--- a/heartbeat/mysql Tue Mar 02 02:45:38 2010 +0200
+++ b/heartbeat/mysql Tue Mar 02 02:50:17 2010 +0200
@@ -360,12 +360,12 @@
slave_io=''
mysql \
--socket=$OCF_RESKEY_socket -O connect_timeout=1 \
- -e 'SHOW SLAVE STATUS\G'|awk '/Running/ || /Master_[UHP]/{print
$2}'|while read k v; do
- if [ "$a" = 'Master_Host:' ]; then master_host="$v"; fi
- if [ "$a" = 'Master_User:' ]; then master_user="$v"; fi
- if [ "$a" = 'Master_Port:' ]; then master_port="$v"; fi
- if [ "$a" = 'Slave_IO_Running:' ]; then slave_io="$v"; fi
- if [ "$a" = 'Slave_SQL_Running:' ]; then slave_sql="$v"; fi
+ -e 'SHOW SLAVE STATUS\G'|grep -P 'Running|Master_[UHP]'|while read k
v; do
+ if [ "$k" = 'Master_Host:' ]; then master_host="$v"; fi
+ if [ "$k" = 'Master_User:' ]; then master_user="$v"; fi
+ if [ "$k" = 'Master_Port:' ]; then master_port="$v"; fi
+ if [ "$k" = 'Slave_IO_Running:' ]; then slave_io="$v"; fi
+ if [ "$k" = 'Slave_SQL_Running:' ]; then slave_sql="$v"; fi
done
if [ -z "$master_host" ] || [ -z "$master_user" ] || [ -z "$master_port" ]
|| [ -z "$slave_io" ] || [ -z "$slave_sql" ]; then
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/