Setting up a headless torrent daemon in FreeBSD

I have FreeBSD running as a home server for a while now. One of the things I wanted the server to take care of is downloading torrents, so I could shut down my PC whenever I am downloading stuff.

With transmission-daemon (net-p2p/transmission-daemon from ports) this is really simple.

To install:

cd /usr/ports/net-p2p/transmission-daemon && make install clean

To fire up:

/usr/local/etc/rc.d/transmission onestart

or add transmission_enable=YES to your /etc/rc.conf and run /usr/local/etc/rc.d/transmission start

There's a few gotcha's, though:

The settings file transmission uses lives in /usr/local/etc/transmission/home/settings.json. This file is overwritten by transmission on startup, so that isn't the place to put your custom configurations. After doing a bit of reading of the rc script (/usr/local/etc/rc.d/transmission), I found out that the easiest way to configure transmission-daemon for your needs is editing your /etc/rc.conf and adding a transmission_flags var. This var is passed as parameters to transmission-daemon, so check out transmission-daemon --help for available options.

My transmission rc config looks like this (in /etc/rc.conf):

transmission_flags="-a 192.168.178.*,127.0.0.* --incomplete-dir /var/spool/transmission -w /srv/files/download -e /var/log/transmission.log" --paused

I have created the necessary files and folders with the transmission user and group as the owner. As root:

install -d {/var/spool/transmission,/srv/files/download} -g transmission -u transmission -m 644
touch /var/log/transmission.log && chown transmission:transmission /var/log/transmission.log

As always, you need to restart the daemon after changing settings, so call /usr/local/etc/rc.d/transmission restart after doing your modifications to /etc/rc.conf.

Of course you need to make sure the drives the directories live in have enough space left, or you might run into some weird results.

Happy torrenting :)

Read the original post & comments

< Return to main page

You're looking at a very minimalistic archived version of this website. I wish to preserve to content, but I no longer wish to maintain Wordpress, nor handle the abuse that comes with that.