[Unit] Description=Yaris OBD/GPS tracker web UI After=network-online.target Wants=network-online.target [Service] Type=simple User=yaris Group=yaris WorkingDirectory=/home/yaris/app/yaris-obd # Unbuffered stdout so print() diagnostics (GPS/GNSS status, etc.) actually reach # the log file promptly instead of sitting in Python's stdout buffer indefinitely # when it's redirected to a file instead of a TTY. Environment=PYTHONUNBUFFERED=1 ExecStart=/home/yaris/app/yaris-obd/venv/bin/python app.py Restart=on-failure RestartSec=5 # Give the app a few seconds after boot for USB/serial devices to enumerate # before the first connection attempt - it retries gracefully either way, # but this avoids needless noisy "no connection" logs on every cold boot. ExecStartPre=/bin/sleep 5 StandardOutput=append:/home/yaris/app/yaris-obd/yaris-obd.log StandardError=append:/home/yaris/app/yaris-obd/yaris-obd.log [Install] WantedBy=multi-user.target