File permissions

General support for problems installing or using Deluge
chris86wm
Member
Member
Posts: 12
Joined: Mon Feb 01, 2010 4:56 am

File permissions

Post by chris86wm »

Is there a way to change the file permissions of the downloaded files from Deluge?
I have Deluge download to a directory that is accessible over my network, and I wish to delete a file from that folder from another computer over the network. Currently, Deluge tells me that I do no have permission to do so. Is there anyway that I can correct this?
chris86wm
Member
Member
Posts: 12
Joined: Mon Feb 01, 2010 4:56 am

Re: File permissions

Post by chris86wm »

Any ideas? I'm having to chmod 777 the entire download directory to allow my other machines to modify the files.
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: File permissions

Post by johnnyg »

You could try using the execute plugin?
andar
Top Bloke
Top Bloke
Posts: 1050
Joined: Fri Jun 08, 2007 8:38 pm
Location: Victoria, BC
Contact:

Re: File permissions

Post by andar »

You could set an appropriate umask for the user running deluge.
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: File permissions

Post by johnnyg »

Actually, I recently discovered that start-stop-daemon has a nice --umask option ;)
chris86wm
Member
Member
Posts: 12
Joined: Mon Feb 01, 2010 4:56 am

Re: File permissions

Post by chris86wm »

Would either of you care to elaborate on the umask option? I cant seem to figure it out
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: File permissions

Post by johnnyg »

When a file/folder is created, its permissions are worked out by

Code: Select all

<permissions> & ~<umask>
where '&' is 'bitwise and', '~' is 'bitwise not' and both <permissions> and <umask> are octal values.

By default, your umask is 022
so when you create a file

Code: Select all

0666 & ~022 = 0644
you get 644 (rw-r--r--) as permissions for that file.
and when you create a directory

Code: Select all

0777 & ~022 = 0755
you get 755 (rwxr-xr-x) as permissions for that folder.

You can read more about it at http://en.wikipedia.org/wiki/Umask.

Changing your umask to 0 will effectively be the same as chmodding every folder as 777 and every file as 666.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: File permissions

Post by Cas »

johnnyg wrote:Actually, I recently discovered that start-stop-daemon has a nice --umask option ;)
Thanks, can't believe that option has been there all this time!! Goes to show my old boss' comments about checking the man pages are true :lol:

I simply created a 'UMASK=000' variable to the top on my init script and then added '--umask $UMASK' for the two deluged start commands.

Could you update the sites ubuntu init script with this?
chris86wm
Member
Member
Posts: 12
Joined: Mon Feb 01, 2010 4:56 am

Re: File permissions

Post by chris86wm »

Are you adding the --umask somewhere in here?

Code: Select all

start-stop-daemon --start --background --quiet --pidfile $PIDFILE1 --exec $DAEMON1 \
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: File permissions

Post by johnnyg »

Cas wrote:Could you update the sites ubuntu init script with this?
Done.
chris86wm wrote:Are you adding the --umask somewhere in here?

Code: Select all

start-stop-daemon --start --background --quiet --pidfile $PIDFILE1 --exec $DAEMON1 \
You can add it in there, sure.
Otherwise just grab the initscript again: http://dev.deluge-torrent.org/wiki/User ... InitScript
Post Reply