aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kutter-mcu.service
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kutter-mcu.service')
-rw-r--r--scripts/kutter-mcu.service21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/kutter-mcu.service b/scripts/kutter-mcu.service
new file mode 100644
index 00000000..99895a37
--- /dev/null
+++ b/scripts/kutter-mcu.service
@@ -0,0 +1,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