JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #161  
Old 04.03.2015, 10:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

1.) you can connect via putty and manually start it and then close putty
2.) I would delay the script. Maybe the drive is not mounted when the command should run?
I would also redirect console out to logfile to see why it does not run
__________________
JD-Dev & Server-Admin
Reply With Quote
  #162  
Old 04.03.2015, 10:25
zoddel zoddel is offline
Super Loader
 
Join Date: Mar 2015
Posts: 25
Default

Danke Jiaz für die schnelle Antwort.
Kannst du mir sagen was ich am Script ändern muss?
Bzw was für Zeilen ich anpassen / hinzufügen muss?
Wenn ich alles lauffähig habe werde ich das fertige Script hier mal posten.
Haben ja noch ein paar Andere das Problem mit dem automatischen Starten auf der NAS.

Linux ist für mich noch eine neue Welt =) taste mich gerade ran.

Aktuell schaut das Script wie folgt aus:
Code:
#!/bin/sh): 
# 
# Startup script for jdownloader2 
# 
# Stop myself if running 
PIDFILE=/var/run/S99jdownloader.pid 
# 
start() { 
sleep 1 
nohup /volume1/@appstore/JavaManager/Java/bin/java -Djava.awt.headless=true -jar /volume1/@appstore/jdownloader/JDownloader.jar & 
# write pidfile 
echo $! > $PIDFILE 
} 
# 
stop() { 
[ -f ${PIDFILE} ] && kill `cat ${PIDFILE}` 
# remove pidfile 
rm -f $PIDFILE  
} 
# 
case "$1" in 
start) 
start 
;; 
stop) 
stop 
;; 
restart) 
stop 
sleep 1 
start 
;; 
*) 
echo "Usage: $0 (start|stop|restart)" 
exit 1 
;; 
esac 
# End
Reply With Quote
  #163  
Old 04.03.2015, 10:51
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

1.) längere sleeps (1 sekunde ist arg wenig für nen shutdown)
2.) würde beim stop ne schleife bauen, bis prozess weg ist/file weg ist. aber max x sekunden
3.) PIDFILE wird von JDownloader angelegt. im Ordner von JDownloader mit Namen JDownloader.pid (da JDownloader zb für ein Update sich selbst neustarten muss, wird dein PIDFILE nicht mehr gültig sein
__________________
JD-Dev & Server-Admin
Reply With Quote
  #164  
Old 04.03.2015, 13:38
zoddel zoddel is offline
Super Loader
 
Join Date: Mar 2015
Posts: 25
Default

Oh man,
dann werde ich heute Abend mal "Jugend Forscht" betreiben.
Hab noch absolut keine Ahnung wie ich das im Script umsetze.
War froh hier eins zu finden was angeblich funktioniert =)
Vll findet sich auch wer hier der dabei helfen kann.
Hier hat sich von den ersten Scripts mit selbst gemerkter PID bis jetzt wo der JDownloader das selbst managed ja einiges getan.
Dann bekommt man mal ein allgemein gültiges Script für die NAS auf die Beine was die nächsten dann einfach so übernehmen können.
Oder hat vll wer ein funktionstüchtiges Script bereits erstellt und könnte dies posten?

EDIT:
1. Habe mal den PIDFILE ausgetauscht, sodass dieser nun auf den JDownloader-Eigenen zeigt.
2. Den Sleep vom Start auf 30 Sekunden gesetzt, damit die NAS Zeit hat alles zu Mounten. (Ist das beim Start der richtige Ort dafür?)
3. Den Sleep beim Restart von 1 Sekunde auf 10 erhöht. (Wie ich das mit einer Schleife sauber löse weis ich nicht, aber denke dass 10 Sekunden ausreichen sollten, kommen ja noch die vom Start dazu)

Code:
#!/bin/sh): 
# 
# Startup script for jdownloader2 
# 
# Stop myself if running 
# 
start() { 
sleep 30 
nohup /volume1/@appstore/JavaManager/Java/bin/java -Djava.awt.headless=true -jar /volume1/@appstore/jdownloader/JDownloader.jar & 
} 
# 
stop() { 
PIDFILE=/volume1/@appstore/jdownloader/JDownloader.pid
[ -f ${PIDFILE} ] && kill `cat ${PIDFILE}`  
} 
# 
case "$1" in 
start) 
start 
;; 
stop) 
stop 
;; 
restart) 
stop 
sleep 10
start 
;; 
*) 
echo "Usage: $0 (start|stop|restart)" 
exit 1 
;; 
esac 
# End
Habe ich alles richtig gemacht und gibt es sonst noch Verbesserungsvorschläge ?

Last edited by zoddel; 04.03.2015 at 14:49.
Reply With Quote
  #165  
Old 04.03.2015, 18:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

Container Upload issue found/fixed. Update/restart your JDownloader
__________________
JD-Dev & Server-Admin
Reply With Quote
  #166  
Old 04.03.2015, 18:40
Spawny
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
Container Upload issue found/fixed. Update/restart your JDownloader
Thx, works =)
Linkadding aka Captchapopupfix kommt auch noch?
Reply With Quote
  #167  
Old 04.03.2015, 18:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

script sieht shcon besser aus
__________________
JD-Dev & Server-Admin
Reply With Quote
  #168  
Old 04.03.2015, 18:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

ja, captcha bug wird auch noch fixed
@zoddel: ich würde noch den user wechseln
jd sollte nicht als root laufen
__________________
JD-Dev & Server-Admin
Reply With Quote
  #169  
Old 05.03.2015, 07:30
antekgla antekgla is offline
Vacuum Cleaner
 
Join Date: Nov 2013
Posts: 18
Default

Hi, I have JDownloader 2 installed in my QNAP TS-210, and work great!
I have a question about Click'Load links.

Click'Load links open a tab in my browser pointing to:

Code:
**External links are only visible to Support Staff**
if Jdownloader was running locally the links would be capture, but running from my NAS in another IP nothing happens.

I try to catch the links in my local JDownloader but the links are protected and when I chosse copy url, only **External links are only visible to Support Staff**... appears.

Any thougts?
Reply With Quote
  #170  
Old 05.03.2015, 08:34
zoddel zoddel is offline
Super Loader
 
Join Date: Mar 2015
Posts: 25
Default

@Jiaz
Danke für die Tips, habe es jetzt erstmal laufen.
2 Fragen noch.
1. Wie setze ich im Script den User damit ich nicht als root laufe ?
2. Kann ich die folgenden Zeilen so ändern, damit der einfache sh aufruf nicht mehr start/stop/restart verlangt, sondern defaultmäßig schaut ob er läuft dann beendet, oder wenn er aus ist startet? Glaube für die Anpassung bräucht ich noch Hilfe. Denke auch das ist der Grund warum JDownloader beim Start der NAS nicht automatisch mit angeht, sondern ich ihn übern Putty selbst noch starten muss.

Code:
echo "Usage: $0 (start|stop|restart)" 
exit 1
Reply With Quote
  #171  
Old 05.03.2015, 10:26
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@antekla, install chrome/firefox extension which uses MyJDownloader to forward CNL to your JDownloader. Else you would need to setup port forwading from your IP:9666 to your JDownloader. But Extension is much easier to use

@zoddel:
das script alleins reicht nicht, sondern du musst noch im system einrichten in welchem runlevel welches script gestartet werden muss. das system startet das script ansonsten erst gar nicht.
bzgl User: hängt sehr vom system/umgebung ab, aber denke google hilft da besser. aber schau erstmal das es überhaupt zum laufen bekommst
__________________
JD-Dev & Server-Admin
Reply With Quote
  #172  
Old 05.03.2015, 16:58
zoddel zoddel is offline
Super Loader
 
Join Date: Mar 2015
Posts: 25
Default

Übern Putty auf die NAS und "sh ./S99jdownloader.sh start" bekomme ich den JDownloader ja jetzt zum laufen. Läuft dann brav im Hintergrund und schließen vom Putty stop auch nix mehr =)

Das mit dem runlevel verstehe ich nicht. Glaubst du, dass das Script den JD nicht startet liegt nicht daran, dass es nur in dem Ordner "/usr/local/etc/rc.d/" liegt und nicht mit der Übergabe "start" aufgerufen wird, sondern zu welchem Zeitpunkt meine NAS meint das Script aufrufen zu müssen? (Ruft die NAS die Script automatisch mit "start" auf, weil ohne scheint das Script ja nur zu melden, dass es eine Übergabe erwartet)
Macht es vll mehr Sinn, dann Script einfach in den Ordner vom JD zu verschieben und im "/usr/local/etc/rc.d/" eins hinzulegen, welches es dann mit "sh /volume1/@appstore/jdownloader/S99jdownloader.sh start" aufruft?

Als User kann ich doch bestimmt einen auf der NAS extra für den JDownloader anlegen und diesen dann darüber laufen lassen. Muss nur mal schauen wie ich dann das Script über den User automatisch starte, da wüsst ich zzt überhaupt nicht wie (Script soll ja automatisch vom System gestartet werden)

Last edited by zoddel; 05.03.2015 at 17:01.
Reply With Quote
  #173  
Old 05.03.2015, 17:08
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

Das einfachste, mal ein neues Script in rc.d das dein startScript mit start aufruft
Nutzer anlegen, den JD Ordner auf Nutzer umändern (chown -R nutzer:nutzergruppe JDownloaderOrdner)
im script dann zb
su -c "befehlt" nutzer
__________________
JD-Dev & Server-Admin
Reply With Quote
  #174  
Old 05.03.2015, 17:11
oscarvillagrasa
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by J-J View Post
HOW TO INSTALL JDOWNLOADER2 ON SYNOLOGY NAS:

  1. Install JD on Windows/Linux/OS X with the **External links are only visible to Support Staff**...
  2. Start JD and let it update to the latest version
  3. Setup all settings in JD
    • User Interface
      • Enable Silent Mode
    • Bubble Notify
      • Show Bubbles if Never
    • Tray Icon
      • Uncheck Enabled
    More info on 1st post if needed (long version until step 1.3):
    Spoiler:

  4. Close JD completely
  5. Copy the content of the JD installation folder to your preferred JD installation folder on your NAS with an SSH client.
    e.g.: /volume1/@appstore/jdownloader/
  6. See that all files in this folder have the right permissions
    I first created the shared folder "jdownloader" in DSM and before restarting my NAS (step 10), I copied the content of the folder to a new jdownloader folder at "/volume1/@appstore/jdownloader/". Just to be sure I had all right to the folder

    If you're having trouble with permissions, this is how permissions are set in my jdownloader folder:
    Spoiler:


  7. Install Java Manager through Package Center
  8. Make a file called S99jdownloader.sh and save it to /usr/local/etc/rc.d/S99jdownloader.sh (with SSH client)
  9. Open S99jdownloader.sh with your text editor and copy following script into it.
    Knowing your JD install folder is at /volume1/@appstore/jdownloader/ Otherwise adjust your location in the script (line 10)
    I used the text editor of DSM to create the file and copied it afterwards with my SSH client (to have the right permissions)
    Spoiler:
    PHP Code:
    #!/bin/sh):
    #
    # Startup script for jdownloader2
    #
    # Stop myself if running
    PIDFILE=/var/run/S99jdownloader.pid
    #
    start() {
    sleep 1
    nohup 
    /volume1/@appstore/JavaManager/Java/bin/java -Djava.awt.headless=true -jar [b][color=red]/volume1/@appstore/jdownloader/JDownloader.jar[/color][/b] &
    # write pidfile
    echo $! > $PIDFILE
    }
    #
    stop() {
    [ -
    ${PIDFILE} ] && kill `cat ${PIDFILE}`
    # remove pidfile
    rm -f $PIDFILE 
    }
    #
    case "$1" in
    start
    )
    start
    ;;
    stop)
    stop
    ;;
    restart)
    stop
    sleep 1
    start
    ;;
    *)
    echo 
    "Usage: $0 (start|stop|restart)"
    exit 1
    ;;
    esac
    # End 
  10. Restart your NAS. JDownloader will now automatically be loaded at startup.
  11. Adjust settings at **External links are only visible to Support Staff**... under "Settings", "Advanced Settings", "General - Default Download Folder": DOWNLOAD FOLDER OF YOUR CHOISE (make sure you created this share on your NAS).
    e.g.: /volume1/Downloads

Images of JDownloader2 working on DS412+:
Spoiler:

Some Remarks
  1. Whenever there's an update of JDownloader2 you get a pop-up at **External links are only visible to Support Staff**.... You can trigger the update in the settings tab on the site.
  2. If JD failes to restart after an update, do the following:
    • Open DSM web interface
    • Go to "Control Panel" and then "Task Scheduler"
      Spoiler:
    • Click "Create" and choose "User-defined scripts"
      Spoiler:
    • Give the task a name (e.g. Jdownloader), set the user to "root" and as User-defined script you set /usr/local/etc/rc.d/S99jdownloader.sh
      Spoiler:
    • Close with OK
    • Unthick the script (we just want to activate it manually and not on schedule) and select the created task and click on "Run"
      Spoiler:
    • JDownloader2 should be running again (check on **External links are only visible to Support Staff**...)
    • Now, each time JD failes to (re)start you can launch it manually with task scheduler.


ENJOY!

Good afternoon everybody, Let my first words be to introduce myself and say thank you in advance for your help. I am new to this forum and totally new to NAS. I have bought a Sinology NAS DS214Play

Unfortunately, I am not able to follow these instructions. I got stuck in step 8. As I said, totally new to this machines, so I don´t know much about how to modify its original content.

I don't know how to copy paste the file S99jdownloader.sh. I think I have created it correctly with a text editor and it is already in the NAS, but now I am not able to move it to its final destination (/usr/local/etc/rc.d/S99jdownloader.sh, in the NAS I guess). Do I need any special software? (Might be web console? I was not able to find it). If so, Where can I find it?.

Once again thanks in advance for your help.
Reply With Quote
  #175  
Old 05.03.2015, 17:16
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

Point 1 till 7 are Wrong:
You can only copy Installation from one Computer to another Computer/NAS if it has the same CPU/OS!
Please download installer.jdownloader.org/JDownloader.jar -norestart and start it where you want your JDownloader to be installed

Point 8.) in ssh/putty, vi /usr/local/etc/rc.d/S99jdownloader.sh and paste the content of script into it.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #176  
Old 05.03.2015, 18:12
oscarvillagrasa
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
Point 1 till 7 are Wrong:
You can only copy Installation from one Computer to another Computer/NAS if it has the same CPU/OS!
Please download installer.jdownloader.org/JDownloader.jar -norestart and start it where you want your JDownloader to be installed

Point 8.) in ssh/putty, vi /usr/local/etc/rc.d/S99jdownloader.sh and paste the content of script into it.


OK. The install file has to be run in the NAS. I have download it and translated into my Sinology NAS. The next thing is, How can I make it run?. I don´t know how to trigger the installation. Just for info, My computer is an iMac.

Thanks.

Last edited by oscarvillagrasa; 05.03.2015 at 18:14. Reason: Additional information.
Reply With Quote
  #177  
Old 05.03.2015, 18:30
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

connect via ssh and java -jar JDownloader.jar -norestart in console
__________________
JD-Dev & Server-Admin
Reply With Quote
  #178  
Old 05.03.2015, 20:04
zoddel zoddel is offline
Super Loader
 
Join Date: Mar 2015
Posts: 25
Default

OK !
Got my startscript running on DS415play.
Script for everyone who dont got it running.
Code:
#!/bin/sh 
# 
# Startup script for jdownloader2 
# 
# Stop myself if running 
# 
start() { 
sleep 30 
nohup /volume1/@appstore/JavaManager/Java/bin/java -Djava.awt.headless=true -jar /volume1/@appstore/jdownloader/JDownloader.jar & 
} 
# 
stop() { 
PIDFILE=/volume1/@appstore/jdownloader/JDownloader.pid
[ -f ${PIDFILE} ] && kill `cat ${PIDFILE}`  
} 
# 
case "$1" in 
start) 
start 
;; 
stop) 
stop 
;; 
restart) 
stop 
sleep 10
start 
;; 
*) 
echo "Usage: $0 (start|stop|restart)" 
exit 1 
;; 
esac 
# End
@Jiaz
Start nachm Boot funktioniert nun einwandfrei.
Habe JD allerdings noch als root laufen.
Nun gehts weiter ...
1. Habe den Order über folgenden Befehl auf den User JDownloader gestellt.
Code:
chown -R JDownloader: /volume1/@appstore/jdownloader
Wie kann ich sehen, ob es funktioniert hat ?
2. Habe den Order in den JD runterläd für User JDownloader freigegeben.
3. Hier brauche ich deine Hilfe. Wie passe ich folgende Zeile aus dem Script an, damit der User gezogen wird ?
Code:
nohup /volume1/@appstore/JavaManager/Java/bin/java -Djava.awt.headless=true -jar /volume1/@appstore/jdownloader/JDownloader.jar &

Last edited by zoddel; 05.03.2015 at 20:15.
Reply With Quote
  #179  
Old 05.03.2015, 20:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

versuch mal
nohup su -c "/volume1/@appstore/JavaManager/Java/bin/java -Djava.awt.headless=true -jar /volume1/@appstore/jdownloader/JDownloader.jar &" JDownloader
__________________
JD-Dev & Server-Admin
Reply With Quote
  #180  
Old 05.03.2015, 20:40
zoddel zoddel is offline
Super Loader
 
Join Date: Mar 2015
Posts: 25
Default

Mist, das funktioniert leider nicht.
Bekomme leider auch keine Fehlermeldung zu sehen . . .
Mache ich das ganze ohne nohup kommt folgende Ausgabe:

su: cant chdir to home directory '/var/services/home/JDownloader'
su: cant run /sbin/nologin: No such file or directory

Kannst du damit etwas anfangen?
Weis nichtmal woher die Pfade kommen

Last edited by zoddel; 05.03.2015 at 20:57.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 01:44.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.