diff --git a/run b/run index 988cf3a..f663fc7 100755 --- a/run +++ b/run @@ -148,6 +148,12 @@ cmd_dev() { } cmd_stop() { + # Kill vision first — camera must be released before tray gets a chance to respawn it. + # Vision ignores SIGTERM (cap.read() blocks the asyncio loop), so SIGKILL is required. + pgrep -f "chobit_vision\\.py" | while read -r cpid; do + kill -9 "$cpid" 2>/dev/null + done || true + # Stop tray if [ -f "$TRAY_PIDFILE" ]; then local tray_pid @@ -168,7 +174,7 @@ cmd_stop() { kill "$cpid" 2>/dev/null done || true pgrep -f "chobit_vision\\.py" | while read -r cpid; do - kill "$cpid" 2>/dev/null + kill -9 "$cpid" 2>/dev/null done || true # Stop Godot