Skip to content

Commit 4871196

Browse files
committed
app: scripts: Stop trace collection before stopping CMUX
When traces are collected with CMUX trace backend, trace process needs to be stopped before stopping CMUX. If trace process is not stopped, I/O activity on CMUX'ed UART may cause ldattach process to enter uninterruptible sleep state instead of terminating correctly. When this happens, SUB serial device cannot be recovered without rebooting the Linux system. Signed-off-by: Matti Oksanen <matti.oksanen@nordicsemi.no>
1 parent 89894a8 commit 4871196

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

app/scripts/sm_stop_ppp.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ if [ -f $PPP_PIDFILE ]; then
1414
kill -SIGTERM $(head -1 <$PPP_PIDFILE)
1515
fi
1616

17+
# Stop trace collection
18+
if [ -f $TRACE_PID_FILE ]; then
19+
echo "Stopping trace collection..."
20+
kill $(cat $TRACE_PID_FILE) 2>/dev/null || true
21+
rm -f $TRACE_PID_FILE
22+
fi
1723

1824
# Wait for Shutdown script to complete
1925
if [ -f $PIDFILE ]; then
2026
echo "Waiting for Shutdown script to complete..."
2127
timeout 12s tail --pid=$(head -1 <$PIDFILE) -f /dev/null \
2228
|| echo "Timeout waiting for Shutdown script to stop"
2329
fi
24-
25-
# Stop trace collection
26-
if [ -f $TRACE_PID_FILE ]; then
27-
echo "Stopping trace collection..."
28-
kill $(cat $TRACE_PID_FILE) 2>/dev/null || true
29-
rm -f $TRACE_PID_FILE
30-
fi

0 commit comments

Comments
 (0)