Skip to main content

HOWTO Configure a Headless Transmission Torrent Server for Mageia5

This will describe how to install and configure the Transmission torrent application on Mageia5 in a headless configuration, how to make it automatically download torrents by placing a .torrent file in a particular directory and admin the client remotely using both a cli (command line interface) and a GUI (graphical user interface) application.

Transmission has both a Homepage,  a Wiki and a Forum, so there's no lack of help and support. But as for installing it as a headless server on Mageia, all we found were HOWTOs for Debian/Ubuntu systems.


We're assuming that you have Mageia5 installed and have configured your user to use the sudo command.


INSTALL
Begin by installing the transmission daemon and the command-line client.

$ sudo urpmi transmission-daemon transmission-cli

This installs  transmission-daemon, transmission-cli and transmission-common (which is mostly the documentation). All the binaries will be found in /usr/bin. The transmission package also installs a Java-based web client at /usr/share/transmission/web/index.html.

CREATE A USER
For transmission-daemon, all settings are kept in $HOME/.config/transmission-daemon. We want to create a user named "transmission". Other distros make the "home" directory something like /usr/share/transmission or /var/lib/transmission; it can really be anything you want. For us, creating /home/transmission has a special benefit.

$ sudo adduser transmission
$ sudo passwd transmission


Having a password allows us to use scp to remotely send a .torrent file to /home/transmission/ on our remote server and the torrent will automatically start when we have properly configured the transmission-daemon to do so.

OBTAIN AN INIT.D SCRIPT
There is an Debian/ubuntu-specific init.d script available from the Transmission site, but it won't work for RedHat-derived distros like Mageia.

You can download an init.d script useful for RHEL and Fedora (and Mageia) written by Jason Friedlan. It's located at his website (his site has since disappeared, so the link is to the WaybckMachine). You'll need to copy and paste it into a text editor.

We'll need to make some changes for Mageia:

- TRANSMISSION_HOME=/var/lib/transmission
+ TRANSMISSION_HOME=/home/transmission

- DAEMON=$(which $NAME)
+ DAEMON=/usr/sbin/transmission-daemon

Save the script as transmission-daemon, change the ownership to root and make it executable, then move it it /etc/init.d.

$ sudo chown root:root transmission-daemon
$ sudo chmod +x transmission-daemon
$ sudo mv transmission-daemon /etc/init.d/


To verify that our script is valid for init.d invoke:

$ sudo chkconfig --add transmission-daemon

Now set the runlevels for transmission-daemon with:

$ sudo chkconfig --level 345 transmission-daemon on

and verify it with:

$ sudo chkconfig --list transmission-daemon

CREATE THE BASIC FILES
Now that our service is configured, let's start and stop the daemon to make certain it works.

$ sudo service transmission-daemon start
$ sudo service transmission-daemon stop


Then invoke:

$ sudo ls -al /home/transmission

This will reveal that the .config directory has been created and we will find that /home/transmission/.config/transmission/settings.json has also been created.

NOTE: With the current version of Transmission, you can only create the settings.json file by running transmission-gtk and a regular user. There does not appear to be a workaround for cli-only systems, so a local copy of the file I use is found here (sorry, NLA). You'll need to use your own PASSWORD and USERNAME.

CONFIGURE TRANSMISSION
The editable text file settings.json contains the default configuration for our daemon. It can be edited with a text editor and an explanation of the various options can be found at the Transmission Wiki.

NOTE: The current version of transmission-remote seems to have removed some functionality. I suggest you download the settings.json file I reference above and use it. You will need to edit it with the settings below and setting the username:password from the command line still works.

Some suggested changes are (the trailing commas are important!):

Add a blocklist:
- "blocklist-url": "http://www.example.com/blocklist",
+ "blocklist-url": "http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz",


Allow all users on the network to access the web interface:
- "rpc-whitelist": "127.0.0.1",
- "rpc-whitelist-enabled": true,

+ "rpc-whitelist": "*.*.*.*",
+ "rpc-whitelist-enabled": false,


Save the file and restart the service.

Setting a username and password to stop all users but us is important, but this must be done with the transmission-remote command because the password is hashed for security and not stored as plain-text.
$ su - transmission
$ transmission-remote --auth username:password


You can use the application transmission-remote to change any of the settings; look at the man page for details or at the Wiki page.

You'll need to set the home directory to auto-download any torrents. First, we'll need to enable it, then set the directory. As shown here, we'll do it on one line each:
$ su - transmission -c transmission-remote --watch-dir-enabled true
$ su - transmission -c transmission-remote --watch-dir /home/transmission


And, we'll have it keep downloaded torrents in /home/transmission/Downloads.
$ su - transmission  -c transmission-remote download-dir /home/transmission/Downloads

If you don't change a setting, transmission will use the default setting. You can see the default setting by examining the settings.json file or looking at the Wiki page referenced just above.

If you are GUI-centric and command-line-phobic, install the GTK or QT clients and as the user "transmission" use the transmission client GUI to change the settings. That's pretty easy.

NOW START TRANSMISSION
 $sudo service transmission-daemon start

  And you are ready to use it.

START TORRENTS AUTOMATICALLY

Instead of clicking on a torrent link, save the linked .torrent file instead and move it to the torrent user.

$sudo mv *.torrent /home/torrent/

NOTE: I scp the torrent file to my home directory on the remote machine that actually runs torrent-daemon and then use a crontab entry that runs every 15 minutes and moves the torrent file to /home/torrent, where it is started automatically. Of course, using the authorized keys function for ssh is necessary to fully automate this procedure, but it works quite well.

Now the download starts automatically! You can even do this from a remote computer, so if your server is at home and you are at work, just copy the .torrent file over the Internet and the download will be done by the time you get home.

To admin your Transmission server, there's the provided Java web client, or a stand-alone application called
FEEDBACK
As always, I'd appreciate any feedback, especially if I made any errors in this.

Over a thousand views and no feedback. Did you find this helpful or not?

Comments

Popular posts from this blog

DOS4GW.EXE Version 2.01a and Alternative DOS Extenders

DOS4GW.EXE The Tenberry DOS extender DOS4GW.EXE was used by many early DOS games. I still enjoy playing many of these games and DOS4GW.EXE is usable with DOSBox , so they can be played on Linux. However, the version of DOS4GW.EXE that was included with the game was whatever was current at the time. The most recent version that includes many bugfixes that possibly affected the games when used with DOSBox have been fixed in the latest version, 2.01a. It's not free at US$49, but you can downloaded it here . Simply substitute it for whatever version of DOS4GW.EXE your game provided and enjoy the bug-fixed goodness. Tenberry also makes a "high-performance" "pro" version of DOS4GW.EXE, but it costs $300. I think that they could sell quite a few of these to hobby users (since, you know, DOS is dead) for US$5. Open Souce to the Rescue There are better performing, free and Open Source alternatives available and worth a look. DPMI Explained Let's unders...

Return to Castle Wolfenstein for Modern Linux

Return to Castle Wolfenstein is a first-person shooter originally released on November 19, 2001. The game, like many other classic games, is available at GOG.com and costs only US$5.99. iortcw for Linux Don't bother with old and crusty Linux binaries offered by idsoft; they are problematic and it's painful to use them on a modern Linux. Fortunately for us, there are more modern GPL-licensed Linux binaries available for 32- and 64-bit systems as well as high resolution textures packages. The project at GitHub provides source code that can also be compiled for MS Windows using MinGW. iortcw for Windows and Mac You can download pre-compiled binaries for 32- and 64-bit Linux, MS Windows and Mac from here . Let's put our files in /usr/local/games/rtcw . As root, extract the downloaded .ZIP file for your architecture to  /usr/local/games/rtcw . All we are missing are the game data files. I purchased them from GOG.com. The game installer downloaded from GOG.com can be ...

Unreal Tournament GOTY/UT99 for Modern Linux

Released on November 16, 1999, Unreal Tournament (also known as UT99) is an arena first-person shooter for Multiplayer on-line competition or you can play against bots off-line. It features several game types, with more details provided at Wikipedia . The game was re-released on February 25, 2000 as Unreal Tournament Game of the Year Edition (GOTY) which included the three bonus packs released previously and additional mods, or game modifiers that had become popular. It is the GOTY version that is available from STEAM or  GOG.com . The GOG version for Windows installs in Linux and plays well using WINE , PlayOnLinux or Codeweaver's Crossover . There is a Linux binary available in two versions, one for the original game and one for the GOTY edition . Also provided at that site is the Official Bonus Pack with a Linux installer. All these Linux installers are created with makeself . There are some issues using such a crusty old Linux binary. Let's see why getting...