#!/bin/bash # Stop the player and watchdog # Use this to gracefully shutdown the player SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" echo "==========================================" echo "Stopping Kivy Signage Player" echo "==========================================" echo "" # Kill watchdog (start.sh) echo "Stopping watchdog..." pkill -f "bash.*start.sh" # Kill player # NOTE: match the linux/run_linux.py entry point, not "python3 main.py" — the # player is started as `python3 linux/run_linux.py` from the project root. echo "Stopping player..." pkill -f "run_linux.py" # Give processes time to exit gracefully sleep 2 # Force kill if still running pkill -9 -f "bash.*start.sh" 2>/dev/null pkill -9 -f "run_linux.py" 2>/dev/null # Clean up heartbeat and stop flag files rm -f "$SCRIPT_DIR/.player_heartbeat" rm -f "$SCRIPT_DIR/.player_stop_requested" echo "" echo "✓ Player and watchdog stopped" echo ""