From: Jonathan Rajotte Date: Wed, 10 Oct 2018 20:08:42 +0000 (-0400) Subject: Define pgrep and print the processes to be killed X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6740a196c2c1c4338179463b7b7697564b09f33c;p=lttng-ci.git Define pgrep and print the processes to be killed Signed-off-by: Jonathan Rajotte --- diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index 36c87b0..052eb8d 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -102,6 +102,8 @@ UST_JAVA="$WORKSPACE/deps/lttng-ust/build/share/java/" BABEL_LIBS="$WORKSPACE/deps/babeltrace/build/lib/" BABEL_BINS="$WORKSPACE/deps/babeltrace/build/bin/" +# pgrep +PGREP=pgrep # Set platform variables case "$arch" in @@ -342,8 +344,11 @@ if [ "$RUN_TESTS" = "yes" ]; then # Kill any LTTng-related process lttng_processes="$("$PGREP" -l 'lttng|gen-ust-.+')" if [ $? -eq 0 ]; then + echo "The following LTTng processes were detected running on the system and will be killed:" + echo "$lttng_processes" + pids="$(cut -d ' ' -f 1 <<< "$lttng_processes" | tr '\n' ' ')" - kill -9 $pids + kill -SIGKILL $pids fi # Add 'babeltrace' binary to PATH