BDMV.INFO

 Retrieve Password
 register now
Search
Hot: #
!show!: 24696|Reply: 0
Print Prev. thread Next thread

[2012.05.14] How To Install Transmissin BT Client [Copy URL]

Rank: 9Rank: 9Rank: 9

Jump to a specific floor
樓主
Post time 2011-12-15 01:22:26 |Show the author posts only |Descending
If we want to use the transmission, we must pre install some software.Like below command.
I suggest the people can install the rtorrent+rutorrent first, if  the transmission can't work fine, there are no cross-reference to let reader debug issue.
  1. sudo apt-get install build-essential automake autoconf libtool pkg-config intltool libcurl4-openssl-dev libglib2.0-dev libevent-dev libminiupnpc-dev libminiupnpc5 libappindicator-dev
Copy the Code

Then, we must download the transmission source code.
  1. http://www.transmissionbt.com/download/
Copy the Code

For example, we will install Transmission version 2.51
  1. wget http://download.transmissionbt.com/files/transmission-2.51.tar.bz2
  2. tar xvjf transmission-2.51.tar.bz2
Copy the Code

Then,we download and install the new version of libevent and intltool.
  1. wget https://github.com/downloads/libevent/libevent/libevent-2.0.16-stable.tar.gz
  2. cd libevent-2.0.16-stable
  3. ./configure&&make&&sudo make install
  4. sudo apt-get install intltool
  5. (The command can check the packet of intltool packet : sudo apt-cache show intltool)
Copy the Code

Then, we can complete to install transmission
  1. ./configure -q && make -s
  2. sudo make install
Copy the Code

After we install the transmission, we need to create the environment to let transmission work fine.
  1. mkdir tm tm-temp tm-torrents
  2. sudo ldconfig
  3. transmission-daemon -f
  4. ctrl^c
Copy the Code

People can refer the rtorrent installing tutorial to know why we create the folders - tm & tm-temp & tm-torrents.
Then we need write the script to control transmission state when we execute the transmission and restart the system.
First, we write the initial script can let transmission auto execute when we start the ubuntu system.
  1. sudo vi /etc/init.d/transmission-daemon
Copy the Code
  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          transmission-daemon
  4. # Required-Start:    networking
  5. # Required-Stop:     networking
  6. # Default-Start:     2 3 5
  7. # Default-Stop:      0 1 6
  8. # Short-Description: Start the transmission BitTorrent daemon client.
  9. ### END INIT INFO

  10. # Original Author: Lennart A. JÃŒtte, based on Rob Howell's script
  11. # Modified by Maarten Van Coile & others (on IRC)

  12. # Do NOT "set -e"

  13. #
  14. # ----- CONFIGURATION -----
  15. #
  16. # For the default location Transmission uses, visit:
  17. # http://trac.transmissionbt.com/wiki/ConfigFiles
  18. # For a guide on how set the preferences, visit:
  19. # http://trac.transmissionbt.com/wiki/EditConfigFiles
  20. # For the available environement variables, visit:
  21. # http://trac.transmissionbt.com/wiki/EnvironmentVariables
  22. #
  23. # The name of the user that should run Transmission.
  24. # It's RECOMENDED to run Transmission in it's own user,
  25. # by default, this is set to 'transmission'.
  26. # For the sake of security you shouldn't set a password
  27. # on this user
  28. USERNAME=*


  29. # ----- *ADVANCED* CONFIGURATION -----
  30. # Only change these options if you know what you are doing!
  31. #
  32. # The folder where Transmission stores the config & web files.
  33. # ONLY change this you have it at a non-default location
  34. #TRANSMISSION_HOME="/var/config/transmission-daemon"
  35. #TRANSMISSION_WEB_HOME="/usr/share/transmission/web"
  36. #
  37. # The arguments passed on to transmission-daemon.
  38. # ONLY change this you need to, otherwise use the
  39. # settings file as per above.
  40. #TRANSMISSION_ARGS=""


  41. # ----- END OF CONFIGURATION -----
  42. #
  43. # PATH should only include /usr/* if it runs after the mountnfs.sh script.
  44. PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  45. DESC="bittorrent client"
  46. NAME=transmission-daemon
  47. DAEMON=$(which $NAME)
  48. PIDFILE=/var/run/$NAME.pid
  49. SCRIPTNAME=/etc/init.d/$NAME

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

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

  54. # Load the VERBOSE setting and other rcS variables
  55. [ -f /etc/default/rcS ] && . /etc/default/rcS

  56. #
  57. # Function that starts the daemon/service
  58. #

  59. do_start()
  60. {
  61.     # Export the configuration/web directory, if set
  62.     if [ -n "$TRANSMISSION_HOME" ]; then
  63.           export TRANSMISSION_HOME
  64.     fi
  65.     if [ -n "$TRANSMISSION_WEB_HOME" ]; then
  66.           export TRANSMISSION_WEB_HOME
  67.     fi

  68.     # Return
  69.     #   0 if daemon has been started
  70.     #   1 if daemon was already running
  71.     #   2 if daemon could not be started
  72.     start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \
  73.             --exec $DAEMON --background --test -- -f $TRANSMISSION_ARGS > /dev/null \
  74.             || return 1
  75.     start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \
  76.             --exec $DAEMON --background -- -f $TRANSMISSION_ARGS \
  77.             || return 2
  78. }

  79. #
  80. # Function that stops the daemon/service
  81. #
  82. do_stop()
  83. {
  84.         # Return
  85.         #   0 if daemon has been stopped
  86.         #   1 if daemon was already stopped
  87.         #   2 if daemon could not be stopped
  88.         #   other if a failure occurred
  89.         
  90.     start-stop-daemon --stop --quiet --retry=TERM/10/KILL/5 --pidfile $PIDFILE --exec $DAEMON
  91.     RETVAL="$?"
  92.         [ "$RETVAL" = 2 ] && return 2

  93.         # Wait for children to finish too if this is a daemon that forks
  94.         # and if the daemon is only ever run from this initscript.
  95.         # If the above conditions are not satisfied then add some other code
  96.         # that waits for the process to drop all resources that could be
  97.         # needed by services started subsequently.  A last resort is to
  98.         # sleep for some time.

  99.         start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
  100.         [ "$?" = 2 ] && return 2

  101.         # Many daemons don't delete their pidfiles when they exit.
  102.         rm -f $PIDFILE

  103.         return "$RETVAL"
  104. }

  105. case "$1" in
  106.   start)
  107.         echo "Starting $DESC" "$NAME..."
  108.         do_start
  109.         case "$?" in
  110.                 0|1) echo "   Starting $DESC $NAME succeeded" ;;
  111.                 *)   echo "   Starting $DESC $NAME failed" ;;
  112.         esac
  113.         ;;
  114.   stop)
  115.         echo "Stopping $DESC $NAME..."
  116.         do_stop
  117.         case "$?" in
  118.                 0|1) echo "   Stopping $DESC $NAME succeeded" ;;
  119.                 *)   echo "   Stopping $DESC $NAME failed" ;;
  120.         esac
  121.         ;;
  122.   restart|force-reload)
  123.         #
  124.         # If the "reload" option is implemented then remove the
  125.         # 'force-reload' alias
  126.         #
  127.         echo "Restarting $DESC $NAME..."
  128.         do_stop
  129.         case "$?" in
  130.           0|1)
  131.                 do_start
  132.                 case "$?" in
  133.                     0|1) echo "   Restarting $DESC $NAME succeeded" ;;
  134.                     *)   echo "   Restarting $DESC $NAME failed: couldn't start $NAME" ;;
  135.                 esac
  136.                 ;;
  137.           *)
  138.                 echo "   Restarting $DESC $NAME failed: couldn't stop $NAME" ;;
  139.         esac
  140.         ;;
  141.   *)
  142.         echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
  143.         exit 3
  144.         ;;
  145. esac
Copy the Code
People must pay attenttion that the content of the script is different with the official provide, please use the script I provide.
And, people need change the content of * in line 31 to your real username, you can refer the home directory.

Second, we want to edit the configuration file.
  1. vi ~/.config/transmission-daemon/settings.json
Copy the Code
  1. {
  2.     "alt-speed-down": 7000,
  3.     "alt-speed-enabled": false,
  4.     "alt-speed-time-begin": 540,
  5.     "alt-speed-time-day": 217,
  6.     "alt-speed-time-enabled": false,
  7.     "alt-speed-time-end": 1020,
  8.     "alt-speed-up": 15000,
  9.     "bind-address-ipv4": "***",
  10.     "bind-address-ipv6": "***",
  11.     "blocklist-enabled": false,
  12.     "blocklist-url": "http://www.example.com/blocklist",
  13.     "cache-size-mb": 15,
  14.     "dht-enabled": true,
  15.     "download-dir": "/home/***/tm",
  16.     "download-queue-enabled": true,
  17.     "download-queue-size": 15,
  18.     "encryption": 1,
  19.     "idle-seeding-limit": 30,
  20.     "idle-seeding-limit-enabled": false,
  21.     "incomplete-dir": "/home/***/tm-temp",
  22.     "incomplete-dir-enabled": true,
  23.     "lazy-bitfield-enabled": true,
  24.     "lpd-enabled": false,
  25.     "message-level": 2,
  26.     "peer-congestion-algorithm": "",
  27.     "peer-limit-global": 1000,
  28.     "peer-limit-per-torrent": 100,
  29.     "peer-port": 35770,
  30.     "peer-port-random-high": 42424,
  31.     "peer-port-random-low": 4242,
  32.     "peer-port-random-on-start": true,
  33.     "peer-socket-tos": "default",
  34.     "pex-enabled": true,
  35.     "port-forwarding-enabled": true,
  36.     "preallocation": 1,
  37.     "prefetch-enabled": 1,
  38.     "queue-stalled-enabled": true,
  39.     "queue-stalled-minutes": 60,
  40.     "ratio-limit": 10,
  41.     "ratio-limit-enabled": false,
  42.     "rename-partial-files": true,
  43.     "rpc-authentication-required": true,
  44.     "rpc-bind-address": "***",
  45.     "rpc-enabled": true,
  46.     "rpc-password": "***",
  47.     "rpc-port": 4242,
  48.     "rpc-url": "/***/",
  49.     "rpc-username": "goddesschi",
  50.     "rpc-whitelist": "***",
  51.     "rpc-whitelist-enabled": false,
  52.     "scrape-paused-torrents-enabled": true,
  53.     "script-torrent-done-enabled": false,
  54.     "script-torrent-done-filename": "",
  55.     "seed-queue-enabled": true,
  56.     "seed-queue-size": 15,
  57.     "speed-limit-down": 7000,
  58.     "speed-limit-down-enabled": true,
  59.     "speed-limit-up": 15000,
  60.     "speed-limit-up-enabled": false,
  61.     "start-added-torrents": true,
  62.     "trash-original-torrent-files": false,
  63.     "umask": 22,
  64.     "upload-slots-per-torrent": 5,
  65.     "utp-enabled": true,
  66.     "watch-dir": "/home/***/tm-torrents",
  67.     "watch-dir-enabled": true
  68. }
Copy the Code
About the above script, search *** and change the content to fit your environment or your like.
People can refer the official website to get explaination of the parameter.

BTW, when people change password can reload the setting by this caomand.
  1. pkill -HUP transmission-da
Copy the Code

Then, we execute the command and we can use thetransmission
  1. transmission-daemon
Copy the Code
or
  1. sudo /etc/init.d/transmission-daemon restart
Copy the Code

if you want to see the web ui, put the internet site in your web browser and enter.
See your script setting to get informationrpc-bind-address、rpc-port and rpc-url.
  1. http://rpc-bind-address:rpc-port/rpc-url
Copy the Code

Final, if you want to upgrade the transmission,  I suggest you remove the old transmission and install new version source code again.
For example, I remove the 2.42 version and install the 2.5 version
  1. cd transmission-2.42
  2. sudo make uninstall
  3. sudo make clean
  4. cd ..
  5. wget http://download.transmissionbt.com/files/transmission-2.51.tar.bz2
  6. tar xvjf transmission-2.51.tar.bz2
  7. cd transmission-2.51
  8. ./configure -q && make -s
  9. sudo make install
  10. transmission-daemon
Copy the Code
So,  after you install the software finished, remember don't remove the complier source code.
When you wnat to upgrade the transmission and you want make uninstall, you need to use the source code.
You have to log in before you can reply Login | register now

Archiver|Cell Phone|BDMV.INFO

GMT+8, 2024-12-22 11:19 , Processed in 0.010370 second(s), 5 queries , Xcache On.

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

Top