[mcu host] Can not update MCU 'mcu' config as it is shutdown after system reset/start

I have found a solution. Instead of:

cd ~/klipper/
sudo cp "./scripts/klipper-mcu-start.sh" /etc/init.d/klipper_mcu
sudo update-rc.d klipper_mcu defaults

I made the following additions, because MainsailOS uses systemd and the boot sequence gets messed up.

  • Creation of the file /etc/systemd/system/klipper-mcu.service
#Systemd Klipper-MCU Service

[Unit]
Description=Starts Klipper MCU for Klipper
Documentation=https://www.klipper3d.org/
After=network.target
Before=klipper.service

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
User=root
RemainAfterExit=yes
ExecStart= /home/pi/klipper/scripts/klipper-mcu-start.sh start
Restart=always
RestartSec=10

The path to klipper/scripts/klipper-mcu-start.sh may have to be changed.

  • sudo systemctl daemon-reload
  • sudo systemctl enable klipper-mcu

With ‘User = root’ I am unsure, unfortunately could not create a custom folder below /var/run that survives the reboot including permissions.