Systemd service script for daemon doesn't use /etc/default/transmission-daemon

Bug #1559739 reported by Miika Hänninen
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
transmission (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Description: Ubuntu 15.10
Release: 15.10

transmission-daemon:
  Installed: 2.84-1ubuntu1
  Candidate: 2.84-1ubuntu1
  Version table:
 *** 2.84-1ubuntu1 0
        500 http://fi.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
        100 /var/lib/dpkg/status

Expected:
Changing CONFIG_DIR in /etc/default/transmission-daemon, causes the daemon to use that directory for its configuration and runtime folders.

What happened instead:
Whatever value CONFIG_DIR had, transmission-daemon acted as if it was the default ('/var/lib/transmission-daemon/info').

I was finally able to fix this by adding 'EnvironmentFile=/etc/default/transmission' into the service file and changing the name of CONFIG_DIR to TRANSMISSION_HOME in /etc/default/transmission. I tried adding $OPTIONS to the command line in the service file instead (as the older startup scripts do) but apparently systemd doesn't support substitution in the environment file.
This enables specifying the configuration directory, and shouldn't break the older scripts.

Btw, having three init scripts is kind of confusing.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in transmission (Ubuntu):
status: New → Confirmed
Revision history for this message
Lucas Clemente Vella (lvella-gmail) wrote :

How do I submit a patch?

Revision history for this message
Justin Alcorn (3-justin) wrote :

The fact that the systemd unit file has command line parameters set and no way to override them should be fixed. The simplest way to fix this is to add to /lib/systemd/system/transmission-daemon

EnvironmentFile=/etc/default/transmission-daemon

Change the ExecStart to

ExecStart=/usr/bin/transmission-daemon -f --error-log $OPTIONS

And add

TRANSMISSION_HOME=$CONFIG_DIR

to /etc/default/transmission-daemon

Revision history for this message
George Law (9n01bo-q7sdgm-bc94vy) wrote :

Still an issue in 20.04
The $CONFIG_DIR variable is not getting rendered properly but if I hardcode everything in OPTIONS it works properly

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.