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 https://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 --> utstart.zip)
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:
#!/bin/bash
### BEGIN INIT INFO
# Provides: utserver
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Start/stop utserver
### END INIT INFO
set -e
############### BEGIN EDIT ME ###########
RUN_AS=utorrent
RUN_GRP=users
NAME=utorrent
DESC=utorrent
############### END EDIT ME #############
function install_autocomplete () {
echo '#!/bin/bash
_utstart()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="start stop install uninstall"
if [[ ${cur} == * && ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
}
complete -F _utstart -o filenames utstart' > /etc/bash_completion.d/utstart
source /etc/bash_completion.d/utstart
chmod +x /etc/bash_completion.d/utstart
echo "Autocomplete entries for utstart added to bash. You may need to reboot or manually source the entry like this for this session:
. /etc/bash_completion.d/utstart
"
}
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
me=`basename $0`
UTORRENT_LOCATION="/opt/utorrent"
case "$1" in
start)
echo Starting utorrent server
cd $UTORRENT_LOCATION
sudo -u $RUN_AS ./utserver &
;;
stop)
echo Stopping utorrent server
killall utserver
;;
install)
echo Install
echo Scriptname: $me
echo Path: $DIR
echo Installing utorrent server as a boot-time program..
cp $DIR/$me /etc/init.d/
insserv $me -dv
echo utorrent server installed to boot-time..
install_autocomplete
exit 0
;;
uninstall)
echo Uninstall
echo Uninstalling utorrent server from boot init..
insserv $me -rv
echo Not deleting /etc/init.d/$me. You may delete it yourself. Leaving it there wont do any harm.
echo utorrent server removed from boot init.
;;
*)
echo Usage: start stop install uninstall
exit 1
;;
esac
exit 0
Alles anzeigen
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...
This guide was compiled using the following sources:
http://blog.droidzone.in/?s=utstart
How to make uTorrent run with different user than root