0

So after some research I found the existence of drop-ins for systemd service units.

I'm trying to get the transmission-daemon package running as the pi user since it's the only way to get correct permission in the folder it downloads to. By default it runs as debian-transmission. I want to steer away from init.d and choose a systemd approach.

Described in the systemd file (/lib/system/systemd/transmission-daemon.service):

[Unit]
Description=Transmission BitTorrent Daemon
After=network.target

[Service]
User=debian-transmission
Type=notify
ExecStart=/usr/bin/transmission-daemon -f --log-error
ExecReload=/bin/kill -s HUP $MAINPID

[Install]
WantedBy=multi-user.target

With my drop-in replacement in /etc/systemd/system/transmission-daemon.service.d/local.conf:

[Service]
User=
User=pi
Group=pi

I ran sudo systemctl daemon-reload and sudo systemctl restart transmission-daemon. The drop-in is listed in sudo systemctl status transmission-daemon and shows as active nevertheless the daemon isn't running correctly and RPC connection doesn't work in a browser.

Thanks in advance if you help, because I'm fumbled.

  • Please check which user account the transmission-daemon process is actually running as (after you start it): ps auxww | grep transmission-daemon also, is there are any errors or warnings in the logs ? journalctl -u transmission-daemon --since today – zeppelin Oct 31 '16 at 10:09
  • Also do you really need this empty "User=" entry in your local.conf ? (should not break it, but still) – zeppelin Oct 31 '16 at 10:10
  • @zeppelin Just verified what was in original post, transmission-daemon runs as special user debian-transmission as described in the env USER /etc/init.d/transmission-daemon. No journal files found (due to the package using init.d?) The empty User= was removed but makes no difference. – thibmaek Nov 2 '16 at 1:02
  • Hmm, well, so it is still being started by the SystemV init script ? And systemd will try to launch a second instance of it (which explains why it does not work well). Please disable the init script with update-rc.d transmission-daemon disable, stop it /etc/init.d/transmission-daemon stop, verify that the process is not running with ps, and then start a systemd unit: systemctl start transmission-daemon, and see if it works (or at least produces some usable logs now). – zeppelin Nov 2 '16 at 10:43
  • You may also try to add --log-info to your ExecStart command, to make it produce a bit more detailed log. – zeppelin Nov 2 '16 at 10:44
0

Find the answer myself:

Systemd is not the problem since it runs the service correctly but when transmission-daemon runs as the pi user it reads the config from $HOME/.config/transmission-daemon/settings.json owned by pi:pi, instead of /etc/transmission-daemon/settings.json owned by debian-transmission:debian-transmission.

As a solution you can switch to using the config file in $HOME/transmission-daemon or pass -g /etc/transmission-daemon/settings.json in an ExecStart directive in the drop-in.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.