PDA

Bekijk de volledige versie : [Howto] Install recent version of Transmission for Oleg firmware



ecaddict
15-09-2011, 15:43
If you've installed the image kindly created by raas directly or indirectly using my tutorial (http://wl500g.info/showthread.php?t=23684) you may have noticed that the Transmission version is quite old by now and the latest one has to be installed differently.

This tutorial helps you in that. In fact it's sufficient to run only a script that does everything for you:

#!/bin/sh
#written by ecaddict, distributed (conveyed) under GPL version 3 or any later version

BASE="/mnt/protected/Downloaders/Transmission"
CONFD="/opt/etc/transmission"
CONFF="${CONFD}/settings.json"
INITF="/opt/etc/init.d/S60transmission"
EBDIR="`echo ${BASE} | /bin/sed 's#/#\\\\/#g'`"

killall transmission-daemon
ipkg update
ipkg install openssl libcurl libevent zlib transmission
ln -s /opt/share/transmission /mnt/transmission
mkdir -p ${CONFD}
mkdir -p ${BASE}
mkdir -p ${BASE}/done
mkdir -p ${BASE}/work
mkdir -p ${BASE}/source

#check https://trac.transmissionbt.com/wiki/EditConfigFiles for config options
cat > ${CONFF} << __EOF__
{
"alt-speed-enabled": false,
"alt-speed-time-begin": 1080,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": true,
"alt-speed-time-end": 1320,
"alt-speed-up": 100,
"alt-speed-down": 600,
"blocklist-enabled": 1,
"cache-size-mb": 8,
"download-dir": "${EBDIR}\/done",
"incomplete-dir": "${EBDIR}\/work",
"incomplete-dir-enabled": true,
"watch-dir": "${EBDIR}\/source",
"watch-dir-enabled": true,
"encryption": 1,
"max-peers-global": 100,
"peer-port": 65534,
"pex-enabled": 1,
"port-forwarding-enabled": 1,
"rpc-authentication-required": false,
"rpc-password": "",
"rpc-bind-address": "192.168.1.1",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "",
"rpc-whitelist": "127.0.0.1,192.168.1.*",
"rpc-whitelist-enabled": false,
"speed-limit-down": 1200,
"speed-limit-down-enabled": true,
"speed-limit-up": 200,
"speed-limit-up-enabled": true,
"ratio-limit" : 5,
"ratio-limit-enabled": true
}
__EOF__

cat > ${INITF} << __EOF__
#!/bin/sh
#written by ecaddict, distributed (conveyed) under GPL version 3 or any later version

CONFD=${CONFD}
CONFF=\${CONFD}/settings.json
OPTIONS="-g \${CONFD} -e /opt/var/log/transmission"
NAME=transmission
EXEC=/opt/bin/\${NAME}-daemon

checkcnfg() {
if ! [ -x "\${EXEC}" ]; then
echo \${NAME} "\${EXEC} not found."
exit 1
fi
if ! [ -r "\${CONFF}" ] ; then
echo "\${NAME} cannot find readable config \${CONFF}"
exit 2
fi
}

d_start() {
checkcnfg
export TRANSMISSION_WEB_HOME='/opt/share/transmission/web/'
\${EXEC} \${OPTIONS}
}

d_stop() {
killall transmission-daemon
}

case "\$1" in
start)
echo "Starting \$NAME"
d_start
echo "."
;;
stop)
echo "Stopping \$NAME"
d_stop
echo "."
;;
restart|force-reload)
echo "Restarting \$NAME"
d_stop
sleep 2
d_start
echo "."
;;
*)
echo "Usage: \$0 {start|stop|restart|force-reload}" >&2
exit 3
;;
esac

exit 0
__EOF__
chmod u+x ${INITF}

cd /opt/etc/lighttpd/ && [ ! -f lighttpd.conf.old ] && cp lighttpd.conf lighttpd.conf.old
sed -i 's/^#\(.*"mod_rewrite",\).*/\1/' lighttpd.conf

if [ -z "`sed -n 's/\/transmission\/rpc/&/p' lighttpd.conf`" ]; then
cat >> lighttpd.conf << __EOF__
url.rewrite-once += ( "^/transmission[/]?\$" => "/transmission/web" )
\$HTTP["url"] =~ "^/transmission/rpc" {
proxy.server = (
"" => (
(
"host" => "192.168.1.1",
"port" => 9091
)
)
)
}
__EOF__
fi

/opt/etc/init.d/S80lighttpd restart
/opt/etc/init.d/S60transmission start
ps afx | grep transmission-daemon


So what does it do?
Creates the Transmission config file:
/opt/etc/transmission/settings.json
Creates the starter script:
/opt/etc/init.d/S60transmission

It also creates couple of directories in /mnt/protected/Downloaders/Transmission/ (should they not exist already).

It also has to modify the lighttpd.conf file as it probably does not have the mod_rewrite module enabled and for almost sure it's missing the proxy function for transmission port (9091), which is required if you'd like to access it remotely via lighttpd (like I prefer via https instead of opening 9091 port on the firewall) .
Don't worry, the old version is saved during the first run as /opt/etc/lighttpd/lighttpd.conf.old should anything go wrong.
The script also restarts lighttpd and starts transmission.

If everything goes fine you can access it from LAN via:
http://192.168.1.1:9091
or
https://192.168.1.1/transmission/
or whatever port and transport you use with your web server.
From internet you can access it either via VPN (if you've installed it) the same way or using your public (WAN) IP address and https.

The configuration file contains reasonable parameters (like lowering the bandwidth used during the evening where usually traffic peaks so being nice with others) and watch directory etc.
If you feel, however you can adjust it based on the following link:
https://trac.transmissionbt.com/wiki/EditConfigFiles
or using the GUIs.
If you change the settings.json file directly don't forget to stop Tranmission before saving it as when Transmission exits it overwrites the config file.

While the built in web interface of Transmission is nice it's certainly lacking compared to Transmission remote GUI (not to talk about ruTorrent what I prefer with rtorrent) so you may prefer installing the Transmission remote GUI on your PC/laptop:
http://code.google.com/p/transmisson-remote-gui/

All you need to do is set 192.168.1.1 and 9091 as port in the connection options.

One thing I particularly don't like about transmission that it stores the torrents in the subdirectory of the configuration directory, which is /opt/etc/transmission/torrents

In my view the best would be somewhere in /mnt/protected/Downloaders/Transmission/torrents so you may remove the torrents directory from /opt/etc/transmission/ and add a link instead to /mnt/...

The install script is also uploaded here: 8276

So if you're really lazy you can install it single line (copy to PuTTY) or whatever terminal client you use:

cd /tmp && wget -O install.tar.gz "http://wl500g.info/attachment.php?attachmentid=8276&d=1316097791" && tar xvzf install.tar.gz && ./install.sh

After successful install don't forget to remove the old transmissiond with ipkg remove transmissiond as it uses quite much memory and precious CPU time. Comment out also from /opt/etc/crontab the transmission_watchdog via inserting # to the beginning of the line.

bef
18-09-2011, 10:38
Is this meant as an update to 2.33 from 2.31 (which you get with ipkg) in general or only as an update if I have setup my router with your "headstart"/"the simply way" script?
Or why do you write its quite old by now as 2.31 was released in may, so 5 months isn't "that old" ;)

ecaddict
18-09-2011, 13:38
This tutorial is meant for those who are using transmissiond, which is pretty old, the latest (1.42-1) beeing from 02-Dec-2010. The reason for the tutorial that the old transmissiond is started using watchdog via cron (so quite differently).
The new transmission (as opposed to transmissiond) package has different set of programs (so no transmissiond or watchdog) and the package does not seem to contain a starter script (located normally in /opt/etc/init.d/).

If someone is already using the new tansmission package this kind of automatic install is not needed.
As also the configuration files are different (transmissiond old: /opt/etc/transmission.conf, transmission new: settings.json), the easiest to tell if you need this upgrade to search for config. files.

Another way to check if you have 1.x or 2.x version is:
ipkg list_installed | grep transmission

If you have 2.31 already properly configured you can skip this tutorial.

Hunty
26-06-2012, 14:38
Hi!
i've a wl500gp v1 and i followed this guide (http://www.wl500g.info/showthread.php?p=112117#post112117) and then the guide on this thread to update transmission.
A usb 4gb pen is connected in the usb port, thats it.

After the upgrade I was able to connect to transmission, web admin page, so normal use but when I added a torrent the router stopped working.

After a reboot i was able to copy and past the syslog (in the attachment)

At 23:03:50 i've reboot the router.

Can u help me? I'm a linux newbie :(

kolp
13-09-2012, 03:40
I accidentally updated and upgraded ipkg, my transmission has upgraded to 2.61-1 and now web interface is not working very well

9272

Jekyll
21-09-2012, 13:41
Hi, i had same problem with corrupted web interface...

...for me helped fix whitch I found somewhere in german discussion on this forum (I don't understand german, but I tried it and it is working ;))

ipkg remove transmission
ipkg install http://demongloom.dyndns.info:81/asus/transmission_2.50-1_mipsel.ipk



[root@router init.d]$ ipkg remove transmission
Removing package transmission from /opt/...
Successfully terminated.
[root@router init.d]$ ipkg install http://demongloom.dyndns.info:81/asus/transmission_2.50-1_mipsel.ipk
Downloading http://demongloom.dyndns.info:81/asus/transmission_2.50-1_mipsel.ipk
Installing transmission (2.61-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/transmission_2.61-1_mipsel.ipk
Configuring transmission
Successfully terminated.

kolp
21-09-2012, 17:06
Hi, i had same problem with corrupted web interface...

...for me helped fix whitch I found somewhere in german discussion on this forum (I don't understand german, but I tried it and it is working ;))

ipkg remove transmission
ipkg install http://demongloom.dyndns.info:81/asus/transmission_2.50-1_mipsel.ipk



[root@router init.d]$ ipkg remove transmission
Removing package transmission from /opt/...
Successfully terminated.
[root@router init.d]$ ipkg install http://demongloom.dyndns.info:81/asus/transmission_2.50-1_mipsel.ipk
Downloading http://demongloom.dyndns.info:81/asus/transmission_2.50-1_mipsel.ipk
Installing transmission (2.61-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/transmission_2.61-1_mipsel.ipk
Configuring transmission
Successfully terminated.

Got it to work thanks