[Unit] Description=Memory Monitor After=network.target [Service] User=root WorkingDirectory=/home/pi2/workspace/memmon ExecStart=/usr/bin/python3 mem_monitor.py Restart=always Environment="PYTHONUNBUFFERED=1" "DISPLAY=:0" "XAUTHORITY=/home/pi2/.Xauthority" [Install] WantedBy=multi-user.target