Skip to content

Instantly share code, notes, and snippets.

@ali80
Created September 8, 2021 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ali80/b13859f3272321272f957785cc94b6e5 to your computer and use it in GitHub Desktop.
Save ali80/b13859f3272321272f957785cc94b6e5 to your computer and use it in GitHub Desktop.
create systemd service rpi
[Unit]
Description=Test Service
# After=multi-user.target
[Service]
WorkingDirectory=/home/pi/
User=pi
Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/pi/.Xauthority
Type=simple
ExecStart=/usr/bin/python3 /home/pi/dev//test.py
#Restart=on-abort
Restart=always
[Install]
WantedBy=graphical.target
# WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment