scripts: scripts-library.sh: Use pgrep -f to find the dstat process

The dstat process is actually a python script so running 'pgrep dstat'
will not match it

~# pgrep dstat
~# ps aux|grep dstat
root      5322  1.0  0.2  42888  8876 pts/0    S    16:16   0:00 python /usr/bin/dstat -tcmsdn --top-cpu --top-mem --top-bio --nocolor --output dstat.csv 3

However, we can use 'pgrep -f' to search for 'dstat' in the entire
procees string.

~# pgrep -f dstat
5322

Change-Id: I17c181bf957626cc11a1fe6f954e54c8abbfbd93
This commit is contained in:
Markos Chandras 2017-11-16 15:18:33 +00:00 committed by Markos Chandras (hwoarang)
parent 33836d3d5e
commit 078c89bec9
1 changed files with 1 additions and 1 deletions

View File

@ -190,7 +190,7 @@ function run_dstat {
}
function generate_dstat_charts {
kill $(pgrep dstat)
kill $(pgrep -f dstat)
if [[ ! -d /opt/dstat_graph ]]; then
git clone https://github.com/Dabz/dstat_graph /opt/dstat_graph
fi