'How do I start a python3 program using a systemd service?
For a project at university, I'd have to have a python program I wrote start on a device automatically. The issue is, that the service behaves in a "weird" way. To be more precise: After restarting the device, the service sais it runs into a failure, than about 15 minutes later it worked (or at least it said it did, even if it actually didn't do what it was supposed to) than a minute or so later fails again.
What I want, is to start the python program (python3.6 is the version on the device, if that might be related) once the internet connection is established. Worst case scenario, the program will wait out the internet connection if it starts too soon, that was one fix I tried to add.
Here's what I have in my service file:
[Unit]
Description=copterStart: starts the copter script
After=network.target
[Service]
Type = simple
ExecStart=/usr/bin/gnome-terminal -- /usr/bin/python3 /home/rtd/mukszik0416/venv/copterMain.py
User = root
Group = root
Restart = on-failure
RestartSec=10
TimeoutStartSec = infinity
[Install]
WantedBy=multi-user.target
Thanks for any help in advance
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
