Repository navigation
wd_rtsp.sh: make the locked rRTSPServer check work - #482
Merged
alienatedsec merged 1 commit intoNov 11, 2026
Merged
Conversation
check_rtsp() counts sockets with grep ":$RTSP_PORT ", but the script only sets RRTSP_PORT. With the empty variable the pattern is ": ", which matches no netstat line, so SOCKET is always 0 and the "possible locked process" check never runs: a hung rRTSPServer is not restarted. Use RRTSP_PORT and count ESTABLISHED connections instead of LISTEN, as wd.sh in yi-hack-Allwinner-v2 does. The check is meant for "clients are connected but the server uses no CPU"; with LISTEN it would also count an idle server that has no clients. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
check_rtsp()greps netstat for":$RTSP_PORT ", but the script only setsRRTSP_PORT. With the empty variable the pattern is": ", which matches no line, soSOCKETis always 0 and the "possible locked process" branch never runs: a hung rRTSPServer is never restarted.This uses
RRTSP_PORTand counts ESTABLISHED connections instead of LISTEN, aswd.shin yi-hack-Allwinner-v2 does. The check is meant for "clients are connected but the server uses no CPU"; counting LISTEN would also apply it to an idle server with no clients.Tested on a Yi Outdoor 1080p (Hi3518E, 0.4.1, RTSP_STREAM=both) with two RTSP clients, using a copy of the script whose actions only log:
SOCKETis 0 on every loop;kill -STOPon rRTSPServer it logs "Detected possible locked process (1)" … "(10)" within ~16 s, then "Restarting rtsp process";top -b -n 1, and reset on the next loop. It never came close to the limit of 10.🤖 Generated with Claude Code