Fix: include stdlib.h in compat/string.h
[lttng-tools.git] / tests / utils / warn_processes.sh
CommitLineData
b67cd6f0
PP
1#!/bin/bash
2
bce066c4
JR
3if [ -z $PGREP ]; then
4 PGREP=pgrep
5fi
4c2eee7f 6
b67cd6f0
PP
7if [ x$LTTNG_TOOLS_TESTS_DISABLE_WARN_LTTNG_PROCESSES == x1 ]; then
8 exit
9fi
10
fdd88fe2 11color_error='\E[1;91m'
b67cd6f0
PP
12color_reset='\E[0m'
13color_bold='\E[1m'
14
4c2eee7f 15lttng_processes="$("$PGREP" -l 'lttng|gen-ust-.+')"
b67cd6f0
PP
16
17if [ $? -eq 0 ]; then
18 pids="$(cut -d ' ' -f 1 <<< "$lttng_processes" | tr '\n' ' ')"
19
fdd88fe2 20 echo -e "${color_error}Error: the following LTTng processes were detected running on the system:$color_reset"
b67cd6f0
PP
21 echo
22 echo "$lttng_processes"
23 echo
24 echo -e "Here's how to kill them: ${color_bold}kill -9 $pids$color_reset"
b67cd6f0 25 echo
fdd88fe2
JG
26 echo "The test suite will not run in the presence of those processes since its result may not be reliable."
27 echo
28 exit 1
b67cd6f0 29fi
This page took 0.040946 seconds and 5 git commands to generate.