Probier mal folgendes und schau mal nach, ob die Datei /home/pi/.Xauthority auch existiert.
After und WantedBy sind verändert und Environment ist dazu gekommen.
Code Alles anzeigen[Unit] Description=Frontend Service After=multi-user.target [Service] Type = simple Environment="DISPLAY=:0" Environment="XAUTHORITY=/home/pi/.Xauthority" WorkingDirectory=/home/pi/Frontend ExecStart=/usr/bin/python3 /home/pi/Frontend/main.py StandardError=syslog SyslogIdentifier=Frontend Restart=on-failure RestartSec=20 [Install] WantedBy=graphical.target
Hint: Manchmal ist es hilfreich die Dokumentation zu kennen. Und ja, die Doku ist scheiße ...
Die Datei /home/pi/.Xauthority existiert !
Leider funktioniert das auch nicht:
Code
pi@raspberry:~$ systemctl daemon-reload
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
Legitimierung ist zum erneuten Laden des systemd-Zustands notwendig.
Authenticating as: ,,, (pi)
Password:
==== AUTHENTICATION COMPLETE ===
pi@raspberry:~$ sudo systemctl start Frontend.service
pi@raspberry:~$ sudo systemctl status Frontend.service
● Frontend.service - Frontend Service
Loaded: loaded (/etc/systemd/system/Frontend.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Apr 28 09:38:46 raspberry systemd[1]: /etc/systemd/system/Frontend.service:6: Neither a valid executable name nor an absolute path: DISPLAY=/usr/bin/python3
Apr 28 09:38:57 raspberry systemd[1]: /etc/systemd/system/Frontend.service:6: Neither a valid executable name nor an absolute path: DISPLAY=/usr/bin/python3
Apr 28 09:39:39 raspberry systemd[1]: /etc/systemd/system/Frontend.service:6: Neither a valid executable name nor an absolute path: DISPLAY=/usr/bin/python3
Apr 28 09:39:42 raspberry systemd[1]: /etc/systemd/system/Frontend.service:6: Neither a valid executable name nor an absolute path: DISPLAY=/usr/bin/python3
Apr 28 10:43:50 raspberry systemd[1]: Started Frontend Service.
Apr 28 10:43:53 raspberry systemd[1]: Frontend.service: Main process exited, code=killed, status=1/HUP
Apr 28 10:43:53 raspberry systemd[1]: Frontend.service: Succeeded.
Apr 28 10:44:41 raspberry systemd[1]: Started Frontend Service.
Apr 28 10:44:44 raspberry systemd[1]: Frontend.service: Main process exited, code=killed, status=1/HUP
Apr 28 10:44:44 raspberry systemd[1]: Frontend.service: Succeeded.
pi@raspberry:~$
Alles anzeigen