I am using .bashrc to execute a python script on system boot:
sudo -u pi python3 /path/to/script.py
and then I add @lxterminal to file /etc/xdg/lxsession/LXDE-pi/autostart to make sure a terminal window is opened on launch.
however, when I use ps aux to check all progresses, I found that there's two script.py processes running in the system, even though I call execute the script only once in .bashrc. Having two of the same script running at the same time is causing me troubles. Any help is appreciated.
yes ive tried with the other methods but couldn't get them to work. THe curious thing is that i have 5 pis all configured the same way, but one of them only executes the script once. Apparently it is only executing the script when the terminal is opened and not when the system boots. any ideas here? rc.local method never worked for me as nothing happened on startup