From 11d43a08c24990ba0851d4aedb085c43ec6ecc8a Mon Sep 17 00:00:00 2001 From: James Smith Date: Mon, 22 Dec 2025 12:21:08 +0000 Subject: [PATCH] Add startup cleanup for stale RTL-SDR processes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kills any orphaned dump1090, rtl_adsb, rtl_433, multimon-ng, rtl_fm processes on app startup to prevent "device busy" errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- intercept.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/intercept.py b/intercept.py index 3df4bde..49aaa5a 100755 --- a/intercept.py +++ b/intercept.py @@ -12645,12 +12645,26 @@ def monitor_iridium(process): print(f"[Iridium] Monitor error: {e}") +def cleanup_stale_processes(): + """Kill any stale processes from previous runs.""" + processes_to_kill = ['dump1090', 'rtl_adsb', 'rtl_433', 'multimon-ng', 'rtl_fm'] + for proc_name in processes_to_kill: + try: + subprocess.run(['pkill', '-9', proc_name], capture_output=True) + except: + pass + + def main(): print("=" * 50) print(" INTERCEPT // Signal Intelligence") print(" Pager / 433MHz / Aircraft / Satellite / WiFi / BT") print("=" * 50) print() + + # Clean up any stale processes from previous runs + cleanup_stale_processes() + print("Open http://localhost:5050 in your browser") print() print("Press Ctrl+C to stop")