[GUIDE] uTorrent Server running on OMV as a user with startup script

    • OMV 2.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [GUIDE] uTorrent Server running on OMV as a user with startup script

      This guide will setup uTorrent Server to use as an alternative bittorrent client to Transmission.
      After completing these steps, utserver will run at server startup as a user named "utorrent".
      This worked with a fresh install of omv-2.1 on amd64 updated to omv-2.2.1



      Prerequisites:

      1. Create a user named "utorrent" to run uTorrent Server:

      useradd -m -s /bin/bash -U utorrent
      usermod -a -G www-data -G sudo utorrent

      2. Provide write permissions to /var/www to utorrent user:

      chmod g+w /var/www

      3. Deny ssh login to user utorrent

      grep -i 'deny' /etc/ssh/sshd_config

      4. The libssl 0.9.8 package from debian squeeze is required to run uTorrent. Choose your Architecture:

      For amd64 Architecture

      wget http://ftp.us.debian.org/debian/pool/main/o/openssl/libssl0.9.8_0.9.8o-4squeeze14_amd64.deb
      dpkg -i libssl0.9.8_0.9.8o-4squeeze14_amd64.deb

      For i386 Architecture

      wget http://ftp.us.debian.org/debian/pool/main/o/openssl/libssl0.9.8_0.9.8o-4squeeze14_i386.deb
      dpkg -i libssl0.9.8_0.9.8o-4squeeze14_i386.deb

      (Note: you can mannually download and install from packages.debian.org/squeeze/libssl0.9.8)


      Install uTorrent to boot with system using the utstart startup script as root through ssh:

      1. Donwload and extract the latest uTorrent server tar.gz (utserver)

      wget http://download-new.utorrent.com/endpoint/utserver/os/linux-x64-debian-7-0/track/beta/ --content-disposition
      tar xf utserver.tar.gz

      2. Change dir to the extracted folder

      cd ~/utorrent-server-*

      3. Make dir called utorrent in and move the extracted uTorrent files to /opt/utorrent/

      mkdir /opt/utorrent/
      mv * /opt/utorrent/

      4. Now we need to download or create the utstart file in /opt/utorrent/ using nano (Also attached file here --> forum.openmediavault.org/index…e82b5326f41f4675cc4418da4)

      Download Method:

      wget https://www.dropbox.com/s/7jejg286ldbmac0/utstart?dl=0 -O /opt/utorrent/utstart

      (Note: if you get errors during step 6, remove the downloaded utstart file and use the create method)

      Create Method:

      nano /opt/utorrent/utstart

      Copy the following text to the utstart file:


      Shell-Script

      1. #!/bin/bash
      2. ### BEGIN INIT INFO
      3. # Provides: utserver
      4. # Required-Start:
      5. # Required-Stop:
      6. # Default-Start: 2 3 4 5
      7. # Default-Stop: 0 1 6
      8. # X-Interactive: true
      9. # Short-Description: Start/stop utserver
      10. ### END INIT INFO
      11. set -e
      12. ############### BEGIN EDIT ME ###########
      13. RUN_AS=utorrent
      14. RUN_GRP=users
      15. NAME=utorrent
      16. DESC=utorrent
      17. ############### END EDIT ME #############
      18. function install_autocomplete () {
      19. echo '#!/bin/bash
      20. _utstart()
      21. {
      22. local cur prev opts
      23. COMPREPLY=()
      24. cur="${COMP_WORDS[COMP_CWORD]}"
      25. prev="${COMP_WORDS[COMP_CWORD-1]}"
      26. opts="start stop install uninstall"
      27. if [[ ${cur} == * && ${COMP_CWORD} -eq 1 ]] ; then
      28. COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
      29. return 0
      30. fi
      31. }
      32. complete -F _utstart -o filenames utstart' > /etc/bash_completion.d/utstart
      33. source /etc/bash_completion.d/utstart
      34. chmod +x /etc/bash_completion.d/utstart
      35. echo "Autocomplete entries for utstart added to bash. You may need to reboot or manually source the entry like this for this session:
      36. . /etc/bash_completion.d/utstart
      37. "
      38. }
      39. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
      40. me=`basename $0`
      41. UTORRENT_LOCATION="/opt/utorrent"
      42. case "$1" in
      43. start)
      44. echo Starting utorrent server
      45. cd $UTORRENT_LOCATION
      46. sudo -u $RUN_AS ./utserver &
      47. ;;
      48. stop)
      49. echo Stopping utorrent server
      50. killall utserver
      51. ;;
      52. install)
      53. echo Install
      54. echo Scriptname: $me
      55. echo Path: $DIR
      56. echo Installing utorrent server as a boot-time program..
      57. cp $DIR/$me /etc/init.d/
      58. insserv $me -dv
      59. echo utorrent server installed to boot-time..
      60. install_autocomplete
      61. exit 0
      62. ;;
      63. uninstall)
      64. echo Uninstall
      65. echo Uninstalling utorrent server from boot init..
      66. insserv $me -rv
      67. echo Not deleting /etc/init.d/$me. You may delete it yourself. Leaving it there wont do any harm.
      68. echo utorrent server removed from boot init.
      69. ;;
      70. *)
      71. echo Usage: start stop install uninstall
      72. exit 1
      73. ;;
      74. esac
      75. exit 0
      Display All


      5. Make utstart executable

      cd /opt/utorrent/
      chmod +x utstart

      6. Use the utstart script to add uTorrent Server (utserver) to the boot sequence

      ./utstart install

      (Note: ./utstart uninstall will remove utserver from the boot sequence)

      7. Start the uTorrent Server webui (utserver)

      ./utstart start

      (Note: ./utstart stop will stop the uTorrent Server webui)

      8. Now we can verify that webui is working

      In a web browser point to "your.server.ip:8080/gui" (ex. 192.168.1.10:8080/gui)

      uTorrent Server webui should prompt for default user/password

      user: admin
      password: (blank)

      Click Login and the webui loads.

      9. Reboot your OMV server via webui or terminal.

      Terminal:

      reboot

      10. After the system boots back up, launch the uTorrent Server webui again to verify that utserver boots with startup.

      Enjoy using uTorrent Server... :thumbsup:


      This guide was compiled using the following sources:

      blog.droidzone.in/?s=utstart

      How to make uTorrent run with different user than root

      is it possible to run Utorrent server on OMV???
      Files
      • utstart.zip

        (1.04 kB, downloaded 158 times, last: )

      The post was edited 1 time, last by rpiper ().

    • rpiper wrote:

      Provide write permissions to /var/www to utorrent user:


      This seems unnecessary, why write permissions to /var/www, doesn't the binary has his own webroot at /opt/utorrent?

      rpiper wrote:

      Deny ssh login to user utorrent


      I don't get this, why grep through the sshd_config will deny access to ssh?, users are granted access to omv by being in the ssh group, so deny is by default.
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • I would be concerned about mixing libraries from Squeeze with Wheezy libraries as well. Usually not a good idea to do this. I think this would be good to run as a Docker container until they are using Wheezy/OMV 2.x or Jessie/OMV 3.x libraries.

      There is a way to take just the library files and not use the packages though. That would be a better alternative. You could create the folder /opt/utorrent/libs and put the library files in it, see pic attached. Then put a config file in /etc/ld.so.conf.d/utorrent (chown root:root and chmod 644) give the path to the folder in that file /opt/utorrent/libs. Activate the libraries with ldconfig.
      Images
      • libs utorrent.jpg

        54.43 kB, 963×300, viewed 153 times

      The post was edited 2 times, last by tekkb ().

    • I'm somewhat new to linux but am picking things up.

      So this guide helped me get started but several issues have come up.

      Utorrent isn't autostarting. I think I can figure this one out -

      When started manually ( /opt/utorrent/utstart start) it starts on port 8080. I log in and under webui change it to 9091 and all is well. Except it doesn't save any settings. The next time I start it the password and port is back to default.

      Sonarr also is not passing torrents to utorrent. I was using Deluge succesfully but one of my trackers doesn't support the version of Deluge I have and I thought utorrent would solve my problem as it is supported by all my trackers.

      So first I guess I have to ask what should I be looking at to figure out why my settings won't save?

      Second, on Sonarr, when I setup the downloader and hit the test button it succeeds. I don't know why it isn't arriving at utorrent.

      Thanks