Hm, it is matching, even though ignoring the datadir var, but it doesn't exclude the "wsrep_recover" case: # ps -C mysqld -o pid= -o args=|grep -v defu; bash -xx test 10255 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --wsrep_provider=/usr/lib/galera/libgalera_smm.so --wsrep-recover --log-error=/dev/stdout.err --open-files-limit=102400 --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 --wsrep_recover --log_error=/var/lib/mysql/wsrep_recovery.jHz8d2 --pid-file=/var/lib/mysql/n2-recover.pid + OCF_RESKEY_datadir=/var/lib/mysql ++ ps -C mysqld -o pid= -o args= ++ awk -v v=/var/lib/mysql '/datadir=/ { if ($1 ~ !/wsrep-recover/) print $1}' + pid=10255 + echo 10255 10255
Hm, it is matching, even though ignoring the datadir var, but it doesn't exclude the "wsrep_recover" case: /var/lib/ mysql --plugin- dir=/usr/ lib/mysql/ plugin --user=mysql --wsrep_ provider= /usr/lib/ galera/ libgalera_ smm.so --wsrep-recover --log-error= /dev/stdout. err --open- files-limit= 102400 --pid-file= /var/run/ mysqld/ mysqld. pid --socket= /var/run/ mysqld/ mysqld. sock --port=3306 --wsrep_recover --log_error= /var/lib/ mysql/wsrep_ recovery. jHz8d2 --pid-file= /var/lib/ mysql/n2- recover. pid datadir= /var/lib/ mysql
# ps -C mysqld -o pid= -o args=|grep -v defu; bash -xx test
10255 /usr/sbin/mysqld --basedir=/usr --datadir=
+ OCF_RESKEY_
++ ps -C mysqld -o pid= -o args=
++ awk -v v=/var/lib/mysql '/datadir=/ { if ($1 ~ !/wsrep-recover/) print $1}'
+ pid=10255
+ echo 10255
10255