OmniOS: How to Install TransmissionBT

Compilation and install: steps required and solving issues

This article is part of a series focused on the building and setup of a home-NAS based on ZFS and OmniOS. The index is located here: An OmniOS ZFS Fileserver.

Having a server or a NAS always-on and not offloading the different computers from the longest tasks makes no sense, so I decided to install on my OmniOS box one of the most lightweight torrent clients available, TransmissionBT. Other very light clients exist, for example btpd, but I decided to go for a very common one, one I already used under OS X and under NAS4free. Even if btpd could be easier to compile, the web interface seems to be better on Transmission.


This post has been written after finishing the whole procedure, so some steps may be incorrectly reported. It should be fine but in case of problems just drop me an email or write a commentary.

In any case, feel free to use the latest packages instead of the versions I used.

The first step is to install the development packages as described in the official guide.

Transmission uses packages not available on the standard OmniOS repository, I had first to add the inofficial repositories OmniTI provided:

$ pfexec pkg set-publisher -g

$ pfexec pkg install developer/gcc48
$ pfexec pkg install compress/xz
$ pfexec pkg install omniti/library/libevent
$ pfexec pkg install text/gnu-gettext
$ pfexec pkg install library/perl-5/xml-parser
$ export PATH=/usr/gnu/bin:/opt/gcc-4.8.1/bin:$PATH:/usr/local/bin

$ wget
$ tar xf intltool-0.40.6.tar.bz2
$ cd intltool-0.40.6
$ ./configure
$ make
$ pfexec make install
$ cd ..

$ wget
$ tar xf pkg-config-0.28.tar.gz
$ cd pkg-config-0.28
$ ./configure --with-internal-glib
$ make
$ pfexec make install
$ cd ..

I need no native graphical interface, only the daemon running in background and the web interface accessible from every computer of the local network, so I disabled everything else:

$ wget
$ tar xf transmission-2.77.tar.xz
$ cd transmission-2.77
$ ./configure --enable-utp --enable-nls --enable-daemon --disable-cli --with-gtk=NO LIBEVENT_CFLAGS=-I/opt/omni/include LIBEVENT_LIBS="-L/opt/omni/lib -levent"

Transmission was compiling correctly but couldn't run due to a library missing at runtime:

$ ./daemon/transmission-daemon --help transmission-daemon: fatal: open failed: No such file or directory
$ ldd ./daemon/transmission-daemon =>    /lib/ =>     (file not found) =>  /usr/lib/ =>       /lib/ =>    /lib/ =>       /usr/lib/ =>   /lib/ =>        /lib/ =>     /lib/ =>       /lib/ =>     /lib/ =>  /usr/lib/ =>  /usr/lib/ =>         /usr/lib/ =>    /lib/ =>    /lib/ =>  /usr/lib/ =>   /usr/lib/mps/ =>    /usr/lib/mps/ =>    /usr/lib/mps/ =>    /usr/lib/mps/ =>    /lib/ =>        /usr/lib/mps/ =>   /usr/lib/mps/ =>        /lib/
$ ls /usr/local/lib/libevent                               

So the library is there, but it cannot be found. The solution is to use the previously to me unknown tool crle that sets search paths for libraries. I tried:

$ crle

Default configuration file (/var/ld/ld.config) not found
  Platform:     32-bit LSB 80386
  Default Library Path (ELF):   /lib:/usr/lib  (system default)
  Trusted Directories (ELF):    /lib/secure:/usr/lib/secure  (system default)

So I added the required path and everything went fine:

$ pfexec crle -l /lib:/usr/lib:/usr/local/lib
$ crle

Configuration file [version 4]: /var/ld/ld.config  
  Platform:     32-bit LSB 80386
  Default Library Path (ELF):   /lib:/usr/lib:/usr/local/lib
  Trusted Directories (ELF):    /lib/secure:/usr/lib/secure  (system default)

Command line:
  crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib

However, keep in mind what could go bad and how to solve it.

Installation and permissions

I don't want Transmission to be able to access my personal data, since a bug may cause their deletion or a security hole could lead to someone else see them, so I created a new "transmis" user with a separate home folder ("/var/transmission-daemon") and with no shell ("/bin/false") for the daemon to access his own configuration files and I put him also in the "temps" user group, so that it can only read files marked public or only files located in the Temporary share of the server (see OmniOS: Installation and Basic Setup for details on the user and directory structure I used).

$ pfexec mkdir /var/transmission-daemon
$ pfexec groupadd -g 402 transmis
$ pfexec useradd -g 402 -G temps -u 402 -d /var/transmission-daemon -s /bin/false transmis
$ pfexec chown transmis:root /var/transmission-daemon

To avoid confusion, I created a subfolder in the Temporary directory and I set it as both "watched" folder and as download folder for the daemon, so that torrent files start automatically as soon as they are copied in it. Downloaded files also will be found in the same folder and will keep a ".part" extension during download. The configuration for the daemon has to be edited manually and the following lines should be changed directly in the "settings.json" file, while everything else can be left with default values or set via the web interface:

    "download-dir": "/tank/Temporary/Torrents/",
    "incomplete-dir": "/tank/Temporary/Torrents",
    "incomplete-dir-enabled": false,
    "rename-partial-files": true,
    "rpc-whitelist": ",10.0.0.*",
    "rpc-whitelist-enabled": true,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 2,
    "watch-dir": "/tank/Temporary/Torrents/",
    "watch-dir-enabled": true

The "incomplete-dir" was disabled because I want the files directly in the final location and I want incomplete files just to be renamed ("rename-partial-files" active). The "rpc-whitelist" was enabled and set so that computers on the local network are allowed to access the web interface. Since I enabled the "watch-dir" I also want downloads to start automatically: the torrent end up in the watched folder only after manual copy, not by mistake.
An important setting is "umask" because it determines the reading permissions of the downloaded files. I want them to be readable by creator and by the group, so I set "2" that means "rw-rw----". I know that the group will be set correctly thanks to the directory ACL set in OmniOS: Installation and Basic Setup.

The only thing left is the automatic start of the daemon at boot. I wanted to use the native SMF Solaris (and derivatives) method, so I found and transmission-daemon.xml, written by another user ("Wonk"). Since the original website is gone and I changed some parameters in the files, I will host them.
The installation is simple: put the files in a folder, then change to that one and give:

$ pfexec cp /lib/svc/method/
$ pfexec cp transmission-daemon.xml /var/svc/manifest/site/
$ pfexec svccfg -v import -V /var/svc/manifest/site/transmission-daemon.xml

Update 2015-08-15

After changing some permissions, I found that Transmission was not able to create files inside the download folder anymore.

The issue was solved by setting the following permissions:

$ ls -lVa /tank/Temporary/Torrents/
drwxrws---+  4 transmis temps          4 Aug 15 20:58 .
d-----S---+ 25 root     temps        166 Aug  9 20:40 ..

Author: Olaf Marzocchi

First revision: 2013-04-14.
Last revision: 2015-08-15.