+ local timeout_s=$3
+ local dtimeleft_s=
+
+ # Multiply time by 2 to simplify integer arithmetic
+ if [ -n "$timeout_s" ]; then
+ dtimeleft_s=$((timeout_s * 2))
+ fi
+
+ local retval=0
+ local pids=
+
+ pids=$(pgrep "$RELAYD_MATCH")
+ if [ -z "$pids" ]; then
+ if [ "$withtap" -eq "1" ]; then
+ pass "No relay daemon to kill"
+ fi
+ return 0
+ fi
+
+ diag "Killing (signal $signal) lttng-relayd (pid: $pids)"
+
+ # shellcheck disable=SC2086
+ if ! kill -s $signal $pids 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST; then
+ retval=1
+ if [ "$withtap" -eq "1" ]; then