Transmission Headless + Debian 6 + Block list auto update

Discussion of Transmission that doesn't fit in the other categories
Post Reply
dgibbs
Posts: 15
Joined: Sat Jul 09, 2011 7:39 pm

Transmission Headless + Debian 6 + Block list auto update

Post by dgibbs »

Hello All,

As a project on the weekend I am trying to setup a headless transmission server on Debian with automated blocklist updating.

I am doing this to replace my Win 7 utorrent + peerblock setup which is not as streamlined as I like. After doing a bit of research Transmission seems to be the best option for this.

I have installed debian with transmission-daemon and transmission-cli and got the webinterface all up and running so far.

However my issue is with getting the blocklist to auto update. I have found the command

Code: Select all

/usr/bin/transmission-remote --blocklist-update
floating around the internet however I cannot seem to get it to work. All I get is

Code: Select all

root@tracker.example.com:/var/lib/transmission-daemon/info# /usr/bin/transmission-remote  --blocklist-update
localhost:9091 responded: "http error 404: Not Found
Any ideas on why im getting this and how to fix this.

Thanks

btw im supprises there isnt a linux specific forum on here.
gunzip
Posts: 272
Joined: Wed May 05, 2010 2:12 am

Re: Transmission Headless + Debian 6 + Block list auto updat

Post by gunzip »

try this:

1) STOP transmission-daemon, then edit settings.json

Code: Select all

"blocklist-enabled": true, 
"blocklist-url": "http://www.bluetack.co.uk/config/level1.gz",
2) START transmission-daemon

3) then issue transmission-remote --blocklist-update command as before

you should see something in log file like 'Blocklist "blocklist.bin" updated with 220288 entries' . that's it.

btw, the blocklist-url is user-specified and above is typical example.
dgibbs
Posts: 15
Joined: Sat Jul 09, 2011 7:39 pm

Re: Transmission Headless + Debian 6 + Block list auto updat

Post by dgibbs »

Thanks. However I had already set the blocklist up which this configuration. I tried it again anyway however still got the same error.

Code: Select all

root@tracker.example.com:/var/lib/transmission-daemon/info# transmission-remote --blocklist-update
localhost:9091 responded: "http error 404: Not Found"
the error appears to be moaning that it cannot see the web interface. However when I browse to it using

Code: Select all

lynx localhost:9091
it responds.

I have also tried

transmission-remote --auth [username]:[password] --blocklist-update

as I have seen this used as well. But still the same error.


Below is my current config

/var/lib/transmission-daemon/info/settings.json

Code: Select all

{
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": true,
    "blocklist-url": "http://www.bluetack.co.uk/config/level1.gz",
    "dht-enabled": true,
    "download-dir": "//Downloads",
    "download-limit": 100,
    "download-limit-enabled": 0,
    "encryption": 1,
    "incomplete-dir": "//Downloads",
    "incomplete-dir-enabled": false,
    "lazy-bitfield-enabled": true,
    "lpd-enabled": false,
    "max-peers-global": 200,
    "message-level": 2,
    "open-file-limit": 32,
    "peer-limit-global": 240,
    "peer-limit-per-torrent": 60,
    "peer-port": 51413,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 49152,
    "peer-port-random-on-start": false,
    "peer-socket-tos": 0,
    "pex-enabled": true,
    "port-forwarding-enabled": true,
    "preallocation": 1,
    "proxy": "",
    "proxy-auth-enabled": false,
    "proxy-auth-password": "",
    "proxy-auth-username": "",
    "proxy-enabled": false,
    "proxy-port": 80,
    "proxy-type": 0,
    "ratio-limit": 2.0000,
    "ratio-limit-enabled": false,
    "rename-partial-files": true,
    "rpc-authentication-required": false,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "{90303c785f39ec8098b317cba328dc4f82f0de62kCohBaWm",
    "rpc-port": 9091,
    "rpc-username": "",
    "rpc-whitelist": "127.0.0.1",
    "rpc-whitelist-enabled": false,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "speed-limit-down": 100,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 100,
    "speed-limit-up-enabled": false,
    "speed-limit-up": 100,
    "speed-limit-up-enabled": false,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 18,
    "upload-limit": 100,
    "upload-limit-enabled": 0,
    "upload-slots-per-torrent": 14
}

I have also noticed that transmission overwrites my config if I restart the daemon using

/etc/init.d/transmission-daemon restart
or
/etc/init.d/transmission-daemon stop
/etc/init.d/transmission-daemon start
gunzip
Posts: 272
Joined: Wed May 05, 2010 2:12 am

Re: Transmission Headless + Debian 6 + Block list auto updat

Post by gunzip »

dgibbs, you have to completely stop (kill) the daemon BEFORE trying to edit settings.json or the changes won't persist .. which seems to be source of all your problems. simply restarting it won't work.

Code: Select all

# /etc/init.d/transmission-daemon stop

# killall transmission-daemon

check to make sure daemon is killed:

# ps aux | grep transmission
after doing above, then edit settings.json
dgibbs
Posts: 15
Joined: Sat Jul 09, 2011 7:39 pm

Re: Transmission Headless + Debian 6 + Block list auto updat

Post by dgibbs »

I have tried this but still the same error.

Here is exactly what I have typed

Code: Select all

root@tracker.example.com:/# /etc/init.d/transmission-daemon stop
Stopping bittorrent daemon: transmission-daemon.
root@tracker.example.com:/#  killall transmission-daemon
transmission-daemon: no process found
root@tracker.example.com:/# ps aux | grep transmission
root      2176  0.0  0.2   7544   816 pts/0    S+   11:50   0:00 grep transmission
root@tracker.example.com:/# nano /var/lib/transmission-daemon/info/settings.json
root@tracker.example.com:/# /etc/init.d/transmission-daemon start
Starting bittorrent daemon: transmission-daemon.
root@tracker.example.com:/# transmission-remote --blocklist-update
localhost:9091 responded: "http error 404: Not Found"
gunzip
Posts: 272
Joined: Wed May 05, 2010 2:12 am

Re: Transmission Headless + Debian 6 + Block list auto updat

Post by gunzip »

do you happen to be running an old version of transmission-daemon? i have latest 2.32 and this works flawlessly in Debian 6.

i do recall a debian bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=579304 that caused user changes to be ignored, but that has been fixed in all recent versions.
dgibbs
Posts: 15
Joined: Sat Jul 09, 2011 7:39 pm

Re: Transmission Headless + Debian 6 + Block list auto updat

Post by dgibbs »

Code: Select all

root@tracker.example.com:~# dpkg -l|grep transmission
ii  transmission                        2.03-2                       lightweight BitTorrent client
ii  transmission-cli                    2.03-2                       lightweight BitTorrent client (command line interface)
ii  transmission-common                 2.03-2                       lightweight BitTorrent client (common files)
ii  transmission-daemon                 2.03-2                       lightweight BitTorrent client (daemon)
ii  transmission-gtk                    2.03-2                       lightweight BitTorrent client (GTK interface)

I think that may be the problem. Looks like im running an old version. This is the version in the Debian repositories.

http://packages.debian.org/search?searc ... ansmission

Code: Select all

root@tracker.example.com:~# cat /etc/apt/sources.list
# deb http://ftp.uk.debian.org/debian/ squeeze main

deb http://ftp.uk.debian.org/debian/ squeeze main
deb-src http://ftp.uk.debian.org/debian/ squeeze main

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

# squeeze-updates, previously known as 'volatile'
deb http://ftp.uk.debian.org/debian/ squeeze-updates main
deb-src http://ftp.uk.debian.org/debian/ squeeze-updates main
Do you know if the newer version is in another Debian repository or will I have to add a third party repository?
gunzip
Posts: 272
Joined: Wed May 05, 2010 2:12 am

Re: Transmission Headless + Debian 6 + Block list auto updat

Post by gunzip »

well that bug was fixed in version 1.93-2 so your present version 2.03 should be OK.

the real difference is i compile from source package here on transmissionbt.com site so i don't get the init scripts -- those are done by the debian package maintainers.

i think you may in fact be editing the wrong settings.json file (there may be more than one). look at

/etc/transmission-daemon/settings.json

that should exist if you installed via apt-get , and it is the one that really controls the daemon settings.

ref: http://packages.debian.org/squeeze/i386 ... n/filelist
dgibbs
Posts: 15
Joined: Sat Jul 09, 2011 7:39 pm

Re: Transmission Headless + Debian 6 + Block list auto updat

Post by dgibbs »

Looks like the file im editing is a symbolic link to that file. They are both matching and are the same

Code: Select all

root@tracker.example.com:~# ls -al /var/lib/transmission-daemon/info/settings.json
lrwxrwxrwx 1 root root 38 Jul  9 19:53 /var/lib/transmission-daemon/info/settings.json -> /etc/transmission-daemon/settings.json

Code: Select all

root@tracker.example.com:/# locate settings.json
/etc/transmission-daemon/settings.json
/var/lib/transmission-daemon/info/settings.json
gunzip
Posts: 272
Joined: Wed May 05, 2010 2:12 am

Re: Transmission Headless + Debian 6 + Block list auto updat

Post by gunzip »

i temporarily did an "apt-get install" to get same version 2.03 as you, and i'm seeing same ""http error 404: Not Found" as you. apparently, at one time Transmission hosted a blocklist on their server, so issuing t-r --blocklist-update would download and install it. but since 2.12 the blocklist-url is user specified, which is not supported in 2.03 .. hence the 404 not found error.

still i was able to get the blocklist running manually in 2.03 by these steps:

Code: Select all


/etc/init.d/transmission-daemon stop
cd /var/lib/transmission-daemon/info/blocklists/
wget http://www.bluetack.co.uk/config/level1.gz
gunzip level1.gz
/etc/init.d/transmission-daemon start

ls -l /var/lib/transmission-daemon/info/blocklists/
total 13848
-rw-r--r-- 1 root                root                12356119 2011-07-10 00:22 level1
-rw-r--r-- 1 debian-transmission debian-transmission  1800440 2011-07-10 12:50 level1.bin

then in /var/log/syslog:

Blocklist "level1.bin" updated with 225055 entries (blocklist.c:365)
Blocklist "level1.bin" contains 225055 entries (blocklist.c:108)
Found 1 new blocklists in "/var/lib/transmission-daemon/info/blocklists" (session.c:1971)
transmission-daemon[10245]: Transmission 2.03 (11030) started (session.c:622)
of course all this would be much simpler once you upgrade to a more recent version.
dgibbs
Posts: 15
Joined: Sat Jul 09, 2011 7:39 pm

Re: Transmission Headless + Debian 6 + Block list auto updat

Post by dgibbs »

O nice thanks. I will give this a try tomorrow and let you know how I get on. I did find a script that should do what you did automaticly. So I will have a play with that as well. I guess this feature wont work on Debian until they update the repository or compile from source.
dgibbs
Posts: 15
Joined: Sat Jul 09, 2011 7:39 pm

Re: Transmission Headless + Debian 6 + Block list auto updat

Post by dgibbs »

Just an update. I found this script while searching (I cannot remember the site I got it from. If you know please post below)

Code: Select all

#!/bin/bash

# blocklist directory
BLOCKLISTDIR=/var/lib/transmission-daemon/info/blocklists

cd ${BLOCKLISTDIR}
if [ $? -eq 0 ]; then
  if [ -f level1 ]; then
    rm level1
  fi
  # if no blocklist file exist update blocklist
  if [ ! -f level1 ]; then
    wget -q -O level1.gz http://www.bluetack.co.uk/config/level1.gz
    # if download successful unzip it
    if [ -f level1.gz ]; then
          gunzip level1.gz
          # if file extracted successfully reload transmission
          if [ $? -eq 0 ]; then
            chmod go+r level1
            /etc/init.d/transmission-daemon reload
          else
                rm -f level1*
          fi
        fi
  fi
  cd - 2>&1 >/dev/null
fi
It automaticly updatesthe blocklists. chmod +x the script and add it to a cronjob to update when you want (mine is once a day) and it will automaticly update the block list.

When Debian is updates its version of transmission I would recommend using the official method. But as a temporary fix I think this is pretty good.
Post Reply