Tuesday, May 8, 2012

START UTORRENT SERVER AS A DAEMON WITH THIS UPSTART SCRIPT




uTorrent server Linux

I've recently built a small home server powered by Ubuntu and wanted to give uTorrent Server for Linux a try. I needed a way to demonize uTorrent so it starts automatically and I can easily start/stop it so I've used an upstart script (found here) for this. Here's exactly how to do it:


To create an upstart script for uTorrent, move all the uTorrent files to the/home/yourusername/.utorrent folder, then run the following command:
(replace "nano" with your favourite editor)

sudo nano /etc/init/utorrent.conf

and copy/paste the following code:

####################################################################################

description "utorrent startup script"

start on (local-filesystems and started dbus and stopped udevtrigger)
stop on runlevel [016]

script
        cd /home/yourusername/.utorrent
        exec su yourusername -c "/home/yourusername/.utorrent/utserver"
end script

####################################################################################

Of course, replace "yourusername" with your username in the commands above. Now there's only one step left:
sudo ln -s /lib/init/upstart-job /etc/init.d/utorrent

From now on you can start/stop uTorrent using the following commands:

sudo start utorrent
sudo stop utorrent


Also see: http://fafadiatech.blogspot.in/2012/05/deploying-app-with-upstart.html

No comments:

Post a Comment