mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-05-16 01:07:12 +08:00
PT-1398 Updated way of getting MySQL PID
This commit is contained in:
+2
-1
@@ -52,7 +52,8 @@ collect() {
|
||||
local mysqld_pid=""
|
||||
# Get pidof mysqld.
|
||||
if [ ! "$OPT_MYSQL_ONLY" ]; then
|
||||
mysqld_pid=$(_pidof mysqld | awk '{print $1; exit;}')
|
||||
port=$(mysql -ss -e 'SELECT @@port')
|
||||
mysqld_pid=$(lsof -i ":${port}" | grep -i listen | cut -f 3 -d" ")
|
||||
fi
|
||||
|
||||
# Get memory allocation info before anything else.
|
||||
|
||||
Reference in New Issue
Block a user