In my current project with Rpi I am using two python scripts at the startup. One is the GUI script and the other one is the normal terminal script. It is actually a live graph update of various sensors. The problem that I am currently facing is with shutdown and reboot of Pi. When I do a reboot or the shut down my scripts runs good for like 20s or 30s and then the graph suddenly jumps to somewhere random on time axis skipping approximately 50s or something. But when I call the script with
sudo python3 Test.py
it just functions flawlessly.
What I comprehend is that when I reboot or shutdown my pi, somehow the script in the autorun doesn't kill itself. I'd be grateful if someone can help me with this bug.
Thank you in advance