jjb: babeltrace: use clang-format-16
[lttng-ci.git] / scripts / lttng-tools / prebuild_clean_processes_coredumps.sh
CommitLineData
70076186
MJ
1#!/bin/bash
2#
3# SPDX-FileCopyrightText: 2018 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
4#
5# SPDX-License-Identifier: GPL-2.0-or-later
6
7set -exu
8
9pids=()
10
11# Kill any LTTng-related process
12lttng_processes="$(pgrep -l 'lttng|gen-ust-.+')" || true
13if [ -n "$lttng_processes" ]; then
14 echo "The following LTTng processes were detected running on the system and will be killed:"
15 echo "$lttng_processes"
16
17 # Build the pids array
18 while read -r pid; do
19 pids+=("$pid")
20 done < <(cut -d ' ' -f 1 <<< "$lttng_processes")
21
22 kill -SIGKILL "${pids[@]}"
23fi
24
25# Remove any coredump already present
26find "/tmp" -name "core\.[0-9]*" -type f -delete || true
This page took 0.025875 seconds and 4 git commands to generate.