# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
SESSIOND_BIN="lttng-sessiond"
+SESSIOND_MATCH=".*lttng-sess.*"
SESSIOND_PIDS=""
RUNAS_BIN="lttng-runas"
+RUNAS_MATCH=".*lttng-runas.*"
CONSUMERD_BIN="lttng-consumerd"
+CONSUMERD_MATCH=".*lttng-consumerd.*"
RELAYD_BIN="lttng-relayd"
+RELAYD_MATCH=".*lttng-relayd.*"
RELAYD_PIDS=""
LTTNG_BIN="lttng"
BABELTRACE_BIN="babeltrace"
DIR=$(readlink -f $TESTDIR)
- if [ -z $(pgrep --full lt-$RELAYD_BIN) ]; then
+ if [ -z $(pgrep $RELAYD_MATCH) ]; then
$DIR/../src/bin/lttng-relayd/$RELAYD_BIN -b $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
#$DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt -vvv >>/tmp/relayd.log 2>&1 &
if [ $? -eq 1 ]; then
pass "Start lttng-relayd (opt: $opt)"
fi
- RELAYD_PIDS=$(pgrep --full lt-$RELAYD_BIN)
+ RELAYD_PIDS=$(pgrep $RELAYD_MATCH)
}
function start_lttng_relayd()
else
out=1
while [ -n "$out" ]; do
- out=$(pgrep --full lt-$RELAYD_BIN)
+ out=$(pgrep $RELAYD_MATCH)
sleep 0.5
done
if [ $withtap -eq "1" ]; then
: ${LTTNG_SESSION_CONFIG_XSD_PATH=${DIR}/../src/common/config/}
export LTTNG_SESSION_CONFIG_XSD_PATH
- if [ -z $(pgrep --full lt-$SESSIOND_BIN) ]; then
+ if [ -z $(pgrep ${SESSIOND_MATCH}) ]; then
# Have a load path ?
if [ -n "$load_path" ]; then
$DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --load "$load_path" --background --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd"
ok $status "Start session daemon"
fi
fi
- SESSIOND_PIDS=$(pgrep --full lt-$SESSIOND_BIN)
+ SESSIOND_PIDS=$(pgrep $SESSIOND_MATCH)
}
function start_lttng_sessiond()
return
fi
- local pids="${SESSIOND_PIDS} $(pgrep --full $RUNAS_BIN)"
+ local pids="${SESSIOND_PIDS} $(pgrep $RUNAS_MATCH)"
if [ -n "$2" ]; then
kill_opt="$kill_opt -s $signal"
fi
if [ $withtap -eq "1" ]; then
- diag "Killing lt-$SESSIOND_BIN pids: $(echo $pids | tr '\n' ' ')"
+ diag "Killing $SESSIOND_BIN and lt-$SESSIOND_BIN pids: $(echo $pids | tr '\n' ' ')"
fi
kill $kill_opt $pids 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
else
out=1
while [ -n "$out" ]; do
- out=$(pgrep --full lt-$SESSIOND_BIN)
+ out=$(pgrep ${SESSIOND_MATCH})
sleep 0.5
done
out=1
while [ -n "$out" ]; do
- out=$(pgrep --full $CONSUMERD_BIN)
+ out=$(pgrep $CONSUMERD_MATCH)
sleep 0.5
done
return
fi
- PID_SESSIOND="$(pgrep --full lt-$SESSIOND_BIN) $(pgrep --full $RUNAS_BIN)"
+ PID_SESSIOND="$(pgrep ${SESSIOND_MATCH}) $(pgrep $RUNAS_MATCH)"
kill_opt="$kill_opt -s $signal"
if [ $withtap -eq "1" ]; then
- diag "Sending SIGSTOP to lt-$SESSIOND_BIN pids: $(echo $PID_SESSIOND | tr '\n' ' ')"
+ diag "Sending SIGSTOP to lt-$SESSIOND_BIN and $SESSIOND_BIN pids: $(echo $PID_SESSIOND | tr '\n' ' ')"
fi
kill $kill_opt $PID_SESSIOND 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
else
out=1
while [ $out -ne 0 ]; do
- pid=$(pgrep --full lt-$SESSIOND_BIN)
+ pid=$(pgrep $SESSIOND_MATCH)
# Wait until state becomes stopped for session
# daemon(s).
local signal=$2
local kill_opt=""
- PID_CONSUMERD=`pgrep --full $CONSUMERD_BIN`
+ PID_CONSUMERD=$(pgrep $CONSUMERD_MATCH)
if [ -n "$2" ]; then
kill_opt="$kill_opt -s $signal"
else
out=1
while [ $out -ne 0 ]; do
- pid=$(pgrep --full $CONSUMERD_BIN)
+ pid=$(pgrep $CONSUMERD_MATCH)
# If consumerds are still present check their status.
# A zombie status qualifies the consumerd as *killed*
local signal=SIGSTOP
local kill_opt=""
- PID_CONSUMERD=`pgrep --full $CONSUMERD_BIN`
+ PID_CONSUMERD=$(pgrep $CONSUMERD_MATCH)
kill_opt="$kill_opt -s $signal"
else
out=1
while [ $out -ne 0 ]; do
- pid=$(pgrep --full $CONSUMERD_BIN)
+ pid=$(pgrep $CONSUMERD_MATCH)
# Wait until state becomes stopped for all
# consumers.