ffrr
1
Hi all,
In /storage/.config/autostart.sh exists line for running my python script:
/storage/script.py
But after reboot CE device script don’t do anything. When I run it directly from CLI everything is fine:
./script.py
I also tried in autostart.sh this lines:
(python /storage/script.py)
and
./storage/script.py
but unsuccessfully.
vpeter
2
The main question here is what does this script do.
ffrr
3
Take content of 1 text file and insert value to remote database.
vpeter
4
Then I would assume the network is not yet up. Try
(
# maybe some sleep needed
sleep 5
python /storage/script.py
)&
ffrr
5
thank you for advice! () & required or possible to use only sleep + python /storage/script.py ?
vpeter
6
If you use ()& then this block is run in background and kodi can start immediately. If not kodi will start only when script ends.
ffrr
7
I used even sleep 10 and ()& but unfortunately python script did not run. Any ideas?
vpeter
8
Hard to tell without seeing the script. Put some logs in it and save them to file.
Salesi
9
chmod 775 ./storage/script.py
ffrr
10
Unfortunately after chmod 775 script.py doesn’t run also.
vpeter
11
Why not showing the script and your problem will be solved asap. Without this it is just guessing.
Did you put some logs in your script to follow execution? Seems not…
ffrr
12
#!/usr/bin/env python3
long content
ffrr
13
please give me an example for python log code; although script running successfully by manual via CLI…
ffrr
14
In CoreELEC exists some system log where I can try to find info?
ffrr
15
in PATH exists /usr/bin, so strange that script can only be run manually without autostart.sh:
env | grep PATH
LD_LIBRARY_PATH=:/usr/lib/pulseaudio
PATH=/opt/bin:/opt/sbin:/usr/bin:/usr/sbin:/storage/.kodi/addons/service.aml-vnc/bin
successfully run
python3 script.py
but when
(script.py)&
-sh: ./storage/.config/script.py: not found
system
Closed
16
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.