diff options
author | Stefan Dej <meteyou@gmail.com> | 2023-01-14 01:00:15 +0100 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2023-01-17 18:17:25 -0500 |
commit | e631840ad6e7e186a3a568c9e1366f419b8dc778 (patch) | |
tree | 2161002a259decb31b31e1043aa33ccab28d4061 /scripts | |
parent | deed7f829a83a46ee2646e049791b4b150b2febf (diff) | |
download | kutter-e631840ad6e7e186a3a568c9e1366f419b8dc778.tar.gz kutter-e631840ad6e7e186a3a568c9e1366f419b8dc778.tar.xz kutter-e631840ad6e7e186a3a568c9e1366f419b8dc778.zip |
scripts: add systemd klipper-mcu.service example
Signed-off-by: Stefan Dej <meteyou@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/klipper-mcu.service | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/klipper-mcu.service b/scripts/klipper-mcu.service new file mode 100644 index 00000000..ca15c86b --- /dev/null +++ b/scripts/klipper-mcu.service @@ -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 |