From 6740a196c2c1c4338179463b7b7697564b09f33c Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Wed, 10 Oct 2018 16:08:42 -0400 Subject: [PATCH] Define pgrep and print the processes to be killed Signed-off-by: Jonathan Rajotte --- scripts/lttng-tools/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.34.1