I see the problem because my pid file is not in the data directory and the Percona script assumes it lives there
NR_PID_FILES=`ls $mysql_datadir/*.pid 2>/dev/null | wc -l`
The upstream script finds the pid file in the correct directory
NR_PID_FILES=`ls -1 $PID_FILE_PATT 2>/dev/null | wc -l`
I suggest that you upgrade your scripts to mirror the upstream ones.
I see the problem because my pid file is not in the data directory and the Percona script assumes it lives there
NR_PID_FILES=`ls $mysql_ datadir/ *.pid 2>/dev/null | wc -l`
The upstream script finds the pid file in the correct directory
NR_PID_FILES=`ls -1 $PID_FILE_PATT 2>/dev/null | wc -l`
I suggest that you upgrade your scripts to mirror the upstream ones.