On Sb, 15 feb 14, 12:45:43, Antoine Beaupré wrote:
> 
> This works!
> 
> Here's the modified service file: 
> 
> [Unit]
> Description=Transmission BitTorrent Daemon
> After=network.target
> 
> [Service]
> User=debian-transmission
> Type=simple

Type=notify would be even better, see
https://trac.transmissionbt.com/ticket/4503 for more info.

> #EnvironmentFile=-/etc/default/transmission-daemon
> ExecStart=/usr/bin/transmission-daemon -f --log-error
> 
> [Install]
> WantedBy=multi-user.target
> 
> Notice how I *don't* import the environment from the existing defaults
> file, which is a shame because we loose some settings, but this is
> unavoidable because --config-dir really breaks everything.
> 
> Maybe there would be a way to still import $OPTIONS from the defaults
> yet override the --config-dir somehow to fix those problems?
> 
> Anyways, it would be nice to have a clean upgrade path here. :)

The package /etc/default/transmission file only has three variables, so 
it's probably doable to just work based on their values. I'll try to 
write something that looks like shell :p

# since both sysv-rc and systemd will try to start the daemon by default
# we only need to disable it if the user changed the default value
if [ 0 = $ENABLE_DAEMON ];
then
    update-rc.d disable $DAEMON
fi

# migrate to new location in the home of the transmission user
if [ "/var/lib/transmission-daemon/info" = $CONFIG_DIR ] && [ "--config-dir 
$CONFIG_DIR" = $OPTIONS ] $$ [ -z $START_STOP_OPTIONS ];
then
    mv $CONFIG_DIR $NEW_CONFIG_DIR
    rm -f /etc/default/transmission
else
    # the admin customised things here, we should not try to guess
    # further and just let him deal with the migration
    display big fat warning that further settings in 
    /etc/default/transmission will be ignored
fi


It would probably also be a good ideat to consider renaming the 
debian-transmission user to _transmission as per discussions on -devel, 
especially since _transmission is also quite long. AFAICT the most 
recent thread starts at 
http://lists.debian.org/a2a20ec3b8560d408356cac2fc148e53b1dea...@sun-dag3.synchrotron-soleil.fr

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt

Attachment: signature.asc
Description: Digital signature

Reply via email to