linux – Transmission Daemon running under custom user trying to load config from wrong path

I have transmission daemon 2.94 running as a service on my Debian 10 machine.

I changed the user running transmission daemon from default debian-transmission to www-data Apache user, since I want the save files to be readable by Apache and the opposite, Apache files to be readable by transmission.

To do that, I changed to the user setting from the following config files:

  • User=www-data in /lib/systemd/system/transmission-daemon.service
  • USER=www-data in /etc/init.d/transmission-daemon
  • setuid www-data and setgid www-data in /etc/init/transmission-daemon.conf

The transmission JSON config file still resides in /etc/transmission-daemon/settings.json. I made sure both directories /var/lib/transmission-daemon and /etc/transmission-daemon were owned by the new user www-data

But when I relaunch the service with sudo systemctl start transmission-daemon or sudo service transmission-daemon start, I get the following in the transmission logs:

Couldn't create "/var/www/.config": Permission denied (file-posix.c:189)
Couldn't read "/var/www/.config/transmission-daemon/settings.json": No such file or directory (utils.c:238)
Couldn't save temporary file "/var/www/.config/transmission-daemon/settings.json.tmp.jq3qtN": No such file or directory (variant.c:1285)

…and other similar errors.

So it would seem transmission-daemon is trying to use the www-data user home path and recreate its config directory here.

Why is that and how can I make transmission using the previous default config path? I don’t see any transmission configuration depending on the user home path.

Side question: what is the difference between all those three config files where you set up the user running the service?