seho85 / klipper-dgus

A python project to connect a DGUS display to Klipper
GNU General Public License v3.0
44 stars 12 forks source link

Create systemd service file to enable automatic startup of display control application #18

Closed seho85 closed 2 years ago

seho85 commented 2 years ago

Currently the python application needed to be started manually, this is pretty unusable for productive usage.

A systemd service file that allows automatic starting and stopping of the display application.

Robnex commented 2 years ago

hi,

it could be like this. Tested check

[Unit]
Description=dgus display service
Requires=network.target moonraker.service
#Wants=network.target klipper.service moonraker.service
After=network.target moonraker.service klipper.service

[Service]
Type=oneshot
User=pi
RemainAfterExit=yes
ExecStartPre=/usr/bin/sleep 15
ExecStart=/home/pi/klipper-dgus/src/start.sh
ExecStop=/home/pi/klipper-dgus/src/stop.sh

[Install]
WantedBy=multi-user.target
seho85 commented 2 years ago

A service "template" has been added with commit db4b81e1391b38c2b997894ef3add6a96d698959

Just replace:

with the directory of the dgus_installation with the directory where the configuration files were stored.