aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kutter-mcu.service
blob: 99895a376bad2ac6c2bedcbb0de5f102bfe854bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#Systemd kutter linux mcu Service

[Unit]
Description=Starts the MCU Linux firmware for kutter on startup
Documentation=https://the-tk.com/cgit/kutter/tree/docs/RPi_microcontroller.md
Before=kutter.service
ConditionFileIsExecutable=/usr/local/bin/kutter_mcu

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
Environment=KUTTER_HOST_MCU_SERIAL=/tmp/kutter_host_mcu
RemainAfterExit=yes
ExecStart=/usr/local/bin/kutter_mcu -r -I ${KUTTER_HOST_MCU_SERIAL}
ExecStop=sh -c 'echo "FORCE_SHUTDOWN" > ${KUTTER_HOST_MCU_SERIAL}'
ExecStop=sleep 1
TimeoutStopSec=2
Restart=always
RestartSec=5