[Unit] Description=STT Watchdog (manages STT with crash recovery and auto-updates) After=network.target [Service] Type=simple # The user who owns the checkout, not root: a root service leaves root-owned files in # the checkout and ~/.stt that the in-app updater, running as that user, cannot touch. # The capability is what root was for: binding port 80. User=ai Group=ai AmbientCapabilities=CAP_NET_BIND_SERVICE # ── Compiled binary install ──────────────────────────────────────────────── # ExecStart=/opt/STT/STT-Watchdog --headless # ── Python source install ────────────────────────────────────────────────── # Uncomment and adjust paths for your install: WorkingDirectory=/home/ai/STT Environment="PYTHONUNBUFFERED=1" Environment="HOME=/home/ai" ExecStart=/home/ai/STT/.venv/bin/python3 /home/ai/STT/stt/watchdog.py --headless # systemd restarts the watchdog itself if it crashes; the watchdog handles STT restarts Restart=on-failure RestartSec=10 StandardOutput=journal StandardError=journal SyslogIdentifier=stt-watchdog [Install] WantedBy=multi-user.target