I have previously tried this, and it failed. The script "sudo openvt -sf python3 /home/pi/servertesting.py", or "python3 /home/pi/servertesting.py" can start it, but only if it executes in a proper TTY. I don't know why - It just does not work.Go with systemd.
As indicated in the url provided, write a service file. Enable and start using systemctl.
sudo systemctl enable yourservice.service
sudo systemctl start yourservice.service
Check the status of the service with
systemctl status yourservice
Look for error messages in journalctl, in a terminal window run
sudo journalctl -u yourservice
If there are error messages, you should see em there.
Statistics: Posted by Greggles — Sun Mar 30, 2025 8:02 pm