|
#1
|
|||
|
|||
Ubuntu permissions problems
Hello,
I'm a newbie for Jdownloader on Ubuntu and I'm having trouble using It with my config. Indeed, I'm running Jdownloader on a computer with Nextcloud and Plex. I want It to download all the things I need directly to a folder owned by apache user (www-data). I can't change the permissions of that folder because Nextcloud is blocking It. Using Plex, I added the user "plex" to the group "www-data" to be able to navigate through the folders owned by www-data user. Knowing that Plex program is launched with the user "plex". I can't add my personal account to www-data group because Nextcloud doesn't let me do so too. So how can I let Jdownloader access this folders owned by www-data? |
#2
|
||||
|
||||
You can either run JDownloader as the correct user, eg
sudo -c "java -jar JDownloader.jar...&" user or create a new user JD with group www-data sudo -c "java -jar JDownloader.jar...&" JD
__________________
JD-Dev & Server-Admin |
#3
|
|||
|
|||
Quote:
And another question : how can I auto start on boot Jdownloader if we suppose that I use your second option? Thank you for your answer ! |
#4
|
||||
|
||||
Read here about clean installation
https://support.jdownloader.org/Know...bedded-devices Autostart, best would be to use search engine of your choice. For example /etc/rc.local and add line like sudo -c "java -jar /path/JDownloader.jar &" user
__________________
JD-Dev & Server-Admin |
#5
|
|||
|
|||
What's the difference between your link tutorial and using the sh file? Do I have to run the installation commands under the user "JD" of your second method of your first post?
|
#6
|
||||
|
||||
What sh file?
The tutorial is about pure/manual installation as *clean* as possible.
__________________
JD-Dev & Server-Admin |
#7
|
|||
|
|||
Quote:
It is the file that you can download in the linux section of this page. Using your tutorial, do I have to run all the commands using the newly created user mentioned in your first post? |
#8
|
||||
|
||||
Thanks, that's a very old script and not meant for headless installations.
Best would be to run as that user, so the files all have right ownership from start. create a user, eg jd su jd now install JDownloader as user jd then add commandline to /etc/rc.local /as root like shown above
__________________
JD-Dev & Server-Admin |
#9
|
|||
|
|||
Quote:
EDIT : Found the solution here but still don't understand why this happened to me... https://board.jdownloader.org/showthread.php?t=75534 Trying now to make JDownloader start on boot... Last edited by Jungack; 27.06.2018 at 00:27. |
#10
|
|||
|
|||
Hello,
In fact, I encountered an other problem. The folder group (www-data) only has read permissions. This can't be changed. So JDownloader can't download to the directory I want. Any idea? |
#11
|
||||
|
||||
Simply allow write permission to the download folder for that group?
Permissions are set on file/folder level, and not group. You can also check who the owner of the folder is and use the same user instead of group
__________________
JD-Dev & Server-Admin |
#12
|
|||
|
|||
Permissions fixed using chmod -R, chmod g+s and umask (apache). Now trying the autostart.
|
#13
|
|||
|
|||
Since I used this post :
https://board.jdownloader.org/showthread.php?t=75534 to solve my problem, I need to use the command java -Djava.awt.headless=true -jar JDownloader.jar to start JDownloader each time. So to autostart I opened /etc/rc.local and put : sudo -c "java -Djava.awt.headless=true -jar JDownloader.jar" jd2 (jd2 is the user) It does not work : It does not start automatically. Any idea please?:outch: |
#14
|
||||
|
||||
You've got to specify the full path to JDownloader.jar
sudo -c "java -Djava.awt.headless=true -jar /folder/folder/JDownloader.jar &" jd2
__________________
JD-Dev & Server-Admin |
#15
|
|||
|
|||
Quote:
And I encountered an other problem ahhh ! When the file is downloaded to the folder at stake, It is owned by www-data group and jd2 user. I need It to be owned by www-data user and www-data group. I can't run jd2 with www-data user, since It is the Apache user. How can I automatically change the user owner from jd2 to www-data? |
#16
|
||||
|
||||
Of course you can run it as www-data, why shouldn't this be possible?
Doesn't matter if it's used by apache or more applications. Also you can't change the owner without admin rights and also there is no need to. The files don't need the same owner! I suggest to set correct umask create a script, eg /etc/jd.sh Code:
#!/bin/bash umask 000 java -Djava.awt.headless=true -jar /folder/folder/JDownloader.jar & in /etc/rc.local sudo -c "/etc/jd.sh &" jd2 umask specifies the default permissions for new created files/folders, so other user/groups can still rename/delete/write the files of JDownloader. the & tells NOT to wait and start in background
__________________
JD-Dev & Server-Admin |
#17
|
|||
|
|||
Quote:
su www-data asks for password. So I think the problem of accessing the file isn't related to the permissions... My Nextcloud instance does not detect the files downloaded by JDownloader I don't know why ! Some ideas maybe? umask is already set to 002. With the chmod g+s, all the files downloaded has 775 permissions I think. I'm going to try your scripts. Thank you ! And I put here some results... |
#18
|
||||
|
||||
/etc/rc.local is launched as root so sudo doesn't require any password
sudo -c "command" www-data will run command as www-data I guess nextcloud has to reindex the new files, maybe a cronjob required for this
__________________
JD-Dev & Server-Admin |
#19
|
|||
|
|||
Hello,
I have tried the command below : sudo -c "java -Djava.awt.headless=true -jar /folder/folder/JDownloader.jar &" jd2 Instead of showing that jdownloader is starting, It shows me the usage of the sudo command : usage : sudo -h | -K | -k | -V usage : sudo -v [-AknS] [-g group]... Why is this? |
#20
|
||||
|
||||
Sorry
try su -c "java -Djava.awt.headless=true -jar /folder/folder/JDownloader.jar &" jd2
__________________
JD-Dev & Server-Admin |
#22
|
|||
|
|||
Thank you for all your help ! Seems to be perfect now !
Last question maybe : since I have run this command : sudo -c "java -Djava.awt.headless=true -jar /folder/folder/JDownloader.jar &" jd2 Do I have to reset some permissions? I have seen some threads where running JDownloader as root can cause some troubles... EDIT : Oh sorry two messages my computer is lagging |
#23
|
||||
|
||||
sudo su -c "java -Djava.awt.headless=true -jar /folder/folder/JDownloader.jar &" jd2
runs JDownloader as user jd2 you can easily fix the permissions with sudo chown -R jd2:jd2 /folder/folder/JDownloaderFolder replace jd2 with user:group and folder with JDownloader folder to recursively set owner of files/folders
__________________
JD-Dev & Server-Admin |
#24
|
|||
|
|||
Thank you ! Now I think all is clean !
|
#25
|
||||
|
||||
Thanks for the feedback
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|