It takes a few steps to run a script at bootup in Linux. See the example below for starting rTorrent at boottime.

http://blog.it4me.se/?tag=rtorrent-autostart-reboot

sudo -s
wget http://libtorrent.rakshasa.no/raw-attachment/wiki/RTorrentCommonTasks/rtorrentInit.sh
mv rtorrentInit.sh /etc/init.d/

After that you only need to make the script runnable and insert it into update-rc.d.

sudo chmod +x /etc/init.d/rtorrentInit.sh
cd /etc/init.d/
sudo update-rc.d rtorrentInit.sh defaults

#now you can start it as a service by using
/etc/init.d/rtorrentInit.sh start