Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7512

Automation, sensing and robotics • Re: Make code run in TTY1 on startup

$
0
0
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.
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.

Statistics: Posted by Greggles — Sun Mar 30, 2025 8:02 pm



Viewing all articles
Browse latest Browse all 7512

Trending Articles