How To Run Pygame Script Using Systemd Service?
I Wanted to run pygame script using systemd service for that followed these steps to run a pygame script using systemd service sudo systemctl daemon-reload sudo systemctl enable
Solution 1:
Here is the solution
#rpi.service
[Unit]
Description= RPi-Service
After = multi-user.target
[Service]
Type = simple
Environment="DISPLAY=:0"
Environment="XAUTHORITY=/home/pi/.Xauthority"
ExecStart = /usr/bin/python3 /home/pi/Documents/project1/allnewone.py
Restart = always
RestartSec = 5
KillMode = process
SendSIGHUP = no
[Install]
WantedBy= graphical.target
Post a Comment for "How To Run Pygame Script Using Systemd Service?"