mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-01 18:25:59 +00:00
Removed extra spaces in lsof output, so mysql_pid detection does not depend on lsof format
This commit is contained in:
@@ -39,7 +39,7 @@ _pidof() {
|
||||
_lsof() {
|
||||
local pid="$1"
|
||||
if ! lsof -p $pid 2>/dev/null; then
|
||||
/bin/ls -l /proc/$pid/fd 2>/tmp/lsof_test #/dev/null
|
||||
/bin/ls -l /proc/$pid/fd 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
|
@@ -123,9 +123,6 @@ collect_mysql_data_one() {
|
||||
if [ ! "$OPT_MYSQL_ONLY" ]; then
|
||||
port=$($CMD_MYSQL $EXT_ARGV -ss -e 'SELECT @@port')
|
||||
mysqld_pid=$(lsof -i ":${port}" | grep -i listen | tr -s ' ' | cut -f 2 -d" ")
|
||||
echo "MySQL PID: $mysqld_pid" > /tmp/mysql_pid_lsof
|
||||
lsof_pid=$(lsof -i ":${port}")
|
||||
echo "lsof for MySQl PID: $lsof_pid" >> /tmp/mysql_pid_lsof
|
||||
fi
|
||||
|
||||
# Get memory allocation info before anything else.
|
||||
|
Reference in New Issue
Block a user