simonbcn Posted September 3, 2010 Report Share Posted September 3, 2010 Hi,I use Ubuntu 10.04 32 bits on my server and I'm testing the µTorrent Server. I've created a init script (between "<>" are the values to change in your case): http://pastebin.com/UE3kDg00 Link to comment Share on other sites More sharing options...
mit Posted September 9, 2010 Report Share Posted September 9, 2010 Hi!I tested and works fine.Thank you! Link to comment Share on other sites More sharing options...
swasher Posted September 16, 2010 Report Share Posted September 16, 2010 Tnx for your work, good job! Works under Ubuntu 10.04 x64 Link to comment Share on other sites More sharing options...
juan_valdez Posted September 22, 2010 Report Share Posted September 22, 2010 Appreciate this, thanks for sharing the wealth. Link to comment Share on other sites More sharing options...
ultravox Posted October 4, 2010 Report Share Posted October 4, 2010 Hi.1st: I'm a linux noob For those who want to load utserver on boot, just copy the script to the folder where utserver is( gui will only run if utserver is called from the own dir) and then create a symlink(utserver) in rc2.d:cd /etc/rc2.d/ sudo ln -sf <path to script> S99utserver Link to comment Share on other sites More sharing options...
simonbcn Posted October 4, 2010 Author Report Share Posted October 4, 2010 Hi.1st: I'm a linux noob For those who want to load utserver on boot, just copy the script to the folder where utserver is( gui will only run if utserver is called from the own dir) and then create a symlink(utserver) in rc2.d:cd /etc/rc2.d/ sudo ln -sf <path to script> S99utserver@ultravox, the init script already uses an option to change to the utserver dir.Edit the init script and change these values:....CHDIR=<dir containing utserver program>....USER=<username>....After, in linux distros like Ubuntu (and similar), you should do:1) Copy the init script to "/etc/init.d/":sudo cp <downloaded-filename> /etc/init.d/utserver-daemon2) Execute this:sudo chmod +x /etc/init.d/utserver-daemon2) And this:sudo update-rc.d utserver-daemon defaultsAnd go on! Link to comment Share on other sites More sharing options...
ultravox Posted October 4, 2010 Report Share Posted October 4, 2010 Thx.As you know I had some problems before I could get the script working, so I didn't try anything more after I got ti running Link to comment Share on other sites More sharing options...
aunlead Posted October 24, 2010 Report Share Posted October 24, 2010 Hi.1st: I'm a linux noob For those who want to load utserver on boot' date=' just copy the script to the folder where utserver is( gui will only run if utserver is called from the own dir) and then create a symlink(utserver) in rc2.d:cd /etc/rc2.d/ sudo ln -sf <path to script> S99utserver[/quote']@ultravox, the init script already uses an option to change to the utserver dir.Edit the init script and change these values:....CHDIR=<dir containing utserver program>....USER=<username>....After, in linux distros like Ubuntu (and similar), you should do:1) Copy the init script to "/etc/init.d/":sudo cp <downloaded-filename> /etc/init.d/utserver-daemon2) Execute this:sudo chmod +x /etc/init.d/utserver-daemon2) And this:sudo update-rc.d utserver-daemon defaultsAnd go on!Hi! I tried @simonbcn instructions but utorrent server didnt run on startup... when i tried running it directly /etc/init.d/utserver-daemoni got the following error - /bin/sh: Illegal option -any idea on what i am doing wrong?the config on the script looks like this -CHDIR=/home/aunlead/uTorrent/bittorrent-server-v3_0NAME=utserverOPTIONS="-LOGFILE"DAEMON=$CHDIR/$NAMEUSER=aunleadPIDFILE=/var/run/$NAME.pidSTOP_TIMEOUT=5 Link to comment Share on other sites More sharing options...
simonbcn Posted October 24, 2010 Author Report Share Posted October 24, 2010 Hi! I tried @simonbcn instructions but utorrent server didnt run on startup... when i tried running it directly /etc/init.d/utserver-daemoni got the following error - /bin/sh: Illegal option -any idea on what i am doing wrong?What distro?The init script must be executed as root and you have to indicate the action: start, stop or restart.Execute the script with:sh -x /etc/init.d/utserver-daemonAnd you'll see the line that produces this error. Link to comment Share on other sites More sharing options...
trampen Posted December 5, 2010 Report Share Posted December 5, 2010 Hi,I use Ubuntu 10.04 32 bits on my server and I'm testing the µTorrent Server. I've created a init script (between "<>" are the values to change in your case): http://pastebin.com/UE3kDg00Here http://pastebin.com/pRpmA7sV I put your script a little optimised (/etc/init.d/utserver) working correctly on Ubuntu 10.10For anyone who don't know yet: use http://127.0.0.1:8080/gui/ to access µTorrent Server web GUI Link to comment Share on other sites More sharing options...
simonbcn Posted December 5, 2010 Author Report Share Posted December 5, 2010 Here http://pastebin.com/pRpmA7sV I put your script a little optimised (/etc/init.d/utserver) working correctly on Ubuntu 10.10Which is the optimization? Do you execute µTorrent like "root"!!? I wouldn't say that is an optimization. These scripts should be changed, µTServer creates its own pid file now with "-pidfile" argument in command-line. Link to comment Share on other sites More sharing options...
trampen Posted December 5, 2010 Report Share Posted December 5, 2010 Here http://pastebin.com/pRpmA7sV I put your script a little optimised (/etc/init.d/utserver) working correctly on Ubuntu 10.10Which is the optimization? Do you execute µTorrent like "root"!!? I wouldn't say that is an optimization. These scripts should be changed' date=' µTServer creates its own pid file now with "[i']-pidfile" argument in command-line.1st.I call my script file name /etc/init.d/utserver so your line:grep -U $USER $NAME >/dev/nullworks not as I expect, so I change it to:pgrep -f $DAEMON >/dev/null2nd. For some reasons during running tests of utserver I had run another instances of utserver and your line:start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON --retry $STOP_TIMEOUTdoesn't close them, so I change it to:start-stop-daemon --stop --quiet --exec $DAEMON --retry $STOP_TIMEOUT3th.I change USER to 'root' but it's of course not so important.Please don't take it personally. Regards Link to comment Share on other sites More sharing options...
simonbcn Posted December 5, 2010 Author Report Share Posted December 5, 2010 1st.I call my script file name /etc/init.d/utserver so your line:grep -U $USER $NAME >/dev/nullworks not as I expect, so I change it to:pgrep -f $DAEMON >/dev/nullIt's the same name and the same path like previous init script... Probably the cause of your problem is by running it as root.Moreover, you has forgotten to correct the line 38 too.2nd. For some reasons during running tests of utserver I had run another instances of utserver and your line:start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON --retry $STOP_TIMEOUTdoesn't close them, so I change it to:start-stop-daemon --stop --quiet --exec $DAEMON --retry $STOP_TIMEOUTWhy do you create the pid file then? 3th.I change USER to 'root' but it's of course not so important.It's important by security.Please don't take it personally. Well, it isn't personal. It's my opinion about your supposed "optimizations".You have adapted the previous script to work in your case, but these aren't optimizations.Regards. Link to comment Share on other sites More sharing options...
rapa Posted January 25, 2011 Report Share Posted January 25, 2011 I got this error after run the script, please help+ : not found/utserver: 1: + CHDIR=/etc/utserver+ NAME=utserver+ OPTIONS=-LOGFILE/utserver/etc/utserver+ USER=madj.pidDFILE=/var/run/utserver+ STOP_TIMEOUT=5+ : not found/utserver: 1: ]tservertc/utserver+ exit 1thanks Link to comment Share on other sites More sharing options...
S K Posted January 28, 2011 Report Share Posted January 28, 2011 "sudo sed -i 's/\r//g' /etc/init.d/utserver" solves the problems:- "illegal option -"- ": not found"Works for me now.And yes, running as root is a terrible idea.Although the correct thing would be to create a nologin user for utorrent..or create a Makefile to "make install" to do everything in an elegant way...or create distro-centric install packages...or give up since utorrent does not really give system based user access so it should just be run individually and not really as a init.d server, even though it is 'utserver' ...ah, whatever... Link to comment Share on other sites More sharing options...
bando Posted February 13, 2011 Report Share Posted February 13, 2011 Thanks Simon! Just followed your instructions and it works like a charm in Ubuntu Lucid.Frank Link to comment Share on other sites More sharing options...
i <3 distrobution Posted April 25, 2011 Report Share Posted April 25, 2011 Thanks for this script, I've found it to be a very useful quick reference. I'd just add one thing, if you want to multiple daemons you have to have two scripts, maintain two copies of utorrent(or separate and specify where the config files are), and comment out this line in your scripts:pgrep -U $USER $NAME >/dev/null && echo "$NAME is already running" && log_end_msg 1Apart from that you also don't want to start the same script twice, as that can be a mess. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.