mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 07:30:02 +00:00
Fix _pidof() calls in collect.sh. Update Bash libs in pt-ioprofile.
This commit is contained in:
@@ -443,9 +443,13 @@ rm_tmpdir() {
|
||||
|
||||
# ###########################################################################
|
||||
# alt_cmds package
|
||||
# This package is a copy without comments from the original. The original
|
||||
# with comments and its test file can be found in the Bazaar repository at,
|
||||
# lib/bash/alt_cmds.sh
|
||||
# t/lib/bash/alt_cmds.sh
|
||||
# See https://launchpad.net/percona-toolkit for more information.
|
||||
# ###########################################################################
|
||||
|
||||
# seq N, return 1, ..., 5
|
||||
_seq() {
|
||||
local i="$1"
|
||||
awk "BEGIN { for(i=1; i<=$i; i++) print i; }"
|
||||
@@ -466,8 +470,6 @@ _lsof() {
|
||||
}
|
||||
|
||||
_which() {
|
||||
# which on CentOS is aliased to a cmd that prints extra stuff.
|
||||
# Also, if the cmd isn't found, a msg is printed to stderr.
|
||||
[ -x /usr/bin/which ] && /usr/bin/which "$1" 2>/dev/null | awk '{print $1}'
|
||||
}
|
||||
|
||||
|
@@ -631,7 +631,7 @@ collect() {
|
||||
local d="$1" # directory to save results in
|
||||
local p="$2" # prefix for each result file
|
||||
|
||||
local mysqld_pid=$(_pidof mysqld | head -n1)
|
||||
local mysqld_pid=$(_pidof mysqld | awk '{print $1; exit;}')
|
||||
|
||||
if [ "$CMD_PMAP" -a "$mysqld_pid" ]; then
|
||||
if $CMD_PMAP --help 2>&1 | grep -- -x >/dev/null 2>&1 ; then
|
||||
@@ -783,7 +783,7 @@ collect() {
|
||||
$CMD_OPCONTROL --stop
|
||||
$CMD_OPCONTROL --dump
|
||||
|
||||
local oprofiled_pid=$(_pidof oprofiled)
|
||||
local oprofiled_pid=$(_pidof oprofiled | awk '{print $1; exit;}')
|
||||
if [ "$oprofiled_pid" ]; then
|
||||
kill $oprofiled_pid
|
||||
else
|
||||
|
Reference in New Issue
Block a user