Sign in
Log inSign up

pygame script fails when run with systemd

Nitesh Waghmare's photo
Nitesh Waghmare
·Mar 28, 2019

I'm tring to run pygame script using systemd service. but when I started a service using

```sudo systemctl daemon-reload sudo systemctl enable myservice.service

when I Check Status of that service

```● rpi.service - RPi-Service
   Loaded: loaded (/lib/systemd/system/rpi.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Thu 2019-03-28 11:52:59 IST; 6min ago
  Process: 1658 ExecStart=/usr/bin/python3 /home/pi/Documents/project1/allnewone.py (code=killed, signal=HUP)
 Main PID: 1658 (code=killed, signal=HUP)

Mar 28 11:52:58 raspberrypi systemd[1]: Started RPi-Service.

Hear Is my Service

Description= RPi-Service 
After = multi-user.target 

[Service] 
Type = simple 
ExecStart = /usr/bin/python3  /home/pi/Documents/project1/allnewone.py 
#ExecStart = ./home/pi/Documents/project1/allnewone 
Restart = on-abort 
RestartSec = 5 
KillMode = process 

[Install] 
WantedBy=multi-user.target