Application does not start because of permissions denied (deluge-web)

1

I am trying to run deluge-web service under the deluge and getting permissions denied errors.

myuser@ubuntu:~$ sudo -u deluge /usr/bin/deluge-web
[sudo] password for myuser:
[ERROR   ] 16:12:23 common:167 Unable to use default config directory, exiting... ([Errno 13] Permission denied: '/home/myuser/.config/deluge')

Ownership and permissions on the folder:

myuser@ubuntu:~$ ls -l /home/myuser/.config/
total 4
drwxrwxrwx 6 deluge deluge 4096 Oct 14 14:02 deluge

I've also tried to add "deluge" user to the "sudo" group (silly, but I really do not know how to solve that) and still getting the same error:

myuser@ubuntu:~$ sudo usermod -a -G sudo deluge
myuser@ubuntu:~$ sudo -u deluge /usr/bin/deluge-web
[ERROR   ] 16:17:30 common:167 Unable to use default config directory, exiting... ([Errno 13] Permission denied: '/home/myuser/.config/deluge')

However if I run it under "myuser" then it works well:

sudo -u myuser /usr/bin/deluge-web

What should I do?

UPDATE: This is my init script:

# deluge-web - Deluge Web UI
#
# The Web UI component of Deluge BitTorrent client, connects to deluged and
# provides a web application interface for users. Default url: http://localhost:8112

description "Deluge Web UI"
author "Deluge Team"

start on started deluged
stop on stopping deluged

respawn
respawn limit 5 30

env uid=deluge
env gid=deluge
env umask=027

exec start-stop-daemon -S -c $uid:$gid -k $umask -x /usr/bin/deluge-web -l /var/log/deluge/deluge-web.conf -L warning

Dmitrij Kultasev

Posted 2015-10-14T13:20:42.813

Reputation: 101

2Which are the permission of ~/.config? ls -lad ~/.config. Did you try to change the uid guid and umask in /etc/init/deluge-web.conf? – Hastur – 2015-10-14T13:30:34.100

Changed ownership of the ~/.config directory and it worked. What umask do I need to use in the init config? – Dmitrij Kultasev – 2015-10-14T13:40:04.317

Following your needs or moods :-) (See below in the answer and in the reference). – Hastur – 2015-10-14T13:48:06.920

Answers

1

With

Permission denied: '/home/myuser/.config/deluge'

the program says that it cannot access to the directory.
Check the permission for the father directory /home/myuser/.config with

ls -lad /home/myuser/.config

and change them if needed.

Below is an explanation of how you can manage access and permission of files downloaded through Deluge (umask parameter):

  • 007 grants full access to the user and members of the group Deluge is running as (in this case Deluge) and prevents access from all other accounts.
  • 022 grants full access to the user Deluge is running as and only read access to other accounts.
  • 000 grants full access to all accounts.

Further lectures

Hastur

Posted 2015-10-14T13:20:42.813

Reputation: 15 043

I've modified the question. Added the init script. Changed umask from 027 to 000 and it doesn't start anyway – Dmitrij Kultasev – 2015-10-14T13:51:18.260

From the second link they propose "In the end i just let it use /var/lib/deluge as its config directory.", in the second iain created a user deluge, env uid=deluge, env gid=deluge ,env umask=000 in the config file and exec start-stop-daemon -S -c $uid:$gid -k $umask -x /usr/bin/deluge-web... BTW Did you restart it to allow it to notice the changes? (sudo stop deluge and sudo stop deluge-web followed by sudo start deluge) ...? – Hastur – 2015-10-14T14:13:19.887

did not understand you well. However I do not know how to specify /var/lib/deluge as config directory ... I've changed the umask=000 and rebooted the machine. It did not help – Dmitrij Kultasev – 2015-10-14T14:19:26.873