Permissions Stuff

General support for problems installing or using Deluge
Post Reply
exelsus
New User
New User
Posts: 3
Joined: Mon Mar 16, 2009 12:12 pm

Permissions Stuff

Post by exelsus »

Heya all, i have a question, well a couple of them. I have deluge downloading things and putting them in a samba share folder so:

1) How can i change the default permission mask of deluge for files, and folders? I want to make files 664, and folders 775, so users across the network can erase the things they download when they want.

2) How can i set a different group for the deluge daemon? in the daemon .conf says you can type the group after the user with a colon, but when i started it shows this ambiguous thing so i don't know if i'll work well or not:

Code: Select all

/etc/init.d/deluged start
 * Starting Deluged ...
/sbin/start-stop-daemon: user `deluge:share' not found
 (Success)                                                                [ !! ]
 * Starting Deluge ...                                                    [ ok ]
(the user is deluge, and the group is share, share properly set in /etc/groups)

Any ideas?

Thanks
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Permissions Stuff

Post by damoxc »

Might be useful if you post your init script.
exelsus
New User
New User
Posts: 3
Joined: Mon Mar 16, 2009 12:12 pm

Re: Permissions Stuff

Post by exelsus »

OK here you go :p

Code: Select all

#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/net-p2p/deluge/files/deluged.init,v 1.5 2009/02/17 15:32:17 armin76 Exp $

depend() {
        need net
}

checkconfig() {
        if [[ "${DELUGED_USER}" == "" ]] ; then
                eerror "Please edit /etc/conf.d/deluged"
                eerror "You have to specify a user to run deluged as, as we will not run it as root!"
                eerror "Modify DELUGED_USER to your needs (you can also add a group, after a colon)"
                return 1
        fi
        if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${DELUGED_USER}" | cut -d ':' -f 1 ) -sq` ; then
                eerror "Please edit /etc/conf.d/deluged"
                eerror "Your user has to exist!"
                return 1
        fi
        if ! `echo "${DELUGED_USER}" | grep ':' -sq` ; then
                return 0
        else
                if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${DELUGED_USER}" | cut -d ':' -f 2 ) -sq` ; then
                        eerror "Please edit /etc/conf.d/deluged"
                        eerror "Your group has to exist too!"
                        return 1
                fi
        fi
        return 0
}

start() {
        checkconfig || return $?
        if [[ "${DELUGED_HOME}" == "" ]] ; then
                DELUGED_USER_HOME=`getent passwd | grep ^$( echo "${DELUGED_USER}" | cut -d ':' -f 1 ): | cut -d ':' -f 6`
        else
                DELUGED_USER_HOME="${DELUGED_HOME}"
        fi
        ebegin "Starting Deluged"
        start-stop-daemon --start --user "${DELUGED_USER}" \
        --name deluged --pidfile /var/run/deluged.pid --background --make-pidfile \
        --exec /usr/bin/deluged -c "${DELUGED_USER}" -e HOME=${DELUGED_USER_HOME} -- --do-not-daemonize "${DELUGED_OPTS}"
        eend $?


        if [[ "${DELUGEUI_START}" == "true" ]] ; then
                ebegin "Starting Deluge"
                start-stop-daemon --start --background --pidfile \
                /var/run/deluge.pid  --make-pidfile \
                --exec /usr/bin/deluge -c "${DELUGED_USER}" \
                -e HOME="${DELUGED_USER_HOME}" -- ${DELUGEUI_OPTS}
                eend $?
        fi
}

stop() {
        ebegin "Stopping Deluged"
        start-stop-daemon --stop --user "${DELUGED_USER}" \
        --name deluged --pidfile /var/run/deluged.pid
        eend $?


        if [[ "${DELUGEUI_START}" == "true" ]] ; then
                ebegin "Stopping Deluge"
                start-stop-daemon --stop --user "${DELUGED_USER}" \
                --name deluge --pidfile /var/run/deluge.pid
                eend $?
        fi
}
damoxc
Top Bloke
Top Bloke
Posts: 117
Joined: Sat Jul 19, 2008 7:26 pm
Location: Hampshire, UK
Contact:

Re: Permissions Stuff

Post by damoxc »

Have you set DELUGED_USER in /etc/conf.d/deluged to "deluge:share"?
exelsus
New User
New User
Posts: 3
Joined: Mon Mar 16, 2009 12:12 pm

Re: Permissions Stuff

Post by exelsus »

Yes i have, just like that...

What about the mask thing, isn't it configurable?
danii
Seeder
Seeder
Posts: 123
Joined: Tue Oct 23, 2007 10:29 pm
Location: Braga, Portugal

Re: Permissions Stuff

Post by danii »

exelsus wrote:What about the mask thing, isn't it configurable?
I don't think so but you could add a cron job to set the permissions from time to time
xaragon
New User
New User
Posts: 4
Joined: Sat Aug 15, 2009 3:16 am

Re: Permissions Stuff

Post by xaragon »

I have a similar set up, and Deluge's default permissions on files and folders prevent it from downloading files.

I've started two torrents, that are saved to a smbfs drive. Each time I've had to adjust either the folder permissions or the file permissions. It would be best to some how change the default permission for Deluge. I would be grateful for any ideas. The cronjob idea won't work, because the torrents are stopped on an error due to the file/folder permissions. Therefore I would have to initiate a torrent resume in the cronjob also.

Thanks!!
Post Reply