-# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
+# Copyright (C) 2012 David Goulet <dgoulet@efficios.com>
#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation; version 2.1 of the License.
+# SPDX-License-Identifier: LGPL-2.1-only
#
-# This library is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
SESSIOND_BIN="lttng-sessiond"
SESSIOND_MATCH=".*lttng-sess.*"
source $TESTDIR/utils/tap/tap.sh
-if [ -z $LTTNG_TEST_TEARDOWN_TIMEOUT ]; then
+if [ -z ${LTTNG_TEST_TEARDOWN_TIMEOUT+x} ]; then
LTTNG_TEST_TEARDOWN_TIMEOUT=60
fi
DIR=$(readlink -f "$TESTDIR")
- if [ -z $(pgrep $RELAYD_MATCH) ]; then
+ if [ -z $(pgrep -f $RELAYD_MATCH) ]; then
# shellcheck disable=SC2086
$DIR/../src/bin/lttng-relayd/$RELAYD_BIN $process_mode $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
#$DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt -vvv >>/tmp/relayd.log 2>&1 &
local retval=0
local pids=
- pids=$(pgrep "$RELAYD_MATCH")
+ pids=$(pgrep -f "$RELAYD_MATCH")
if [ -z "$pids" ]; then
if [ "$withtap" -eq "1" ]; then
pass "No relay daemon to kill"
else
out=1
while [ -n "$out" ]; do
- out=$(pgrep "$RELAYD_MATCH")
+ out=$(pgrep -f "$RELAYD_MATCH")
if [ -n "$dtimeleft_s" ]; then
if [ $dtimeleft_s -lt 0 ]; then
out=
: "${LTTNG_SESSION_CONFIG_XSD_PATH="${DIR}/../src/common/config/"}"
export LTTNG_SESSION_CONFIG_XSD_PATH
- if [ -z "$(pgrep "${SESSIOND_MATCH}")" ]; then
+ if [ -z "$(pgrep -f "${SESSIOND_MATCH}")" ]; then
# Have a load path ?
if [ -n "$load_path" ]; then
# shellcheck disable=SC2086
local retval=0
local runas_pids=
- runas_pids=$(pgrep "$RUNAS_MATCH")
+ runas_pids=$(pgrep -f "$RUNAS_MATCH")
local pids=
- pids=$(pgrep "$SESSIOND_MATCH")
+ pids=$(pgrep -f "$SESSIOND_MATCH")
if [ -n "$runas_pids" ]; then
pids="$pids $runas_pids"
else
out=1
while [ -n "$out" ]; do
- out=$(pgrep "${SESSIOND_MATCH}")
+ out=$(pgrep -f "${SESSIOND_MATCH}")
if [ -n "$dtimeleft_s" ]; then
if [ $dtimeleft_s -lt 0 ]; then
out=
done
out=1
while [ -n "$out" ]; do
- out=$(pgrep "$CONSUMERD_MATCH")
+ out=$(pgrep -f "$CONSUMERD_MATCH")
if [ -n "$dtimeleft_s" ]; then
if [ $dtimeleft_s -lt 0 ]; then
out=
return
fi
- PID_SESSIOND="$(pgrep "${SESSIOND_MATCH}") $(pgrep "$RUNAS_MATCH")"
+ PID_SESSIOND="$(pgrep -f "${SESSIOND_MATCH}") $(pgrep -f "$RUNAS_MATCH")"
if [ "$withtap" -eq "1" ]; then
diag "Sending SIGSTOP to lt-$SESSIOND_BIN and $SESSIOND_BIN pids: $(echo "$PID_SESSIOND" | tr '\n' ' ')"
else
out=1
while [ $out -ne 0 ]; do
- pid="$(pgrep "$SESSIOND_MATCH")"
+ pid="$(pgrep -f "$SESSIOND_MATCH")"
# Wait until state becomes stopped for session
# daemon(s).
local retval=0
- PID_CONSUMERD="$(pgrep "$CONSUMERD_MATCH")"
+ PID_CONSUMERD="$(pgrep -f "$CONSUMERD_MATCH")"
if [ -z "$PID_CONSUMERD" ]; then
if [ "$withtap" -eq "1" ]; then
else
out=1
while [ $out -ne 0 ]; do
- pid="$(pgrep "$CONSUMERD_MATCH")"
+ pid="$(pgrep -f "$CONSUMERD_MATCH")"
# If consumerds are still present check their status.
# A zombie status qualifies the consumerd as *killed*
local withtap=$1
local signal=SIGSTOP
- PID_CONSUMERD="$(pgrep "$CONSUMERD_MATCH")"
+ PID_CONSUMERD="$(pgrep -f "$CONSUMERD_MATCH")"
diag "Sending SIGSTOP to $CONSUMERD_BIN pids: $(echo "$PID_CONSUMERD" | tr '\n' ' ')"
else
out=1
while [ $out -ne 0 ]; do
- pid="$(pgrep "$CONSUMERD_MATCH")"
+ pid="$(pgrep -f "$CONSUMERD_MATCH")"
# Wait until state becomes stopped for all
# consumers.