A python script in the autostart.sh is not executed when LibreELEC boots up.

  • I have written a python script that turns on my network enabled Receiver, when it is in standby mode (power on) and switches on the HDMI input of the AVR, which is connected to the HDMI interface of my RasberryPi as input source.

    The file "autostart.sh" and the Python script "setAVR.py" I put both via ssh into the directory "/.config.

    The autostart.sh file looks like this:

    Bash
    #!/bin/sh
    ( /usr/bin/python /storage/.config/setAVR.py ) &

    Since the LibreELEC computer can only be pinged by a computer in the LAN after about 20sec.

    from a computer in the LAN, I assume that a script on the LibreELEC computer

    on the LibreELEC computer can only access the AVR after this time.

    If I log in to the RasPi via ssh, change to the directory /storage/.config

    and enter ./autostart.sh the script does exactly what it should:

    Code
    LibreELECKino:~/.config # ./autostart.sh
    LibreELECKino:~/.config # execution of the "setAVR.py" script

    However, when I run boot the RasPi autostart.sh, it does not seem to execute.

    What could be the reason for this?

  • Thanks for your tip. I don't know your code. Here is the output:

    ● kodi-autostart.service - Kodi user autostart script

    Loaded: loaded (/usr/lib/systemd/system/kodi-autostart.service; disabled; ven

    Active: active (exited) since Thu 2019-04-11 18:28:39 CEST; 1 years 10 months

    Process: 664 ExecStart=/bin/sh -c . /etc/profile; exec /bin/sh /storage/.confi

    Main PID: 664 (code=exited, status=0/SUCCESS)

    Memory: 1016.0K

    CGroup: /system.slice/kodi-autostart.service

    Apr 11 18:28:39 LibreELECKino systemd[1]: Starting Kodi user autostart script...

    Apr 11 18:28:39 LibreELECKino systemd[1]: Started Kodi user autostart script.

    Apr 11 18:28:40 LibreELECKino sh[664]: Traceback (most recent call last):

    Apr 11 18:28:40 LibreELECKino sh[664]: File "/storage/.config/AVRtimingtest.py

    Apr 11 18:28:40 LibreELECKino sh[664]: with open("./autostart.log", "w") as

    Apr 11 18:28:40 LibreELECKino sh[664]: IOError: [Errno 30] Read-only file system

    To be able to look up what happened during the startup process, I put logging in my Python script. But it doesn't work.

    I will adapt the script without the logging soon.

    .