JDownloader2 on NSA326

Marvell Kirkwood based
biox78
Posts: 7
Joined: Thu Sep 01, 2016 7:28 pm

JDownloader2 on NSA326

Post by biox78 » Thu Sep 01, 2016 9:04 pm

Hi,
nevertheless NSA326 is my first NAS, reading guides on this forum, I've been able to install FFP, JAVA and PLEX doing the best with this machine.
This is JAVA version installed:
[admin@NAS326:/mnt/HD_a2/jd$ java -version
java version "1.8.0_91"
Java(TM) SE Embedded Runtime Environment (build 1.8.0_91-b14, headless)
Java HotSpot(TM) Embedded Client VM (build 25.91-b14, mixed mode)]

In the last days, I'm trying to install JDownloader2 (jd2), but I'm having a lot of troubles.
These are the steps I've followed:
- mkdir jd (as root - a new folder for jd2 created at /mnt/HD_a2/jd)
- cd /mnt/HD_a2/jd (as root)
- wget http://installer.jdownloader.org/JDownloader.jar (as root)
- java -jar JDownloader.jar -norestart (as admin cause java doesn't function as root)


At this point I see this log with a lot of errors that stops every time, without asking me JD user and password.
Could you help me?
Thx.

Biox78
Last edited by biox78 on Sun Sep 04, 2016 6:54 pm, edited 1 time in total.

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: JDownloader2 on NSA326

Post by Mijzelf » Fri Sep 02, 2016 7:43 am

biox78 wrote:Hi,
- mkdir jd (as root - a new folder for jd2 created at /mnt/HD_a2/jd)
<snip>
- java -jar JDownloader.jar -norestart (as admin cause java doesn't function as root)
<snip>

Code: Select all

<snip>
org.appwork.exceptions.WTFException: org.appwork.storage.StorageException: Can not write to /i-data/021aa796/jd/cfg/ProxySelector.proxies.json.tmp
I guess JDownloader running as admin doesn't have the rights to write in /mnt/HD_a2/js.
So change the access bits (as root):

Code: Select all

chmod a+w /mnt/HD_a2/js

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: JDownloader2 on NSA326

Post by MrDini » Fri Sep 02, 2016 3:17 pm

Ahoj biox,

I also used the JDownloader on my nas too (yes, I changed it to an other dl program, because the Java programs usualy eats a lot of RAM). And I could use it with root.

I had the latest java version, installed with barmalej2's nice oraclejava script (you Can look for the installation HOWTO at this forum, but I think the automatic install not works at the moment, So You have to download it manualy).

A mini HOWTO, how Do I installed it. :mrgreen::

Firstly, we need to create a folder, where the jd2 and it's files will be stored:

Code: Select all

mkdir -p /i-data/md0/programs/jd2/; cd /i-data/md0/programs/jd2/
After it, we have to download the jd2 jar file and 've to start it with theese commands:

Code: Select all

wget http://installer.jdownloader.org/JDownloader.jar
java -Djava.awt.headless=true -jar JDownloader.jar
When You execute the last command, please be patient, drink a tea, or go out with Your dog, because it will take a lot of time (for me, I think, that was ~8 min). And if it not ask You for credientals and looks like, nothing happens, simply exit by pressing Ctrl+C and reboot the nas with the reboot command! I don't know what was that bug, but it caused a big headache for me... :roll: And after a reboot, just execute the last command (which launchs the JD2) once again and type Your account crediantals.

And when it started successfuly (You Can see that at the output), simply press the Ctrl+C and You're almost finished!

But if You want to start it daemonized every boot, You have to download a start script and place it under /ffp/start/ folder. This command will Do that for You:

Code: Select all

wget -O /ffp/start/jd2.sh http://users.atw.hu/mrdini/secret/jd2.sh
Image

And finally, don't forget to add an execute permission to the start script:

Code: Select all

chmod a+x /ffp/start/jd2.sh
One more thing! You Can start it manually by typing this:

Code: Select all

/ffp/start/jd2.sh start
And that's all, You finished! ;)

Ps: Sorry for my bad English, and for the lot of "in-brackets" comment.

Ps2: Please use pastebin for long output, because when I scroll down for the further posts, my hair turn gray... ;) Many thanks!
Last edited by MrDini on Sat Dec 02, 2017 7:40 pm, edited 3 times in total.
Thanks nas-central the lot of help! :)

biox78
Posts: 7
Joined: Thu Sep 01, 2016 7:28 pm

Re: JDownloader2 on NSA326

Post by biox78 » Sun Sep 04, 2016 7:22 pm

Hi guys,
first of all thanks to Mijzelf and MrDini for the help! In these two days I've made a lot of tries to make jd2 go, but I haven't yet reached my goal.
So using MrDini's guide, I started again with java and jd2, putting them into the folder /opt. (For other purpose I've installed entware-ng from nas console).
So fixing permission, I've checked java, even as admin and as root, giving this message:
root@NAS326:/# java -version
java version "1.8.0_73"
Java(TM) SE Embedded Runtime Environment (build 1.8.0_73-b02, headless)
Java HotSpot(TM) Embedded Client VM (build 25.73-b02, mixed mode)

Then I downloaded jd2, and used this line of command to start it:

java -Djava.awt.headless=true -jar JDownloader.jar

Every time I've done this, I could see this message:

|---------------------------Headless Information-------------------------------
| Restart Required
| JDownloader Updated and restarted itself.
| The process restarted itself and runs now in the background: 20200@localhost.localdomain
| If you do not want JD to restart itself, use the -norestart switch.
|------------------------------------------------------------------------------

So I tried to start it with -norestart flag:

|---------------------------Headless Information-------------------------------
| Restart Required
| JDownloader Updated Itself and will exit now.
| Please restart JDownloader after a few seconds.
| Make sure that there is no running JDownloader process before restarting.
|------------------------------------------------------------------------------

I noticed that without restart flag, jd for at leat 2 hours stays in background, downloading updates and creating files into /jdownloader folder:

root@NAS326:/opt/jdownloader# dir -l
total 3244
-rw-r--r-- 1 root root 0 Sep 4 21:21 JD2.lock
-rw-r--r-- 1 root root 4 Sep 4 21:21 JD2.port
-rw-r--r-- 1 root root 3074542 Sep 4 21:21 JDownloader.jar
-rw-r--r-- 1 root root 6 Sep 4 21:21 JDownloader.pid
drwxr-xr-x 2 admin everyone 4096 Sep 4 21:21 cfg
drwxr-xr-x 2870 admin everyone 221184 Sep 4 21:21 logs
drwxr-xr-x 3 root root 4096 Sep 4 21:21 tmp
drwxr-xr-x 2 root root 4096 Sep 4 21:21 update

I've even tried deleting /tmp and /update folder, but jd restarts with the java command to update again, downloading another update.
I've repeated this sequence for the last two days, but unsuccessfully. Here is the last log.
So, if you have any suggestions or if you can suggest me another dl program for hosting files, I'd be very grateful.

P.S. @MrDini: To maintain your hair black, I've edited with pastebin my previous message! Sorry ;)

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: JDownloader2 on NSA326

Post by MrDini » Sun Sep 04, 2016 7:33 pm

@MrDini: To maintain your hair black, I've edited with pastebin my previous message!
Thanks a lot! :)

Regarding Your problem. As I said at the mini tutorial, and as the error message says, You have to reboot the nas itself. I offer to do that via this command:

Code: Select all

reboot
And execute my command without norestart once again.

PS: if You place the JD2 under /opt folder, don't forget to change the path at the start/stop script!

BTW: if You have entware-ng, You Can place the jd2.sh start script under /opt/etc/init.d/ too.

I am using pyload. The JD is more clever than pyload, but the pyload uses a bit smaller ram, and for my requirement this program also nice! :)
Thanks nas-central the lot of help! :)

biox78
Posts: 7
Joined: Thu Sep 01, 2016 7:28 pm

Re: JDownloader2 on NSA326

Post by biox78 » Sun Sep 04, 2016 10:58 pm

Hi MrDini,
just done what you have suggested, but after 5 times I used the command "java -Djava.awt.headless=true -jar JDownloader.jar" and rebooted my nas with "reboot", I go on seeing this message:


|---------------------------Headless Information-------------------------------
| Restart Required
| JDownloader Updated and restarted itself.
| The process restarted itself and runs now in the background: 12045@localhost.localdomain
| If you do not want JD to restart itself, use the -norestart switch.
|------------------------------------------------------------------------------

I guess something is wrong. Here is my last log.
Thanks for all your help.
Biox78

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: JDownloader2 on NSA326

Post by MrDini » Mon Sep 05, 2016 4:41 am

Hmm, try to kill the java and start it again...
Thanks nas-central the lot of help! :)

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: JDownloader2 on NSA326

Post by barmalej2 » Mon Sep 05, 2016 5:37 am

biox78 wrote:I guess something is wrong. Here is my last log.
Thanks for all your help.
Biox78
What makes you think, that it is wrong?
That is typical JDownloader2 behaviour on first run. It self-updates and restart proccess in background.
If you do not want JD to restart itself, use the -norestart switch. Otherwise, if it is already running in background, kill proccess manually as Mr. Dini told you or restart NAS.

biox78
Posts: 7
Joined: Thu Sep 01, 2016 7:28 pm

Re: JDownloader2 on NSA326

Post by biox78 » Mon Sep 05, 2016 5:46 am

I guess it because in the log there are some Exceptions. I've rebooted the nas a lot of times, and it continues to tell 'restart required' :cry:

Thanks!

Biox78

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: JDownloader2 on NSA326

Post by barmalej2 » Mon Sep 05, 2016 9:12 am

In that case might be something wrong with your java installation. I suspect, it saves some of JD2 settings in ramdisk, which gets wipeout on each reboot, instead of saving them in JD2 installation directory.
Just tried myself to run:

Code: Select all

java -Djava.awt.headless=true -jar JDownloader.jar -norestart
After selfupdate I have got:
|---------------------------Headless Information-------------------------------
| Restart Required
| JDownloader Updated Itself and will exit now.
| Please restart JDownloader after a few seconds.
| Make sure that there is no running JDownloader process before restarting.
|------------------------------------------------------------------------------
JD2 proccess updated itself and exited.

On the second run:

Code: Select all

java -Djava.awt.headless=true -jar JDownloader.jar -norestart
I have got:
|---------------------------Headless Information-------------------------------
| MyJDownloader Setup
| Your 'My JDownloader' logins are not correct.
| Please check username/email and password!
| Enter y -> Enter Logins
| Enter n -> Exit JDownloader

biox78
Posts: 7
Joined: Thu Sep 01, 2016 7:28 pm

Re: JDownloader2 on NSA326

Post by biox78 » Mon Sep 05, 2016 9:27 am

Hi barmalej2,
Before you run the -norestart command, have you rebooted your nas?
I noticed that after the first time I start jd2 without norestart, the process runs in background creating folders and files. So I ask if I've to reboot after the message my nas or I've to waiting until jd2 closes its processes. Thanks.

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: JDownloader2 on NSA326

Post by barmalej2 » Mon Sep 05, 2016 9:48 am

If you mean on the second time run, then I didn't reboot. Without -norestart JD2 first updates itself and then will restart in background process, so you will not be able to enter your login credentials.
Just tried to reboot and then run again:

Code: Select all

java -Djava.awt.headless=true -jar JDownloader.jar -norestart
The same window asking about to enter logins appeared.

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: JDownloader2 on NSA326

Post by MrDini » Mon Sep 05, 2016 2:00 pm

Yes, the norestart function is a new thing, when I installed the JD the only way to login was a reboot.

The JD2 needs minimum java 8.
Thanks nas-central the lot of help! :)

biox78
Posts: 7
Joined: Thu Sep 01, 2016 7:28 pm

Re: JDownloader2 on NSA326

Post by biox78 » Sat Sep 10, 2016 7:38 pm

Hi guys, finally JD2 is functioning!!! :P :P :P
After a lot of tries, I decided to restart the whole process from the beginning, uninstalling java and jd2.
So, this time, I tried to use barmalej2's guide viewtopic.php?f=249&t=18267 to install java for v5 nas, and, doing this, I made a great discovery: NAS326 has a v7 CPU, not a V5!
Until this moment, I've used the wrong version for my NAS, and this caused all the exceptions in jd2's log.

1. I downloaded ejdk-8u101-linux-armv6-vfp-hflt.tar.gz from oracle page into /mnt/HD_a2/admin and followed this guide to install java -> https://nas-tweaks.net/419/installation ... -fun_plug/

Code: Select all

mkdir -p /ffp/opt/java
cd /ffp/opt/java
tar xvzf /mnt/HD_a2/admin/ejdk-8u101-linux-armv6-vfp-hflt.tar.gz
ln -s ejdk1.8.0_101 jre
echo "export PATH=/ffp/opt/java/jre/linux_armv6_vfp_hflt/jre/bin:\$PATH" >> /ffp/etc/profile.d/java.sh
chmod a+x /ffp/etc/profile.d/java.sh
chown -R root:root /ffp/opt/java
Then I rebooted NAS. After reboot, I checked if java was ok:

Code: Select all

root@NAS326:/# java -version
java version "1.8.0_101"
Java(TM) SE Embedded Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) Embedded Client VM (build 25.101-b13, mixed mode)

2. To install jd2, this time I followed MrDini's guide, making jd2's folder into /i-data/021aa796/ instead of /mnt/HD_a2:

Code: Select all

mkdir -p /i-data/021aa796/jd2/
cd /i-data/021aa796/jd2/
wget http://installer.jdownloader.org/JDownloader.jar
java -Djava.awt.headless=true -jar JDownloader.jar -norestart
After jd2's selfupdate, I have:

Code: Select all

|---------------------------Headless Information-------------------------------
| Restart Required
| JDownloader Updated Itself and will exit now.
| Please restart JDownloader after a few seconds.
| Make sure that there is no running JDownloader process before restarting.
|------------------------------------------------------------------------------
This time I checked is jd2's process was still in background, before restarting NAS:

Code: Select all

root@NAS326:/# ps ef | grep JDownloader.jar | grep -v grep
root@NAS326:/# reboot
So, I used another time the following command, and this time jd2 asked me my credentials :o :

Code: Select all

java -Djava.awt.headless=true -jar JDownloader.jar -norestart

Code: Select all

|---------------------------Headless Information-------------------------------
| MyJDownloader Setup
| Your 'My JDownloader' logins are not correct.
| Please check username/email and password!
| Enter y -> Enter Logins
| Enter n -> Exit JDownloader
3. To daemonize jd2 every boot, I followed even this time MrDini's guide. Having some troubles with SSL with wget installed, and not founding the right one on slacker, I used entware for this:

Code: Select all

root@NAS326:/# /opt/bin/opkg install wget - 1.18-1
Done this, I typed:

Code: Select all

root@NAS326:/# /opt/bin/opkg/wget -O /ffp/start/jd2.sh https://gist.githubusercontent.com/mrcktz/d128f9e237c1894bbe46/raw/ef7112c7f36bb3ce68e3fb1fa19abccb4677fed9/jd2.sh
root@NAS326:/# nano -w /ffp/start/jd2.sh
I changed in this way the file:

COMMAND="/ffp/opt/java/bin/java -- -jar /mnt/HD_a2/programs/jd2/JDownloader.jar"

to:

COMMAND="/ffp/opt/java/jre/linux_armv6_vfp_hflt/jre/bin/java -- -jar /i-data/021aa796/jd2/JDownloader.jar"

Then I gave it permissions and started it:

Code: Select all

chmod a+x /ffp/start/jd2.sh
/ffp/start/jd2.sh start
4. After all, I downloaded jd2 app on my phone, changing download folder and checking my download's list and it's all working!!!

Thanks guys for all your help, I learned a lot of new things, making mistakes and trying day by day new ways to make things work. THANKS!!!

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: JDownloader2 on NSA326

Post by MrDini » Sun Sep 11, 2016 11:33 am

Good job! :)

Regarding the wget's SSL problem, wrote about it at the tutorial. At the br2 repo (uwsiteloader Can add this repo to the slacker list), You Can find a great wget package. But Your workaround with entware-ng also a good idea! :)
Thanks nas-central the lot of help! :)

Post Reply