Skip to content

Commit a4e370e

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 CMUUX'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 a4e370e

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

app/scripts/sm_stop_ppp.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,22 @@ PIDFILE="/var/run/nrf91-modem.pid"
88
PPP_PIDFILE="/var/run/ppp-nrf91.pid"
99
TRACE_PID_FILE="/var/run/nrf91-modem-trace.pid"
1010

11+
# Stop trace collection
12+
if [ -f $TRACE_PID_FILE ]; then
13+
echo "Stopping trace collection..."
14+
kill $(cat $TRACE_PID_FILE) 2>/dev/null || true
15+
rm -f $TRACE_PID_FILE
16+
fi
17+
1118
# Request PPPD to terminate
1219
if [ -f $PPP_PIDFILE ]; then
1320
echo "Stopping PPP link..."
1421
kill -SIGTERM $(head -1 <$PPP_PIDFILE)
1522
fi
1623

17-
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)