scripts: add systemd klipper-mcu.service example

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej 2023-01-14 01:00:15 +01:00 committed by KevinOConnor
parent deed7f829a
commit e631840ad6
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#Systemd klipper linux mcu Service
[Unit]
Description=Starts the MCU Linux firmware for klipper on startup
Documentation=https://www.klipper3d.org/RPi_microcontroller.html
Before=klipper.service
ConditionFileIsExecutable=/usr/local/bin/klipper_mcu
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
Environment=KLIPPER_HOST_MCU_SERIAL=/tmp/klipper_host_mcu
RemainAfterExit=yes
ExecStart=/usr/local/bin/klipper_mcu -r -I ${KLIPPER_HOST_MCU_SERIAL}
ExecStop=sh -c 'echo "FORCE_SHUTDOWN" > ${KLIPPER_HOST_MCU_SERIAL}'
ExecStop=sleep 1
TimeoutStopSec=2
Restart=always
RestartSec=5