# systemd unit template for Fire Gimbal Control.
# Copy to /etc/systemd/system/, adjust the paths/user, then:
#   sudo systemctl daemon-reload
#   sudo systemctl enable --now fire-gimbal-control
#
# Credentials are passed via the environment (not the config file). Prefer an
# EnvironmentFile with 0600 perms over inline Environment= lines.

[Unit]
Description=Fire Gimbal Control
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=ggs
WorkingDirectory=/opt/fire_gimbal_control
ExecStart=/opt/fire_gimbal_control/fire_gimbal_control --start
Environment=FGC_CONFIG=/opt/fire_gimbal_control/config.ini
# EnvironmentFile=/etc/fire_gimbal_control/credentials.env   # FGC_MQTT_USER / FGC_MQTT_PW
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
