Skip to content

20261008 - Stop sdrplay-restart.sh pretending to restart the SDRplay service - #80

Merged
Purple10101 merged 1 commit into
mainfrom
20261008-remove-dead-sdrplay-kills
Oct 8, 2026
Merged

Purple10101 merged 1 commit into
mainfrom
20261008-remove-dead-sdrplay-kills

Conversation

@Purple10101

Copy link
Copy Markdown

Summary

sdrplay-restart.sh runs 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_apiService cannot match. Linux truncates a process name (comm) to 15 characters, so the service runs as sdrplay_apiServ. pkill warns about exactly this, but the warning went to /dev/null and the exit code was swallowed by || true. Before v0.3.0 the script used killall, which the image did not have, so this kill has never worked in the container.
  • pkill -9 -x blah2 does match, but only the wrong thing. At a normal container start, blah2 is not running yet. With pid: host, the only blah2 it 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:

Check Result
Service PID across a container restart Unchanged (13340), although the log said "reset complete"
pgrep -x sdrplay_apiService from inside the container "pattern ... longer than 15 characters will result in zero matches", rc 1
pgrep -f on the full command line Finds the service (PID 13340), so the process is visible and only the name match fails
A decoy process named blah2 in a separate container Killed (exit 137) when the production blah2 restarted
Pause before blah2 opens the device 2.06 s

The new script, mounted over the image's copy via the manifest:

Start path Result
Plain container restart Service PID unchanged (405472), the same as the old script
Config apply through retina-gui retina-gui restarted the service; blah2 came up after the settle, NumDevs=1, 2.26 s pause
The owl-os watchdog script, run for real on a stale map The watchdog restarted the service; blah2 came up, NumDevs=1, 2.22 s pause
Reboot One silent first attempt then up (restarts 1), the same as the old script; NumDevs=1, 2.3 s pause

In 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 run sudo ./sdrplay-restart.sh, which was a no-op on the host for the same reason. It now gives a sequence that works:

  1. stop blah2
  2. restart the service
  3. settle
  4. start blah2.

It also has the pkill -f fallback for when the service ignores SIGTERM, and says the script only pauses. The README does not mention the script.

Not in this PR

  • retina-spectrum's start command has its own pkill -9 -f sdrplay_apiService, in retina-node's compose and in retina-spectrum's. That one is a no-op because pkill is not installed in its image. It is removed in separate PRs in those repos.
  • Dropping the script call from the compose files, and the script itself, is a later cross-repo cleanup.

🤖 Generated with Claude Code

…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>
@Purple10101
Purple10101 merged commit 71e9b14 into main Oct 8, 2026
1 check passed
@Purple10101
Purple10101 deleted the 20261008-remove-dead-sdrplay-kills branch October 8, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant