~percona-toolkit-dev/percona-toolkit/release-2.2.2

« back to all changes in this revision

Viewing changes to lib/bash/collect_mysql_info.sh

Merge pt-ms-pt-stalk-standard-mysql-options.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
         echo "internal::oom_of_$pid    $oom" >> "$variables_file"
44
44
      done
45
45
 
46
 
      pids="$pids"
47
46
      pids="$(echo $pids | sed -e 's/ /,/g')"
48
47
      ps ww -p "$pids" 2>/dev/null
49
48
   else
201
200
collect_mysqld_executables () {
202
201
   local mysqld_instances="$1"
203
202
 
 
203
   local ps_opt="cmd="
 
204
   if [ "$(uname -s)" = "Darwin" ]; then
 
205
      ps_opt="command="
 
206
   fi
 
207
 
204
208
   for pid in $( grep '/mysqld' "$mysqld_instances" | awk '/^.*[0-9]/{print $1}' ); do
205
 
      ps -o cmd -p $pid | sed -e 's/^\(.*mysqld\) .*/\1/' | grep -v '^CMD$'
 
209
      ps -o $ps_opt -p $pid | sed -e 's/^\(.*mysqld\) .*/\1/'
206
210
   done | sort -u
207
211
}
208
212