Starting Jdownloader when booting.

  • Hello. I'm new to linux. I have libreelec on a raspberry pi 3 and I just love it. I have java and jdownloader installed for jdownloader to run headlessly and they work fine but I would like jdownloader to be running when libreelec boots up.

    I created /storage/.config/autostart.sh

    I made it exectutable and used

    dos2unix /storage/.config/autostart.sh to make sure it was the right kind of file.

    The contents of autostart.sh are

    #! /bin/sh

    (

    java -jar /storage/jd/JDownloader.jar

    ) &

    If I run autostart.sh from the command line jdownloader starts and runs just fine, but when I boot the pi jdownloader isn't running.

    I looked but I couldn't fine a thread about this. I hope that it's something simple and any help would be appreciated.

    Thanks in advance.

  • Maybe there is no network yet when jd is started. Try enabling "Wait for network" in LibreELEC settings. Or add some pause before jd is started (sleep 15).

  • Maybe there is no network yet when jd is started. Try enabling "Wait for network" in LibreELEC settings. Or add some pause before jd is started (sleep 15).

    Thanks for replying but I tried both of your suggestions to no avail. Jdownloader still didn't start up.

  • Then use larger sleep value

    Code
    #! /bin/sh
    (
      sleep 30
      java -jar /storage/jd/JDownloader.jar
    ) &

    Or maybe you need to use nohup like

    Code
      nohup java -jar /storage/jd/JDownloader.jar &
  • I should've mentioned that I did try larger sleep values after 15 didn't work. I also tried nohup after your suggestion but it didn't seem to change anything. It also didn't create a nohup.out file when I booted although it did create one when I ran autostart.sh from the command line, so I feel like autostart.sh isn't running when I boot at all.

    Thanks again for your help. I'm new at this and I feel like I must be making some really silly mistake.