Skip to content
Romain Tourte edited this page Jul 7, 2018 · 5 revisions

Used to track Raspberry GPS Position.

Python as Service

Create a script on /lib/systemd/system sudo nano /lib/systemd/system/tamata-gps.service

[Unit]
Description=Tamata Gps Tracker
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/python /home/pi/code/Tamata-GpsD/GpsPython/GPS.py
Restart=on-abort

[Install]
WantedBy=multi-user.target

`

Giving rights to execute the service

chmod 644 /lib/systemd/system/tamata-gps.service
chmod +x /lib/systemd/system/tamata-gps.service

Service declaration

sudo systemctl daemon-reload
sudo systemctl enable tamata-gps.service

Command start / stop

sudo systemctl start tamata-gps.service
sudo systemctl stop tamata-gps.service

Log file will be generated as .txt at /home/pi/code/Tamata-GpsD/GpsPython/log directory

Clone this wiki locally