# systemd user-level unit for SanadV3. Install with:
#
#   mkdir -p ~/.config/systemd/user
#   cp ~/Sanadv3/shell_scripts/sanad.service ~/.config/systemd/user/sanad.service
#   systemctl --user daemon-reload
#   systemctl --user enable --now sanad.service
#   sudo loginctl enable-linger unitree   # run at boot even when not logged in
#
# Watch logs:
#   journalctl --user -u sanad.service -f
#
# Restart after a code/config change:
#   systemctl --user restart sanad.service

[Unit]
Description=SanadV3 robot assistant (FastAPI dashboard + voice/motion subsystems)
After=network-online.target
Wants=network-online.target

[Service]
Type=exec
WorkingDirectory=%h/Sanadv3
ExecStart=/usr/bin/env bash %h/Sanadv3/shell_scripts/start_sanad.sh
Environment=PORT=8001
Restart=on-failure
RestartSec=5
TimeoutStopSec=15
KillSignal=SIGINT
PassEnvironment=PULSE_RUNTIME_PATH XDG_RUNTIME_DIR

[Install]
WantedBy=default.target
