JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 21.07.2017, 09:53
pietrek pietrek is offline
Super Loader
 
Join Date: Oct 2010
Posts: 26
Default Autostart JD2 with system startup.

How to add JD2 to Ubuntu Server autostart - without gui. Only Ubuntu console.
Reply With Quote
  #2  
Old 21.07.2017, 10:00
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 63,945
Default

Write a script that starts JDownloader in headless mode

java -Djava.awt.headless=true -jar JDownloader.jar >/dev/null 2>/dev/null
you should run that script as different user
eg
su -c "/.../script.sh &" user

You can either place it in /etc/rc.local or write a systemd file for it
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 21.07.2017, 13:10
pietrek pietrek is offline
Super Loader
 
Join Date: Oct 2010
Posts: 26
Default

I do not know what I'm doing wrong, but something does not work for me.
Reply With Quote
  #4  
Old 21.07.2017, 13:17
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 63,945
Default

write little script, eg start.sh

Code:
#!/bin/bash
cd /pathtoJDownloader
java -Djava.awt.headless=true -jar JDownloader.jar >/dev/null 2>/dev/null &
chmod +x start.sh

now edit /etc/rc.local

add line to start.sh, next start your system will execute the script

in case you want to use a different user

su -c "...start.sh" user
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 21.07.2017, 23:00
pietrek pietrek is offline
Super Loader
 
Join Date: Oct 2010
Posts: 26
Default

I followed the above guidelines and it looks like JD has started.

Code:
pietrek@testujemy:~$ ps aux | grep JDownloader.jar
pietrek    914 21.0  4.1 3304924 85664 ?       Sl   22:53   0:09 /usr/lib/jvm/jdk1.8.0_131/jre/bin/java -Djava.awt.headless=true -jar /home/pietrek/jd2/tmp/update/self/JDU/JDownloader.jar -selftest tmp/selftest_1500670420164 /home/pietrek/jd2
pietrek    953  0.0  0.0  15460   924 pts/0    S+   22:54   0:00 grep --color=auto JDownloader.jar
There is something wrong with this launch because I can not connect through Web Interfaces: https://my.jdownloader.org/

What could be wrong? How to modify it?
Reply With Quote
  #6  
Old 22.07.2017, 13:30
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 63,945
Default

the output shows that JDownloader was updating
did you setup MyJDownloader logins for this installation yet?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #7  
Old 22.07.2017, 15:58
pietrek pietrek is offline
Super Loader
 
Join Date: Oct 2010
Posts: 26
Default

Login data was given. When I run the command:

Code:
java -jar JDownloader.jar

the web interface works and I can log in. Where can I verify this password and login?
Reply With Quote
  #8  
Old 22.07.2017, 16:03
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 63,945
Default

can you show the complete script?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 22.07.2017, 16:09
pietrek pietrek is offline
Super Loader
 
Join Date: Oct 2010
Posts: 26
Default

Code:
pietrek@testujemy:~/jd2$ cat start.sh
#!/bin/bash
cd /home/pietrek/jd2
java -Djava.awt.headless=true -jar JDownloader.jar >/dev/nu
l 2>/dev/null &
Code:
pietrek@testujemy:/etc$ cat rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runl
vel.
# Make sure that the script will "exit 0" on success or any
other
# value on error.
#
# In order to enable or disable this script just change the
execution
# bits.
#
# By default this script does nothing.

su -c "/home/pietrek/jd2/start.sh" pietrek

exit 0
Reply With Quote
  #10  
Old 22.07.2017, 16:19
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 63,945
Default

make sure the folder has correct permissions
sudo chown -R user:group /home/pietrek/jd2
__________________
JD-Dev & Server-Admin
Reply With Quote
  #11  
Old 22.07.2017, 20:40
pietrek pietrek is offline
Super Loader
 
Join Date: Oct 2010
Posts: 26
Default

I have the following permissions:

Code:
drwxrwxr-x 17 pietrek pietrek        4096 lip 22 20:38 jd2

What to change?
Reply With Quote
  #12  
Old 22.07.2017, 20:58
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 63,945
Default

and all files in it as well?
all ower are correct?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #13  
Old 22.07.2017, 21:20
pietrek pietrek is offline
Super Loader
 
Join Date: Oct 2010
Posts: 26
Default

Code:
pietrek@testujemy:~/jd2$ ls -l
razem 11336
-rw-r--r--    1 root    root        320 lip 21 12:11 build.json
drwxrwxr-x    7 pietrek pietrek    4096 cze  2 11:44 captchas
drwxrwxr-x    6 pietrek pietrek   36864 lip 22 21:18 cfg
-rw-r--r--    1 root    root    7887844 lip 21 12:11 Core.jar
-rw-rw-r--    1 pietrek pietrek  100384 lip  2 13:03 error.log
drwxrwxr-x    2 pietrek pietrek    4096 cze 25 06:58 extensions
drwxrwxr-x    2 pietrek pietrek    4096 lip  7  2016 java
drwxrwxr-x    4 pietrek pietrek    4096 lip  7  2016 jd
-rwxr-xr-x    1 pietrek pietrek   12198 sty 19  2016 JDownloader2
-rwxr-xr-x    1 pietrek pietrek   12270 sty 19  2016 JDownloader2Update
-rw-r--r--    1 pietrek pietrek      31 sty 19  2016 JDownloader2Update.vmoptions
-rw-r--r--    1 pietrek pietrek      31 sty 19  2016 JDownloader2.vmoptions
-rw-r--r--    1 root    root    3299093 lip 21 12:11 JDownloader.jar
-rwxr-xr-x    1 pietrek pietrek     205 lip  7  2016 JDownloader 2.desktop
-rwxr-xr-x    1 pietrek pietrek     233 lip  7  2016 JDownloader 2 Update & Rescue.desktop
drwxrwxr-x    6 pietrek pietrek    4096 lip  7  2016 jre
drwxrwxr-x    5 pietrek pietrek    4096 lip 21 12:11 libs
-rw-rw-r--    1 pietrek pietrek   39624 lip  7  2016 license_german.txt
drwxrwxr-x    5 pietrek pietrek    4096 maj  4 18:29 licenses
-rw-rw-r--    1 pietrek pietrek   32034 lip  7  2016 license.txt
drwxrwxr-x 1137 pietrek pietrek   77824 lip 22 21:18 logs
-rw-rw-r--    1 pietrek pietrek    5334 lip  2 13:03 output.log
-rwxrwxr-x    1 pietrek pietrek     109 lip 21 22:47 start.sh
drwxrwxr-x    3 pietrek pietrek    4096 lip  7  2016 themes
drwxrwxr-x    8 pietrek pietrek    4096 lip 22 21:18 tmp
drwxrwxr-x    3 pietrek pietrek    4096 lip  7  2016 tools
drwxrwxr-x    5 pietrek pietrek    4096 lip  7  2016 translations
-rwx------    1 pietrek pietrek   12972 sty 19  2016 Uninstall JDownloader
drwxrwxr-x    3 pietrek pietrek    4096 lip  7  2016 update

Convert from user pietrek to root or vice versa root on pietrek?

Last edited by pietrek; 22.07.2017 at 21:56.
Reply With Quote
  #14  
Old 23.07.2017, 03:02
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,145
Default

if you've already run chown -R then you must be running JDownloader as root as ownership has changed

build.json, JDownloader.jar, and Core.jar is owned by root:root
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]

Last edited by raztoki; 24.07.2017 at 03:03.
Reply With Quote
  #15  
Old 23.07.2017, 08:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 63,945
Default

Quote:
Originally Posted by Jiaz View Post
make sure the folder has correct permissions
sudo chown -R user:group /home/pietrek/jd2
Raztoki is right, please fix all owner (recursivly) with that command!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #16  
Old 23.07.2017, 09:16
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,145
Default

and then never run as root again ;p
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #17  
Old 23.07.2017, 17:05
pietrek pietrek is offline
Super Loader
 
Join Date: Oct 2010
Posts: 26
Default

Thank you. It works. :-)
Reply With Quote
  #18  
Old 23.07.2017, 20:31
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 63,945
Default

Thanks for the feedback!
__________________
JD-Dev & Server-Admin
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 22:17.
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 - 2019, Jelsoft Enterprises Ltd.