If you use transmission-daemon on your Raspberry Pi and want to have logs to a file, you can follow a few simple steps to accomplish this:
Edit the service file:
1 |
sudo vim /lib/systemd/system/transmission-daemon.service |
Change the ExecStart line to look like this:
1 |
ExecStart=/usr/bin/transmission-daemon -f --log-debug --logfile /var/log/transmission.log |
You can choose between these options:
1 2 3 4 5 6 7 8 |
--log-error Show error messages --log-info Show error and info messages --log-debug Show error, info, and debug messages |
systemctl will complain that the service file was changed. Run:
1 |
sudo systemctl daemon-reload |
to reload units.
Create the log file and assign the correct ownership and permissions:
1 2 3 |
sudo touch /var/log/transmission.log sudo chown debian-transmission /var/log/transmission.log sudo chmod 644 /var/log/transmission.log |
Restart the service:
1 |
sudo service transmission-daemon restart |
Have fun!
Thank you! I got the daemon service file updated but for the life of me couldn’t get the log writing. I knew I needed to change the owner but didn’t know what to. Appreciate the instructions 🙂
It’s midnight so after working on this all day, I’ll have to try to see if this works tomorrow. I am assuming you tried to add this to the /etc/default/transmission-daemon because I can’t make it work there:
# defaults for transmission-daemon
# sourced by /etc/init.d/transmission-daemon
# Change to 0 to disable daemon
ENABLE_DAEMON=1
# This directory stores some runtime information, like torrent files
# and links to the config file, which itself can be found in
# /etc/transmission-daemon/settings.json
#CONFIG_DIR=”/srv/dev-disk-by-id-usb-ST5000DM_000-1FK178_235678E30D27-0-0-part2/transmission”
CONFIG_DIR=”/mnt/Media/transmission”
# Default options for daemon, see transmission-daemon(1) for more options
#OPTIONS=”–config-dir $CONFIG_DIR”
OPTIONS=”–config-dir $CONFIG_DIR –log-info –logfile /mnt/Media/logs/transmission.log”
# (optional) extra options to start-stop-daemon
The option can be added to whatever service manager your distribution uses.
In my case it was systemd, but for your case you need to edit the relevant init.d script.
Just make sure the user transmission is running under has privileges to write on that folder.