(Tutorial) JDownloader in a Jail

lulu

Dabbler
Joined
Sep 26, 2018
Messages
21
I have an error with startup script

here what it shows when I'm trying to start it

JD when starting manually via java works normally
Code:
Error: -jar requires jar file specification

Usage: java [-options] class [args...]

		  (to execute a class)

   or  java [-options] -jar jarfile [args...]

		  (to execute a jar file)

where options include:

	-d32   use a 32-bit data model if available

	-d64   use a 64-bit data model if available

	-server   to select the "server" VM

				  The default VM is server,

				  because you are running on a server-class machine.



	-cp <class search path of directories and zip/jar files>

	-classpath <class search path of directories and zip/jar files>

				  A : separated list of directories, JAR archives,

				  and ZIP archives to search for class files.

	-D<name>=<value>

				  set a system property

	-verbose:[class|gc|jni]

				  enable verbose output

	-version	  print product version and exit

	-version:<value>

				  Warning: this feature is deprecated and will be removed

				  in a future release.

				  require the specified version to run

	-showversion  print product version and continue

	-jre-restrict-search | -no-jre-restrict-search

				  Warning: this feature is deprecated and will be removed

				  in a future release.

				  include/exclude user private JREs in the version search

	-? -help	  print this help message

	-X			print help on non-standard options

	-ea[:<packagename>...|:<classname>]

	-enableassertions[:<packagename>...|:<classname>]

				  enable assertions with specified granularity

	-da[:<packagename>...|:<classname>]

	-disableassertions[:<packagename>...|:<classname>]

				  disable assertions with specified granularity

	-esa | -enablesystemassertions

				  enable system assertions

	-dsa | -disablesystemassertions

				  disable system assertions

	-agentlib:<libname>[=<options>]

				  load native agent library <libname>, e.g. -agentlib:hprof

				  see also, -agentlib:jdwp=help and -agentlib:hprof=help

	-agentpath:<pathname>[=<options>]

				  load native agent library by full pathname

	-javaagent:<jarpath>[=<options>]

				  load Java programming language agent, see java.lang.instrument

	-splash:<imagepath>

				  show splash screen with specified image

See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.

eval: /usr/home/jduser/JDownloader.jar: Exec format error


I'm using this script from the post above
Code:
#!/bin/sh
###################################
# just a little bit advertisement :D
# JDownloader Startup Script by 'brumnas'
# modified by pseiko000
#
# --- placeholder ---
###################################
. /etc/rc.subr
#
name="spustit"
start_cmd="${name}_start"
stop_cmd=":"
#
spustit_start()
{
	   umask 000
	   /usr/local/bin/java -Djava.awt.headless=true -jar /usr/home/jduser/JDownloader.jar &
}
#
load_rc_config $name
run_rc_command "$1"
 

wifty

Cadet
Joined
Nov 16, 2018
Messages
9
Good evening,

Thank you very much for this tutorial.
I also have a problem with the execution of the script.

root@Jdownloader:/etc/rc.d # ./jdstart start
Error: Unable to access jarfile /home/download/JDownloader.jar
root@Jdownloader:/etc/rc.d #
 
Last edited:

flubri

Cadet
Joined
Nov 29, 2018
Messages
1
Error: Unable to access jarfile /home/download/JDownloader.jar

I had the same problem and managed to fix it by using the correct path to JDownloader.jar (mine is located in the jail root)

Code:
/usr/local/bin/java -Djava.awt.headless=true -jar /JDownloader.jar &
 

wifty

Cadet
Joined
Nov 16, 2018
Messages
9
Good evening, and thank you very much for the answer, I will try the code tonight and post the result afterwards.
I'm sorry for the translation, I'm using the reverso.
 

wifty

Cadet
Joined
Nov 16, 2018
Messages
9
For me:

Code:
/usr/local/bin/java -Djava.awt.headless=true -jar /root/JDownloader.jar


Everything is working well. A big thank you to all of you
 

vic1707

Dabbler
Joined
Jan 28, 2019
Messages
46
hello, thx for the tuto but when i try wget command for JDownloader.jar i get an error, so i did it by another way. my real problem is with the script when i try ./jdstart start i get a ./jdstart command not found... any idea?

EDIT : Fix by replacing the original script by the line in the precedent comment
 
Last edited:

natiss88

Cadet
Joined
Dec 7, 2016
Messages
2
just to add something that can be useful for someone: FFmpeg installation and activation for JD2:

0. setup JD2 as described earlier in this thread

1. in shell, type: "pkg install wget ffmpeg"
2. wait for the process to finish and whatever
3. type: "which ffmpeg" and write down the path (is something like /usr/local/bin/ffmpeg)
4. type: "which ffprobe" and write down the path (is something like /usr/local/bin/ffprobe)
5. use my.jdownloader.org web page (you should already know what is this, as you already completed step 0) and go to "settings"->"advanced settings" and search for "FFmpeg"
6. in the "FFmpegSetup: Binary Path Probe " insert the path of ffprobe you got in step 4. Click on the floppy/saving icon on the right
7. in the "FFmpegSetup: Binary Path" insert the path of ffmpeg you got in step 3. Click on the floppy/saving icon on the right

8. restart the jail + JD2

now JD2 should be able to download videos where FFmpeg is required (eg: YT).

enjoy.

P.S.: I can't download at ful bandwith. i don't know if my NAS cpu (C2550) + jail combo is too weak or what, but it works. If you have suggestions, you're welcome.
 

wifty

Cadet
Joined
Nov 16, 2018
Messages
9
P.S.: I can't download at ful bandwith. i don't know if my NAS cpu (C2550) + jail combo is too weak or what, but it works. If you have suggestions, you're welcome.

Good morning to you,

My JD downloads to the maximum bandwidth available. In configuration I have a CPU i3-4160 3.60GHz (4 cores) + 8GB RAM. The prison is installed on an SSD and I have PlexMediaServer that runs on the same SSD
 

natiss88

Cadet
Joined
Dec 7, 2016
Messages
2
Good morning to you,

My JD downloads to the maximum bandwidth available. In configuration I have a CPU i3-4160 3.60GHz (4 cores) + 8GB RAM. The prison is installed on an SSD and I have PlexMediaServer that runs on the same SSD

Normally, JD2 download at full bandwith with lots of hosting sites; the "issue" is with YT videos (but not always, I tried again with better speed).
I don't know if problem is
- the ffmpeg encoding that requires "lot" of CPU power;
- the ffmpeg in the jail not 100% perfect;
- something between JD2 and YT.
 

phlyer

Cadet
Joined
Jun 22, 2019
Messages
3
Hi everbody,

it could use your help. I installed jDownloader and everything is working but i still have problems with the startup script. I adjusted the path to the one in my case and executing the part
/usr/local/bin/java -Djava.awt.headless=true -jar /jdownloader/JDownloader.jar & directly starts jdownloader.
But trying to execute the startup script with ./jdstart start i get a permission error:

/jdstart start
Error: -jar requires jar file specification
...
eval: /jdownloader/JDownloader.jar: Permission denied


Any ideas how to fix it?

Thank you very much!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,464
Thanks for the writeup here. So I've installed this in a jail, and I'm using @mikalex's flavor of the rc script. It runs, I can see it in the my.jdownloader.org web interface (really is a pity it doesn't have its own local web UI), and I've even been able to download a few things. However, the web interface seems really slow, and really flaky. "Slow" as in the "downloads" page often takes 30+ seconds to load. "Flaky" as in it will randomly kick my out of my installation--I'll go from a page that looks like this:
1562146475351.png

to one that looks like this:
1562146849461.png

sometimes while I'm in the middle of doing something. Is this normal or expected behavior? Or is there someplace I can/should look to see what's going on?
 
Joined
Sep 13, 2014
Messages
149
I've had the same experience @danb35 and would also like to know whether it's just par for the course. I never had any issues with the desktop client but the Web GUI is flaky and slow.

I made the mistake of adding a whole big long list of videos to download and I added them all to a package as they were all part of the same genre and then the Web GUI flakes out and I lose all my work. I just wish it had the same server client architecture as Deluge so I could use the desktop client to access my Jail.
 

ekinox

Cadet
Joined
Apr 24, 2020
Messages
5
Hello thanks for all that work, but i'm trying to save files, that jdownloader in the jail download, to the dataset i'm share with smb
i don't know if that was understandable
 
Joined
Sep 13, 2014
Messages
149
Hello thanks for all that work, but i'm trying to save files, that jdownloader in the jail download, to the dataset i'm share with smb
i don't know if that was understandable

You shouldn't be using SMB to share the dataset with the Jail. You should be mounting the dataset within the Jail.

What exactly are you having trouble with?
 

ekinox

Cadet
Joined
Apr 24, 2020
Messages
5
You shouldn't be using SMB to share the dataset with the Jail. You should be mounting the dataset within the Jail.

What exactly are you having trouble with?
thanks CompuGlobalHyperMegaNet, i've found it after, i want to test another downloader because myjdowloader is so slow for and need many times refresh page, did you know other ?
i've try to install pyload but no success :/
 
Joined
Sep 13, 2014
Messages
149
thanks CompuGlobalHyperMegaNet, i've found it after, i want to test another downloader because myjdowloader is so slow for and need many times refresh page, did you know other ?
i've try to install pyload but no success :/

I can't recommend anything else as JDownloader2 works well enough for my needs.

JDownloader2 isn't the best in terms of UI speed and stability but performance can be improved. It made a world of difference for me when I routed the Jail via a VPN (I must have had a brain fart at some point, as I hadn't routed the Jail via VPN for a good few months after I created the Jail). It's still not fantastic but it's significantly cut the number of times I have to refresh the page, and it's almost completely stopped the need to refresh and then log back in. It's gone from being a chore to use to actually being usable.
 

ekinox

Cadet
Joined
Apr 24, 2020
Messages
5
I can't recommend anything else as JDownloader2 works well enough for my needs.

JDownloader2 isn't the best in terms of UI speed and stability but performance can be improved. It made a world of difference for me when I routed the Jail via a VPN (I must have had a brain fart at some point, as I hadn't routed the Jail via VPN for a good few months after I created the Jail). It's still not fantastic but it's significantly cut the number of times I have to refresh the page, and it's almost completely stopped the need to refresh and then log back in. It's gone from being a chore to use to actually being usable.

hm ok thanks, if the vpn improve jdownloader can you explain me how you do it ? :)
 
Joined
Sep 13, 2014
Messages
149
hm ok thanks, if the vpn improve jdownloader can you explain me how you do it ?

First of all I want to make it clear that I am not saying a VPN will improve performance but rather that it might improve performance. I also mentioned it as it's best practice to route all internet facing Jails via a VPN anyway.

As for explaining how to do it... that's a very broad question as it depends on a whole host of factors.

You'd be better off going to the website of your / a VPN provider and looking at their tutorials for your given setup / router / firewall OS. Purely as an example, here's a link to NordVPN's tutorial section but please bare in mind that I'm not recommending NordVPN or any other specific provider, it's simply that when I searched for "VPN tutorial", Nord was the first result - https://nordvpn.com/tutorials/

Another thing I should make clear is that the improved performance I saw when I routed JDownloader2 via a VPN might be down to my network setup. I use a firewall OS called pfSense, which I’ve configured to have pretty strict security settings. A lot of internet traffic that would otherwise was through a consumer grade router, is blocked or redirected by my firewall. It’s possible that one of these settings / blocklists might have been causing connection issues for JDownloader2’s web GUI. The way I have my VPN setup would bypass most of these settings / blocklists.

Either way though, using a VPN for your Jails is still best practice.

If you'd like any further assistance with routing your JDownloader2, or any other Jail via a VPN, then I'm happy to help where I can.
 

d_allan

Cadet
Joined
May 9, 2020
Messages
3
Hello all,

Quite new on this universe and very grateful to found some good tutorials and help on this forum.
I have followed this tutorial, all was working perfectly until the first download.

Sync between MyJD and JD instance is effective but when launching a download it stop after some seconds... In the jail it shows up like that :

Error Log.PNG


I'm probably doing something wrong (or that i don't understand). Maybe something about rights/permissions ?

Thank you in advance for your help
 

einsargen

Cadet
Joined
Apr 30, 2020
Messages
5
Hello, following the steps I can make it work, I can access the web and download files, extract and delete the tablets, enter the scrip, it runs but it does not connect anymore ... I left it for 10 minutes but nothing.

the text that appears at the end of the script comes out " shutdown hooks finished"
 
Top