Page 1 of 1

Permission issues for download location

Posted: Thu Dec 21, 2017 2:45 am
by jaygroh
Running Ubuntu 16.04 in a small VM

I have a cifs share going to my media server for storage. I want to have deluge download torrents to /media/Media/Bittmp and when finished move them to /media/Media/Bittorrent

It will start to download but then error out with permission denied. It creates a directory with as the cifs share user name which is the same name I use and has owner read write, user read, and others read.

I can force a 777 on all the directory and files it creates for the torrent and it will download fine but still has issues moving it because of the same permission error. What am I missing to get it to write to the download location correctly?

In the systemd script I have the umask set to 000

Re: Permission issues for download location

Posted: Fri Dec 22, 2017 10:33 am
by shamael
Hi,

Cifs mounted with fstab? What's the line?
Are your sure Deluge user has access to this location? check with a "ps aux|grep-i delug*"

Be aware the move is not mandatory, certainly on the same storage. You can download directly in the final folder but you may have good reason to make the move of course.

Re: Permission issues for download location

Posted: Fri Dec 22, 2017 4:01 pm
by jaygroh
Here is what I have used for the cifs line in fstab
//media/Data /media/Media cifs username=jay,password=(my password) 0 0

I'm pretty sure it has rights. It will create a directory but then cannot write into the directory. I will do a 777 on it and it will create the file inside the directory but it cannot write to the file so I do another 777 on the file. Then it will download it. When it creates the directory the owner is always jay and not deluge.

Here is the output of ps aux | grep -i delug*
deluge 1292 0.1 10.7 148608 51944 ? Ss Dec21 1:43 deluge-web
deluge 34065 6.4 14.6 355332 70436 ? Sl 10:44 0:29 /usr/bin/python /usr/bin/deluged --port=58846 --config=/var/lib/deluge/.config/deluge
jay 34335 0.0 0.2 14224 972 pts/1 S+ 10:51 0:00 grep --color=auto -i delug*

The move is not necessary but I use the final move to Bittorrent as a directory of new TV shows and movies to watch that are done downloading. When I'm done watching them I move them manually to a TV or Movie directory for final storage.

Re: Permission issues for download location

Posted: Sat Dec 23, 2017 1:29 pm
by shamael
The behaviour is expected with the line you specified, may you tray with the line below? (umount, fstab change, mount -a)
//media/Data /media/Media cifs username=jay,password=(my password),iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

This way jay will still be the owner but permission 777 are automatically added. I prefer to create different users on the cifs share but that's another topic ;).

Re: Permission issues for download location

Posted: Sun Dec 24, 2017 12:47 am
by jaygroh
Still no change. Deluge still creates a directory with user jay with owner as RW, group R, and others R.

If I point it to a local directory with full access it will create a directory with user deluge with owner RW, group R, others R and it works fine.

If I touch a file in /media/Media/Bittmp the owner is jay with RW, group R, others, R.

If I touch a file in a local directory it is owner RW, group RW, others R.

Something is not right with folder and file creation. I've tried multiple umask setting in the deluge systemd script but its either no change or it wont even work.

Re: Permission issues for download location

Posted: Mon Dec 25, 2017 11:20 pm
by shamael
I've no test system for the moment but the line should work. It's weird the folder created doesn't respect the fstab entry
May you set the permission on //media/Data /media/Media first? (just to be sure)
sudo chown -R jay:jay //media/Data /media/Media
sudo chmod -R jay:jay //media/Data /media/Media

Then umount/mount again the share (or reboot).