Repository navigation
20261008 - Stop sdrplay-restart.sh pretending to restart the SDRplay service - #80
Merged
Merged
Conversation
…service sdrplay-restart.sh runs before blah2 on every container start and logged "Restarting SDRplay services... reset complete", but it never restarted anything. Its pkill -x sdrplay_apiService could not match: Linux truncates a process name to 15 characters, so the service runs as "sdrplay_apiServ", and the warning pkill prints was sent to /dev/null with the exit code swallowed by || true. Before the script was baked into the image (v0.3.0) it used killall, which the image did not have, so inside the container the kill has never worked. Its other line, pkill -x blah2, could only ever find a blah2 in another container, since the shared host PID namespace makes those visible: a process named blah2 in a second container was killed on a test node when the production blah2 restarted. Both kills and the misleading log lines are removed. Resetting the SDRplay service belongs to the host side, which holds the restart lock: the radar GUI's apply and mode switches, and the watchdog. A working kill here would have added a second, unsettled service restart to each of them. The 2 s pause stays, because several of those paths start blah2 straight after restarting the service and this is their only gap, and the file stays because the compose files call it by path. Checked live on a test node by mounting the new script over the image's copy: a container restart left the service's PID unchanged exactly as the old script did, and a config apply, the watchdog's recovery and a reboot each brought blah2 up with the same pause and the device found. CLAUDE.md's "SDRplay Restart" advice pointed at this script; it now gives a restart sequence that works. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Summary
sdrplay-restart.shruns before blah2 on every container start and logs "Restarting SDRplay services... reset complete", but it has never restarted anything inside the container.pkill -9 -x sdrplay_apiServicecannot match. Linux truncates a process name (comm) to 15 characters, so the service runs assdrplay_apiServ.pkillwarns about exactly this, but the warning went to/dev/nulland the exit code was swallowed by|| true. Before v0.3.0 the script usedkillall, which the image did not have, so this kill has never worked in the container.pkill -9 -x blah2does match, but only the wrong thing. At a normal container start, blah2 is not running yet. Withpid: host, the onlyblah2it can find is one in another container.This PR removes both kills and the misleading log lines. It keeps the 2 s pause and the file itself.
Why remove rather than fix
Resetting the SDRplay service belongs to the host side, which holds
/data/retina-gui/restart.lock: retina-gui's apply and mode switches, and the owl-os watchdog. In almost every path that starts this container, one of them has just restarted the service. A kill that worked would add a second service restart with only a 2 s gap. retina-gui has documented that back-to-back pattern as wedging the device.The pause stays because several host-side paths (the switch to radar,
enforce_radar_mode, the watchdog) start blah2 straight after restarting the service, and this is their only gap. The file stays because retina-node's compose and this repo's compose call it by path.Verification
Live on a test node (RSPduo, SDRplay API 3.15).
The old script, on the current image:
pgrep -x sdrplay_apiServicefrom inside the containerpgrep -fon the full command lineblah2in a separate containerThe new script, mounted over the image's copy via the manifest:
NumDevs=1, 2.26 s pauseNumDevs=1, 2.22 s pauserestarts 1), the same as the old script;NumDevs=1, 2.3 s pauseIn every case, only the host side restarted the service, never the container. Not verified: a standalone install without the watchdog, where behaviour is unchanged too, since the kill never ran there either.
Docs
CLAUDE.md's "SDRplay Restart" section told people to runsudo ./sdrplay-restart.sh, which was a no-op on the host for the same reason. It now gives a sequence that works:It also has the
pkill -ffallback for when the service ignores SIGTERM, and says the script only pauses. The README does not mention the script.Not in this PR
pkill -9 -f sdrplay_apiService, in retina-node's compose and in retina-spectrum's. That one is a no-op becausepkillis not installed in its image. It is removed in separate PRs in those repos.🤖 Generated with Claude Code