howto install latest transmission on tonidoplug2

Support for your TonidoPlug
pmcallihan
Super Tonidoid
Super Tonidoid
Posts: 36
Joined: Sat Oct 22, 2011 2:52 pm

howto install latest transmission on tonidoplug2

Postby pmcallihan » Tue Nov 08, 2011 8:57 pm

as usual i responsible for nothing you tried on you equipment!

i like to use transmission for a bittorrent program for a lot of reasons. so
here's the procedure i used to put it on my plug. this is the latest version
2.42.

YOU MUST HAVE YOUR SYSTEM BOOTED USB OR SATA. DON'T DO THIS WITH A TONIDOPLUG2 ON INTERNAL TONIDO SOFTWARE.


My System booted is on 500GB sata. I recommend being on a hard drive or a really big and fast usb. Hard drive on the usb port should be ok.
How to setup most current version of transmission.

You need to have a development environment on your plug.
See: viewtopic.php?f=37&t=3625

1. ssh to your plug
ssh "your-ip" -l root

2. go to your work directory, mine is /root/src
cd ~/src

3. add care of available dependant libraries (1 minute)
apt-get install libcurl4-openssl-dev

4. transmission requires a libevent package >= 2.0
so lets build it with the folowing commands. (about 12vf minutes)

wget https://github.com/downloads/libevent/l ... ble.tar.gz
tar xvfz libevent-2.0.15-stable.tar.gz
cd libevent-2.0.15-stable
./configure
make && make install
cd ..

5. get source code for transmission and build it.
watch out for change it tar command (xvjpf instead of xvfz).

wget http://download.transmissionbt.com/file ... 42.tar.bz2
tar xvjpf transmission-2.42.tar.bz2
cd transmission-2.42.tar.bz2
./configure --enable-lightweight
make && make install
ln -s /usr/local/bin/transmission-daemon /usr/local/sbin/transmission-daemon
cd ..

6. setup transmission configuration and Download storage.
i like to keep things handy so this is how it's on my system.
my directories /home/downloads for downloads /home/.transmission for configuration.
i like the configuration to be invisible.

adduser --system --group --no-create-home --quiet transmission
mkdir /home/downloads /home/.transmission

my ip is 192.168.1.x adjust yours as necessary

transmission-daemon -f -g /mnt/HD_a2/.transmission-daemon -w /mnt/HD_a2/Downloads -t -u <username> -v <password> -a 127.0.0.1,192.168.1.*
chown -R transmission:transmission /home/downloads /home/.transmission
chmod -R 775 /home/.transmission /home/downloads

7. now we setup the init.d startup scripts. this is a little painful. copy and paste.

create a default script by creating this file name transmission-daemon at /etc/defaults
i use nano as an editor.

nano /etc/default/transmission-daemon

insert the following lines into the file
------
ENABLE_DAEMON=1
CONFIG_DIR="/home/.transmission"
OPTIONS="--config-dir $CONFIG_DIR"
------

save and close file

create the init.d script named transmission-daemon at /etc/init.d

nano /etc/init.d/transmission-daemon

insert the following into the file. (hint copy and paste)

------
#!/bin/sh -e

NAME=transmission-daemon
DAEMON=/usr/local/bin/$NAME
USER=transmission
STOP_TIMEOUT=3

export PATH="${PATH:+$PATH:}/sbin"

[ -x $DAEMON ] || exit 0

[ -e /etc/default/$NAME ] && . /etc/default/$NAME

. /lib/lsb/init-functions

start_daemon () {
if [ $ENABLE_DAEMON != 1 ]; then
log_progress_msg "(disabled, see /etc/default/${NAME})"
else
start-stop-daemon --start \
--chuid $USER \
--exec $DAEMON -- $OPTIONS
fi
}

case "$1" in
start)
log_daemon_msg "Starting bittorrent daemon" "$NAME"
start_daemon
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
--exec $DAEMON --retry $STOP_TIMEOUT \
--oknodo
log_end_msg 0
;;
reload)
log_daemon_msg "Reloading bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
--exec $DAEMON \
--oknodo --signal 1
log_end_msg 0
;;
restart|force-reload)
log_daemon_msg "Restarting bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
--exec $DAEMON --retry $STOP_TIMEOUT \
--oknodo
start_daemon
log_end_msg 0
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart}"
exit 2
;;
esac

exit 0
------

save and close file

8. startup transmission and test your software

chmod a+x /etc/init.d/transmission-daemon
/etc/init.d/transmission-daemon start

On a browser from one of your machines goto http:<your-plug-ip>:9091
it should be there. login with the user name and password that you used
in the script in step 6. go to transmission site for details on program.


9. make transmission start on boot

update-rc.d transmission-daemon defaults

that's it. if you tried this i hope it when well.

UrbanVoyeur
Tonido MVP
Tonido MVP
Posts: 321
Joined: Fri Oct 21, 2011 8:20 pm

Re: howto install latest transmission on tonidoplug2

Postby UrbanVoyeur » Wed Nov 09, 2011 9:15 pm

Thanks!
I tried it and found only a small glitch so far:
The libevent libraries were not being found.

"transmission-daemon: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory"

After a little Googling, I was able to redirect the environment variable:

export LD_LIBRARY_PATH="/usr/local/lib" or
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

And now the transmission-daemon starts fine.

pmcallihan
Super Tonidoid
Super Tonidoid
Posts: 36
Joined: Sat Oct 22, 2011 2:52 pm

Re: howto install latest transmission on tonidoplug2

Postby pmcallihan » Mon Nov 14, 2011 4:28 pm

I made two mistakes in my post.

step 6

reads
transmission-daemon -f -g /mnt/HD_a2/.transmission-daemon -w /mnt/HD_a2/Downloads -t -u <username> -v <password> -a 127.0.0.1,192.168.1.*
shouldbe

transmission-daemon -f -g /home/.transmission-daemon -w /home/Downloads -t -u <username> -v <password> -a 127.0.0.1,192.168.1.*


step 7

change the init.d startup as folows:
-------------------------------------------------------------------

#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO

# Author: Foo Bar <foobar@baz.org>
#
# Please remove the "Author" lines above and replace them
# with your own name if you copy and modify this script.

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Bit Torrent Client"
NAME=transmission-daemon
DAEMON=/usr/sbin/$NAME
DAEMON_ARGS="--config-dir /home/.transmission-daemon -w /home/Downloads"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}

#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --exec $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}

#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --exec $NAME
return 0
}

case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac

:
----------------------------------------------------------------------------------------------

martytng
Super Tonidoid
Super Tonidoid
Posts: 27
Joined: Fri Oct 07, 2011 3:34 pm

Re: howto install latest transmission on tonidoplug2

Postby martytng » Wed Nov 16, 2011 3:06 pm

Great tutorial! Now how do install a blocklist such as the ones from iBlocklist.com that software such as PeerBlock uses?

UrbanVoyeur
Tonido MVP
Tonido MVP
Posts: 321
Joined: Fri Oct 21, 2011 8:20 pm

Re: howto install latest transmission on tonidoplug2

Postby UrbanVoyeur » Thu Nov 17, 2011 1:29 am

The first init.d script works if you add the following to the header.

Code: Select all

### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO


The second script fails to start the transmission daemon and I think it has to do with the path which is
/usr/local/bin/$NAME

rather than as it appears in the 2nd script:
/usr/sbin/$NAME

Zlll
Regular Tonidoid
Regular Tonidoid
Posts: 10
Joined: Thu Jan 05, 2012 9:22 am

Re: howto install latest transmission on tonidoplug2

Postby Zlll » Thu Jan 05, 2012 9:27 am

when entering the make command,

it return as "-bash: make: command not found"

Dose it implied there is a problem with the build environment installed?

I have never encounter the command line and linux stuffs before, any help would be appreciated :D

UrbanVoyeur
Tonido MVP
Tonido MVP
Posts: 321
Joined: Fri Oct 21, 2011 8:20 pm

Re: howto install latest transmission on tonidoplug2

Postby UrbanVoyeur » Thu Jan 05, 2012 11:27 am

Zlll wrote:when entering the make command,

it return as "-bash: make: command not found"

Dose it implied there is a problem with the build environment installed?

Most likely.

Did you set up your build environment as per:
http://www.tonidouser.com/doku.php?id=a ... nvironment

Zlll
Regular Tonidoid
Regular Tonidoid
Posts: 10
Joined: Thu Jan 05, 2012 9:22 am

Re: howto install latest transmission on tonidoplug2

Postby Zlll » Sat Jan 07, 2012 10:09 am

Thx :D the problem is resolved after I tired to rebuild the environment needed :mrgreen: :mrgreen:


Return to “TonidoPlug Support”

Who is online

Users browsing this forum: No registered users and 9 guests