Permissions and maybe systemd trouble

General support for problems installing or using Deluge
Post Reply
Smith
New User
New User
Posts: 1
Joined: Fri Oct 04, 2024 10:35 pm

Permissions and maybe systemd trouble

Post by Smith »

I can't get deluged to create files with the permissions I desire. My installation is a headless raspberry with the intention of running deluge-web controlling a deluged on the same machine. I have to confess it's possible that systemd is a bit too complicated for me to set up correctly.

Code: Select all

> deluged -V
deluged 2.0.3
libtorrent: 2.0.8.0
Python: 3.11.2
OS: Linux Raspbian GNU/Linux 12 bookworm
Things I have tried: editing /etc/systemd/system/multi-user.target.wants/deluged.service and setting UMask=0000. I have tried also things like

User=pi
Group=pi

etc but the process always seems to run as debian-deluged. In the end, just to try to find some other way around the issue, I tried "sudo systemctl disable deluged" ... but deluged seems somehow to get started anyway (possibly by deluge-web?).

Here are some symtoms:

If I stop both services (via systemctl stop) and then restart only deluge-web, deluged starts also and after that I get suitable file permissions on the downloaded files (in this case "drwxrwxrwx"). In ps the command line seems to be:

/usr/bin/python3 /usr/bin/deluged -d -c /var/lib/deluged/config -l /var/log/deluged/daemon.log -L info

But after having executed those steps, if I now choose "stop daemon" from the connection manager in the web UI, and then restart the dameon in the web UI, the permissions that eg a downloaded directory get is "drwxr-x---". The command line in this case according to ps is actually slightly different;

/usr/bin/python3 /usr/bin/deluged --port=58846 --config=/var/lib/deluged/config

Which tree should I bark up?
mhertz
Moderator
Moderator
Posts: 2331
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Permissions and maybe systemd trouble

Post by mhertz »

You need change the User and Group of services, if not wanting deluged-debian user, and do both services while at it, and then change umask if wanted, and then do systemctl daemon-reload afterwards. Also change the ExesStart line to remove the "-c /var/lib/deluged/config" part, as defines dir owned by debian-deluged user, and just avoid any hardcoded profile as simply the homedir's .config/deluge dir will be used for the user defined in the services under User/Group options(specified in service itself or through drop-in file e.g '/etc/systemd/system/deluged.service.d/user.conf' ), so e.g. a new made deluge user, as official deluge systemd service docs recommends, or e.g. just using own user for simplicity, if not paranoid etc.

Avoid starting/stopping daemons outside systemd, when using systemd, as restarted in background outside service manager control/settings.

Hope helps.

Edit: Sorry forgot say that deluge-web.service in bookworm(and official docs guide) indeed pulls in deluged as you correctly speculated('Wants=deluged.service', 'After=deluged.service', latter for ordering only though).
Post Reply