WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Running python script from bootlocal.sh  (Read 1186 times)

Offline corepoor

  • Newbie
  • *
  • Posts: 2
Running python script from bootlocal.sh
« on: May 27, 2021, 06:19:58 PM »
I'm currently working with piCore13.03 and I'm running into an issue getting a python script to launch at system startup.

So far, I've attempted to get the script to run from /opt/bootlocal.sh a variety of ways:
Code: [Select]
/path/to/py3 /path/to/script.py(^ for some reason, I can't write python3 up there without the post failing)
and
Code: [Select]
python3 /path/to/script.py
I've tried adding in the sleep command before the call, like:
Code: [Select]
sleep 5
/path/to/py3 /path/to/script.py

I've tried placing the script in the /opt/ directory, as well as in /home/tc/.

I was able to get it to start when placing it in /home/tc/.profile - but it seems to execute once during startup, and again when I ssh into the machine.  This isn't a deal breaker for my use, but it feels like the wrong way to do it.

Any other tips or things I can try to get this launching out of bootlocal.sh?  Or maybe somewhere else I should give a try?

I should also note, the python script has to be run as sudo, so bootlocal.sh should be fine.

Thanks!
« Last Edit: May 27, 2021, 06:27:20 PM by corepoor »