Installing Transmission on FreeBSD 7.1

Discussion of Transmission that doesn't fit in the other categories
Post Reply
Henk
Posts: 1
Joined: Wed Sep 09, 2009 8:15 pm

Installing Transmission on FreeBSD 7.1

Post by Henk »

Transmission and FreeBSD appear to have a different kind of logic. Files ended up in places I didn't want them too be. It took me a while to get it working. This post is for anyone strugling with it.

OS: FreeBSD 7.1-RELEASE
Transmission: 1.74 (8994)

After make + make install
Once I had done a make + make install in /usr/ports/net-p2p/transmission-daemon I found out:
  • The settings had been dropped in in /root/.config
  • An unprivileged user 'transmission' was created.
  • A directory /usr/local/etc/transmssion/home/ was created
To get things working I did the following:

Code: Select all

[/root>mkdir /usr/local/etc/transmission-daemon
This seems like a right spot for the config-files.

Code: Select all

[/root/>ln -s /usr/local/etc/ .config
In /root/ I created a symlink. When starting transmission-daemon without the -g option, the daemon can still find the config files and creates them if not present. The daemon adds the 'transmission-daemon' directory by itself.

Code: Select all

[/root/>cp /usr/ports/net-p2p/transmission-daemon/work/transmission-1.74/web/ /usr/local/share/transmission
Copied web interface files. For some reason the make-install hadn't installed them. I ran transmission-daemon -f, and connected with a web-browser on port 9091 to find out where the daemon looks for the web-files.

Code: Select all

[/root/>vi /etc/rc.conf
Add 'transmission_enable="YES"' to enable the daemon

The startup-script /usr/local/etc/rc.d/transmission suggests to put a few more options in rc.conf. I prefer to set them in the startup-script itself:
  • transmission_conf_dir="/usr/local/etc/transmission-daemon"
  • transmission_download_dir="/whereever/you/want/them/"
  • transmission_user="transmission"

Code: Select all

vi /usr/local/etc/transmission-daemon/settings.json
To get confirmed that the daemon reads the right config-files, I changed the port to 9092, and connected to http://192.168.1.2:9092
"rpc-port": 9092,

I added the IP I connect from to the whitelist. I Will be accessing transmission through Apache eventually, so this setting is for testing purposes only. In my case:
"rpc-whitelist": "127.0.0.1,192.168.*.*",

I disabled port-forwarding. I like to do things manually. Besides that, I don't' need it, with Apache in mind.
"port-forwarding-enabled": false,

For access from the outside world I will be using Apache 2.2 as a secure reversed proxy. 'WIll be using', because Apache and I still have a difference of opinion on how this should work ;-)
mezz
Posts: 142
Joined: Mon Apr 30, 2007 6:53 pm

Re: Installing Transmission on FreeBSD 7.1

Post by mezz »

Henk wrote:The settings had been dropped in in /root/.config
Shouldn't be happen. The default config files are storage in the $PREFIX/etc/transmission/home/. This is set by $PREFIX/etc/rc.d/transmission, you can view this file.
Henk wrote:An unprivileged user 'transmission' was created.
Correct.
Henk wrote:A directory /usr/local/etc/transmssion/home/ was created
Correct.
Henk wrote:

Code: Select all

[/root/>ln -s /usr/local/etc/ .config
In /root/ I created a symlink. When starting transmission-daemon without the -g option, the daemon can still find the config files and creates them if not present. The daemon adds the 'transmission-daemon' directory by itself.
It's already setup -g in the rc script by default. See in $PREFIX/etc/rc.d/transmission.
Henk wrote:

Code: Select all

[/root/>cp /usr/ports/net-p2p/transmission-daemon/work/transmission-1.74/web/ /usr/local/share/transmission
Copied web interface files. For some reason the make-install hadn't installed them. I ran transmission-daemon -f, and connected with a web-browser on port 9091 to find out where the daemon looks for the web-files.
Umm... Sounds like you need to run 'make clean' before you install transmission-daemon? The transmission-daemon depends on www/transmission-web by default. I am going to double check on this. If it doesn't happen then I will fix it as I might have broke it in previous version.
Henk wrote:

Code: Select all

[/root/>vi /etc/rc.conf
Add 'transmission_enable="YES"' to enable the daemon

The startup-script /usr/local/etc/rc.d/transmission suggests to put a few more options in rc.conf. I prefer to set them in the startup-script itself:
  • transmission_conf_dir="/usr/local/etc/transmission-daemon"
  • transmission_download_dir="/whereever/you/want/them/"
  • transmission_user="transmission"
Recommend to put options in rc.conf, because at the every upgrade you will have to edit the rc script again.
Henk wrote:

Code: Select all

vi /usr/local/etc/transmission-daemon/settings.json
To get confirmed that the daemon reads the right config-files, I changed the port to 9092, and connected to http://192.168.1.2:9092
"rpc-port": 9092,
You can edit port by add transmission_flags="-p 9092" in the rc.conf. But it's your choice.

I do not use transmission daemon, but I will test it again and see if everything is supposed to be.
Last edited by mezz on Sat Sep 12, 2009 7:31 pm, edited 1 time in total.
mezz
Posts: 142
Joined: Mon Apr 30, 2007 6:53 pm

Re: Installing Transmission on FreeBSD 7.1

Post by mezz »

mezz wrote:
Henk wrote:

Code: Select all

[/root/>cp /usr/ports/net-p2p/transmission-daemon/work/transmission-1.74/web/ /usr/local/share/transmission
Copied web interface files. For some reason the make-install hadn't installed them. I ran transmission-daemon -f, and connected with a web-browser on port 9091 to find out where the daemon looks for the web-files.
Umm... Sounds like you need to run 'make clean' before you install transmission-daemon? The transmission-daemon depends on www/transmission-web by default. I am going to double check on this. If it doesn't happen then I will fix it as I might have broke it in previous version.
Fixed and bump the PORTREVISION.
mezz
Posts: 142
Joined: Mon Apr 30, 2007 6:53 pm

Re: Installing Transmission on FreeBSD 7.1

Post by mezz »

I have tested in a clean jail with empty ports install and here is a result:
# pkg_info
<emtpy>
# grep trans /etc/passwd
<empty>
# ls -a /root | grep config
<empty>
# cd /usr/ports/net-p2p/transmission-daemon
# make depends
# pkg_info

ca_root_nss-3.11.9_2 The root certificate bundle from the Mozilla Project
curl-7.19.6_1 Non-interactive tool to get files from FTP, GOPHER, HTTP(S)
gettext-0.17_1 GNU gettext package
gmake-3.81_3 GNU version of 'make' utility
libiconv-1.13.1 A character set conversion library
libtool-2.2.6a Generic shared library support script
perl-5.8.9_3 Practical Extraction and Report Language
pkg-config-0.23_1 A utility to retrieve information about installed libraries
transmission-web-1.74 A fast and lightweight WebUI for Transmission BitTorrent cl
The transmission-web is installed now with the latest fix. Let's install transmission-daemon and just simply add transmission_enable="YES" in the /etc/rc.conf.
# pwd
/usr/ports/net-p2p/transmission-daemon
# make install
# grep trans /etc/passwd

transmission:*:921:921:Transmission Daemon User:/usr/local/etc/transmission/home:/usr/sbin/nologin
# ls /usr/local/etc/transmission/home
Downloads/
# echo 'transmission_enable="YES"' >> /etc/rc.conf
# grep trans /etc/rc.conf

transmission_enable="YES"
# /usr/local/etc/rc.d/transmission start
Starting transmission.
# ls -a /root | grep config
<empty>
# ls /usr/local/etc/transmission/home
Downloads/ blocklists/ resume/ torrents/
# transmission-remote -u 40
localhost:9091 responded: "success"
# /usr/local/etc/rc.d/transmission stop
Stopping transmission.
Waiting for PIDS: 28486.
# ls /usr/local/etc/transmission/home
Downloads/ resume/ stats.json
blocklists/ settings.json torrents/
# ls -a /root | grep config
<empty>
As you can see that it does not create /root/.config by default. I did make sure[1] for that before I put up a rc script for transmission-daemon. Did you run transmission-daemon by manual without use rc script or/and without -g flag to start it? If you did, then yes it will create $HOME/.config by default. If you don't then I am interesting to know how you did that, it is possible bug somewhere in script or else and I will hunting for it.

[1] http://trac.transmissionbt.com/ticket/2226
Post Reply