#1
|
|||
|
|||
Raspberry Pi: JDownloader remote access not working
I have a rPi 1 model b running Raspbian Jessie lite (headless). I want to install JD2 headless so that I can remotely send downloads to it using my phone, but I cant get it to work. I followed this guide, including installing Oracle Java 8, but it doesnt show up in my jdownloader. Here are the steps in order
Code:
sudo apt-get install oracle-java8-jdk mkdir jdownloader cd jdownloader wget http://installer.jdownloader.org/JDownloader.jar java -Djava.awt.headless=true -jar JDownloader.jar Code:
sudo nano /home/pi/jdownloader/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json Code:
{ "password" : "mypassword", "email" : "email@home.org" } Code:
#! / Bin / sh # ## BEGIN INIT INFO # Provides: JDownloader2 # Required-Start: networking # Required-Stop: # Default start: 2 3 4 5 # Default Stop: 0 1 6 # Short-Description: JDownloader2 server daemon # Description: JDownloader2 server daemon # ## END INIT INFO DIR=”/home/pi/jdownloader” PIDFILE = " $ DIR /JDownloader.pid " JAVA=”/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java” PARAM = " -Djava.awt.headless = true -jar $ DIR /JDownloader.jar " Start_daemon () { Start-stop-daemon --start --background --oknodo --chuid $ USER --make-pidfile --pidfile $ PIDFILE --exec $ JAVA - $ PARAM } Stop_daemon () { Start-stop-daemon --stop --pidfile $ PIDFILE } # Switch case Case " $ 1 " in begin) # On start Echo " Start JDownloader " Start_daemon ;; Stop) # On stop Echo " Stop JDownloader " Stop_daemon ;; Restart) # On restart Echo " Restart JDownloader " Start_daemon Stop_daemon ;; * ) # Default action Echo " (start | stop | restart) " ;; Esac Exit 0 Code:
pi@raspberrypi:~ $ sudo chmod +x /etc/init.d/jdownloader pi@raspberrypi:~ $ sudo systemctl daemon-reload pi@raspberrypi:/ $ sudo systemctl enable jdownloader Synchronizing state for jdownloader.service with sysvinit using update-rc.d... Executing /usr/sbin/update-rc.d jdownloader defaults Executing /usr/sbin/update-rc.d jdownloader enable Edit: Seems like the jdownloader service is running Code:
pi@raspberrypi:/ $ systemctl is-active jdownloader.service active Code:
pi@raspberrypi:/ $ ps aux | grep jdownloader pi 13362 0.0 0.3 4268 1652 pts/0 S+ 16:10 0:00 grep --color=auto jdownloader Last edited by nb0023; 19.03.2017 at 03:33. |
#2
|
||||
|
||||
the DIR and JAVA variable has the incorrect quotation marks?
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#3
|
|||
|
|||
I just checked and they are fine in the file but I replaced them anyways and still no luck :(
|
#4
|
||||
|
||||
are you able to start via cli outside of script ?
"/pathtojava" -Djava.awt.headless=true -jar "/pathtojd/JDownloader.jar"
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#5
|
|||
|
|||
Quote:
Code:
|---------------------------Headless Information------------------------------- | Restart Required | JDownloader Updated and restarted itself. | The process restarted itself and runs now in the background: 1964@raspberrypi | If you do not want JD to restart itself, use the -norestart switch. |------------------------------------------------------------------------------ |
#6
|
||||
|
||||
clearly shows in the log you already have instance running in the background.
Code:
[ org.jdownloader.update.launcher.SecondLevelLauncher(init) ] -> existing jD instance found! 1|org.jdownloader.update.launcher.SecondLevelLauncher.log 3/18/17 8:21:42 PM - INFO [ org.jdownloader.update.launcher.SecondLevelLauncher(init) ] -> Send parameters to existing jD instance and exit: [--focus]
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#7
|
|||
|
|||
Quote:
Last edited by nb0023; 19.03.2017 at 05:56. |
#8
|
|||
|
|||
Can anybody help? I changed my init file to this one but it still doesnt work. I can start it manually by entering the following command line argument but it will not start automatically after reboot
Code:
sudo "/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java" -Djava.awt.headless=true -jar JDownloader.jar Code:
#! /bin/sh ### BEGIN INIT INFO # Provides: jDownloader2 # Required-Start: networking # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: jDownloader2 Server Daemon # Description: jDownloader2 Server Daemon ### END INIT INFO DIR="/home/pi/jdownloader" PIDFILE="$DIR/JDownloader.pid" JAVA="/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java" PARAM="-Djava.awt.headless=true -jar $DIR/JDownloader.jar" start_daemon () { start-stop-daemon –start –background –oknodo –chuid pi –group pi –make-pidfile –pidfile $PIDFILE –exec $JAVA — $PARAM } stop_daemon () { start-stop-daemon –stop –pidfile $PIDFILE } #Switch case fuer den ersten Parameter case "$1" in start) #Aktion wenn start uebergeben wird echo "Starte jDownloader2" start_daemon ;; stop) #Aktion wenn stop uebergeben wird echo "Stoppe jDownloader2" stop_daemon ;; restart) #Aktion wenn restart uebergeben wird echo "Restarte jDownloader2" start_daemon stop_daemon ;; *) #Standard Aktion wenn start|stop|restart nicht passen echo "(start|stop|restart)" ;; esac exit 0 |
#9
|
||||
|
||||
remove the ' - ' between java and param?
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#10
|
|||
|
|||
Do you mean in this line?
Code:
Start-stop-daemon --start --background --oknodo --chuid $ USER --make-pidfile --pidfile $ PIDFILE --exec $ JAVA - $ PARAM Code:
Start-stop-daemon --start --background --oknodo --chuid $ USER --make-pidfile --pidfile $ PIDFILE --exec $ JAVA $ PARAM |
#11
|
||||
|
||||
yes, try it ;p
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#12
|
|||
|
|||
|
#13
|
|||
|
|||
OK.
First: no Space " " between "$" and parameter Wrong: $ DIR Correct $DIR Please correct it in all your files Second: no space in the first line and all is lowerletter Code:
#!/bin/bash Lets do some debugging: Edit your file "/etc/init.d/jdownloader". Your startline is: Code:
start-stop-daemon –start –background –oknodo –chuid pi –group pi –make-pidfile –pidfile $PIDFILE –exec $JAVA $PARAM When its correct, go to terminal-window/commandline an write HTML Code:
sudo /etc/init.d/jdownloader start No put an "echo" in front of that line, so it looks like: Code:
echo start-stop-daemon –start –background –oknodo –chuid pi –group pi –make-pidfile –pidfile $PIDFILE –exec $JAVA $PARAM go to terminal-window/commandline an write HTML Code:
sudo /etc/init.d/jdownloader start Code:
start-stop-daemon –start –background –oknodo –chuid pi –group pi –make-pidfile –pidfile /home/pi/jdownloader/JDownloader.pid –exec /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java -Djava.awt.headless=true -jar /home/pi/jdownloader/JDownloader.jar No: You use something other, please post the actuell file "/etc/init.d/jdownloader" again |
#14
|
|||
|
|||
I've forgotten the links.
Is there a link from /etc/init.d/jdownloader to the "startup"-directories? in /etc there are eight "rcx.d"-directories For startup on boot you need in Raspbian a link from your file to /etc/rc2.d: Code:
sudo ln -s /etc/init.d/jdownloader /etc/rc2.d/S99jdownloader And stopping jdownloader you need a link in rc6.d and rc0.d (I dont know exactly which one) Code:
sudo ln -s /etc/init.d/jdownloader /etc/rc0.d/K00jdownloader sudo ln -s /etc/init.d/jdownloader /etc/rc6.d/K00jdownloader The number after the "S" or "K" defines the sequence. I think it's good to start jdownloader when all other are startet. For that I use the "99". And the same reason for shutdown. Jdwonloader will be the first to stop. |
#15
|
|||
|
|||
Okay so I went through the file and made the syntax changes you said to make and I also noticed many other things and changed them (like changing Echo to echo and making all the function names in lower case Start_daemon to start_daemon etc)
Here is the updated file Code:
#!/bin/sh ### BEGIN INIT INFO # Provides: jDownloader2 # Required-Start: networking # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: jDownloader2 Server Daemon # Description: jDownloader2 Server Daemon ### END INIT INFO DIR="/home/pi/jdownloader" PIDFILE="$DIR/JDownloader.pid" JAVA="/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java" PARAM="-Djava.awt.headless=true -jar $DIR/JDownloader.jar" start_daemon () { echo start-stop-daemon –start –background –oknodo –chuid pi –group pi –make-pidfile –pidfile $PIDFILE –exec $JAVA $PARAM } stop_daemon () { start-stop-daemon --stop --pidfile $PIDFILE } # Switch case case "$1" in start) # On start echo "Start JDownloader" start_daemon ;; stop) # On stop echo "Stop JDownloader" stop_daemon ;; restart) # On restart echo "Restart JDownloader" start_daemon stop_daemon ;; * ) # Default action echo "(start | stop | restart)" ;; esac exit 0 Quote:
Code:
Start JDownloader start-stop-daemon: invalid option -- 'D' Try 'start-stop-daemon --help' for more information. Quote:
Code:
Start JDownloader start-stop-daemon –start –background –oknodo –chuid pi –group pi –make-pidfile –pidfile /home/pi/jdownloader/JDownloader.pid –exec /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java -Djava.awt.headless=true -jar /home/pi/jdownloader/JDownloader.jar |
#16
|
||||
|
||||
Your script contains errors again!
Quote:
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 20.03.2017 at 20:07. |
#17
|
||||
|
||||
Please set correct DIR=, USER= and JAVA= values
__________________
JD-Dev & Server-Admin |
#18
|
|||
|
|||
|
#19
|
||||
|
||||
You're welcome In case you've got further questions, don't hesitate to ask here or contact us via support@jdownloader.org
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|