29 lines
1.0 KiB
Desktop File
29 lines
1.0 KiB
Desktop File
# 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
|
|
# --init is REQUIRED, not a convenience: the firmware keeps no state across a
|
|
# power cycle, so both axes boot into RESET and refuse to move until homed. Without
|
|
# it the service comes up and sits there, capturing nothing, with no obvious cause.
|
|
ExecStart=/opt/fire_gimbal_control/fire_gimbal_control --init --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
|