Page 1 of 1

Permissions Stuff

Posted: Mon Mar 16, 2009 12:26 pm
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

Re: Permissions Stuff

Posted: Mon Mar 16, 2009 12:39 pm
by damoxc
Might be useful if you post your init script.

Re: Permissions Stuff

Posted: Mon Mar 16, 2009 1:07 pm
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
}

Re: Permissions Stuff

Posted: Mon Mar 16, 2009 1:11 pm
by damoxc
Have you set DELUGED_USER in /etc/conf.d/deluged to "deluge:share"?

Re: Permissions Stuff

Posted: Fri Mar 20, 2009 9:55 pm
by exelsus
Yes i have, just like that...

What about the mask thing, isn't it configurable?

Re: Permissions Stuff

Posted: Sat Mar 21, 2009 2:28 am
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

Re: Permissions Stuff

Posted: Sat Aug 15, 2009 3:24 am
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!!