General NAS-Central Forums

Welcome to the NAS community
It is currently Tue Aug 22, 2017 11:07 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: JDownloader2 on NSA326
PostPosted: Thu Sep 01, 2016 9:04 pm 
Offline

Joined: Thu Sep 01, 2016 7:28 pm
Posts: 6
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.

Top
 Profile  
 
PostPosted: Fri Sep 02, 2016 7:43 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6022
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:
<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:
chmod a+w /mnt/HD_a2/js


Top
 Profile  
 
PostPosted: Fri Sep 02, 2016 3:17 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
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:
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:
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:
wget -O /ffp/start/jd2.sh https://gist.githubusercontent.com/mrcktz/d128f9e237c1894bbe46/raw/ef7112c7f36bb3ce68e3fb1fa19abccb4677fed9/jd2.sh


Image
Possible issue: This script is on a HTTPS page, and the old wget binaries Can't handle the SSL connection correctly, So if the wget says cert errors, You have to upgrade it. I recommend to use br2's wget package (if uwsiteloader added br2 repo to the slacker, You Can install it):

Code:
slacker -UuiA br2:wget

Image

Okay, when the start script grabbed successfuly, edit with Your favourite editor (I prefer mcedit, but the nano, vi, or (if U are Win user) WinSCP is also good for this operation) and change this part:

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

to:

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

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

Code:
chmod a+x /ffp/start/jd2.sh


One more thing! You Can start it manualy by typing this:

Code:
/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!

_________________
Thanks nas-central the lot of help! :)


Last edited by MrDini on Sun Sep 04, 2016 7:40 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sun Sep 04, 2016 7:22 pm 
Offline

Joined: Thu Sep 01, 2016 7:28 pm
Posts: 6
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 ;)


Top
 Profile  
 
PostPosted: Sun Sep 04, 2016 7:33 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Quote:
@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:
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! :)


Top
 Profile  
 
PostPosted: Sun Sep 04, 2016 10:58 pm 
Offline

Joined: Thu Sep 01, 2016 7:28 pm
Posts: 6
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


Top
 Profile  
 
PostPosted: Mon Sep 05, 2016 4:41 am 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
Hmm, try to kill the java and start it again...

_________________
Thanks nas-central the lot of help! :)


Top
 Profile  
 
PostPosted: Mon Sep 05, 2016 5:37 am 
Online

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2290
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.


Top
 Profile  
 
PostPosted: Mon Sep 05, 2016 5:46 am 
Offline

Joined: Thu Sep 01, 2016 7:28 pm
Posts: 6
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


Top
 Profile  
 
PostPosted: Mon Sep 05, 2016 9:12 am 
Online

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2290
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:
java -Djava.awt.headless=true -jar JDownloader.jar -norestart

After selfupdate I have got:
Quote:
|---------------------------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:
java -Djava.awt.headless=true -jar JDownloader.jar -norestart

I have got:
Quote:
|---------------------------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


Top
 Profile  
 
PostPosted: Mon Sep 05, 2016 9:27 am 
Offline

Joined: Thu Sep 01, 2016 7:28 pm
Posts: 6
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.


Top
 Profile  
 
PostPosted: Mon Sep 05, 2016 9:48 am 
Online

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2290
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:
java -Djava.awt.headless=true -jar JDownloader.jar -norestart

The same window asking about to enter logins appeared.


Top
 Profile  
 
PostPosted: Mon Sep 05, 2016 2:00 pm 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
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! :)


Top
 Profile  
 
PostPosted: Sat Sep 10, 2016 7:38 pm 
Offline

Joined: Thu Sep 01, 2016 7:28 pm
Posts: 6
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 http://forum.nas-central.org/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:
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:
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:
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:
|---------------------------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:
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:
java -Djava.awt.headless=true -jar JDownloader.jar -norestart

Code:
|---------------------------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:
root@NAS326:/# /opt/bin/opkg install wget - 1.18-1


Done this, I typed:

Code:
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:
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!!!


Top
 Profile  
 
PostPosted: Sun Sep 11, 2016 11:33 am 
Offline
User avatar

Joined: Mon Dec 21, 2015 7:21 pm
Posts: 597
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! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: barmalej2, Bing [Bot], dexhain, Google [Bot] and 69 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group