autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Questions regarding modifying the torrent engine or download station may go here.
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/su ... p?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
ser78
I'm New!
I'm New!
Posts: 6
Joined: Sun Feb 07, 2010 6:39 pm
Location: ptz, Russia

autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by ser78 » Fri Feb 26, 2010 11:50 pm

this script for syno 210j with Marvell Kirkwood mv6281 cpu
install on clean system (without installed IPKG)
after reboot enter in web browser http://DiskStation:8081/rutorrent

Code: Select all

#!/bin/sh

LIGHTTPDCONF=/opt/etc/lighttpd/lighttpd.conf
RTORRENTCONF=/opt/etc/rtorrent.conf

mkdir -p /volume1/@tmp
cd /volume1/@tmp/

#  IPKG
echo -e "\033[1mInstalling IPKG\033[0m"
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh
sh syno-mvkw-bootstrap_1.2-7_arm.xsh &
sleep 20
ipkg update

#  Lighttpd
echo -e "\033[1mInstalling Lighttpd\033[0m"
ipkg install lighttpd php-fcgi
echo 'server.event-handler = "poll"' >> ${LIGHTTPDCONF}
echo 'server.modules += ("mod_auth","mod_cgi","mod_scgi")' >> ${LIGHTTPDCONF}
echo '
scgi.server = ("/RPC2" =>
  ("127.0.0.1" =>
    ("host" => "127.0.0.1",
     "port" => 5050,
     "check-local" => "disable")
    )
)
' >> ${LIGHTTPDCONF}

#  rtorrent
echo -e "\033[1mInstalling RTorrent\033[0m"
ipkg install rtorrent screen
ipkg remove xmlrpc-c
mkdir -p /opt/share/torrent/session/
echo 'scgi_port = 127.0.0.1:5050' >> ${RTORRENTCONF}
echo '#!/bin/sh

NAME=rtorrent
CONFIG=/opt/etc/rtorrent.conf
LOGFILE=/opt/var/log/rtorrentInit.log
TORRENTFILE=/opt/bin/rtorrent
OPTIONS="-n -o import=$CONFIG"

getsession() {
    session=`sed -n "/session\s*=/s/^\s*session\s*=\s*//p" $CONFIG`
    echo $session
}

case "$1" in
  start)
    screen -list|grep -sq $NAME && exit 0
    session=`getsession`
    [ -e $session/rtorrent.lock ] && rm -rf $session/rtorrent.lock
    /opt/bin/screen -dmS $NAME $TORRENTFILE $OPTIONS 2>$LOGFILE
;;
  stop)
    session=`getsession`
    ! [ -e $session/rtorrent.lock ] && exit 0
    pid=`sed "s/[^0-9]//g" $session/rtorrent.lock`
    ps|grep -v grep|grep -sq $pid.*rtorrent && kill $pid
;;
  restart)
    $0 stop
    sleep 2
    $0 start
;;
  status)
    screen -list|grep -s $NAME
;;
  *)
    echo $"Usage: \$0 {start|stop|status|restart}"
    exit 1
esac
exit 0
' > /opt/etc/init.d/S99rtorrent

#  xmlrpc-c
echo -e "\033[1mInstalling xmlrpc-c\033[0m"
ipkg install gcc binutils optware-devel libcurl-dev
svn co http://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable xmlrpc-c
cd xmlrpc-c
./configure  --prefix=/opt
make ARCH=arm
make install

#  ruTorrent 3.0
echo -e "\033[1mInstalling ruTorrent\033[0m"
cd /opt/share/www
svn co http://rutorrent.googlecode.com/svn/trunk/rutorrent/
cd rutorrent
rm -r plugins
svn co http://rutorrent.googlecode.com/svn/trunk/plugins/
cd plugins
rm -r darkpal rpc
cd ..
sed -i 's/scgi_port\s*=\s*5000/scgi_port = 5050/' conf/config.php

echo -e "\033[1mAutoinstall complete\033[0m"
reboot
Last edited by ser78 on Sat Mar 13, 2010 4:55 pm, edited 1 time in total.
NAS Synology DS210j | DSM 2.3-1139 | 2 x WD15EARS (JBOD)

szczetyk
I'm New!
I'm New!
Posts: 6
Joined: Wed Feb 24, 2010 12:35 am

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by szczetyk » Mon Mar 01, 2010 12:38 am

Hello,
how to apply this script (step-by-step) on my Ds-209 with same cpu ?

Cheers

ser78
I'm New!
I'm New!
Posts: 6
Joined: Sun Feb 07, 2010 6:39 pm
Location: ptz, Russia

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by ser78 » Mon Mar 01, 2010 2:54 pm

szczetyk wrote:Hello,
how to apply this script (step-by-step) on my Ds-209 with same cpu ?

Cheers
Insert the text into a file (for an example install.sh) and run it

Code: Select all

sh install.sh
NAS Synology DS210j | DSM 2.3-1139 | 2 x WD15EARS (JBOD)

szczetyk
I'm New!
I'm New!
Posts: 6
Joined: Wed Feb 24, 2010 12:35 am

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by szczetyk » Mon Mar 01, 2010 7:02 pm

Thank You very much 4 this script :)
Could You also help with updating WebUi from 2.8 to 3.0 beta ?
I'm trying to get it done for hours with many hints from the web, but stil no luck. Says rev. 775 but still version 2.8 of web gui......

Thnx in advance :)

ser78
I'm New!
I'm New!
Posts: 6
Joined: Sun Feb 07, 2010 6:39 pm
Location: ptz, Russia

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by ser78 » Mon Mar 01, 2010 7:36 pm

szczetyk wrote:Thank You very much 4 this script :)
Could You also help with updating WebUi from 2.8 to 3.0 beta ?
I'm trying to get it done for hours with many hints from the web, but stil no luck. Says rev. 775 but still version 2.8 of web gui......

Thnx in advance :)

Code: Select all

#  ruTorrent 3.0 beta
cd /opt/share/www
svn co http://rutorrent.googlecode.com/svn/branches/3.0/rutorrent/ rtorrent3
cd rtorrent3
rm -r plugins
svn co http://rutorrent.googlecode.com/svn/branches/3.0/plugins/
cd plugins
rm -r darkpal rpc
cd ..
sed -i 's/scgi_port\s*=\s*5000/scgi_port = 5050/' conf/config.php
NAS Synology DS210j | DSM 2.3-1139 | 2 x WD15EARS (JBOD)

szczetyk
I'm New!
I'm New!
Posts: 6
Joined: Wed Feb 24, 2010 12:35 am

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by szczetyk » Mon Mar 01, 2010 7:55 pm

You are faster then the wind :D
I've tried many methods......

I'll reset my device to factory defaults (cause I made to big mess in directory structure)... and test all scripts from You.

Big thnx :)

kenysc
I'm New!
I'm New!
Posts: 4
Joined: Thu Jan 28, 2010 7:11 am

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by kenysc » Fri Mar 12, 2010 5:10 am

I got in running fine in my ds209, many thanks for the script...

I'm downloading chinese torrent files and find the chinese became "?", I googled and found the .rtorrent.rc file may help. However, I couldn't find where is this config. file placed...
Let's share and help =)

Ken

DS-209 [DSM 3.1-1594] + 2xWD20EARS@RAID0

laser21
Novice
Novice
Posts: 41
Joined: Mon Feb 01, 2010 9:57 pm

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by laser21 » Fri Mar 12, 2010 1:21 pm

Hey, this looks really promising like something for noobs :)

I have a 109+ and Im wondering if you could point me in some direction where to start to get rtorrent with wtorrent running on my box.

Thanks

JD2k3
I'm New!
I'm New!
Posts: 7
Joined: Wed Nov 11, 2009 11:32 pm

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by JD2k3 » Fri Mar 12, 2010 5:46 pm

Hey ser78 thanks for this guide :)
I did a installation based on this guide by hand since I already had IPKG installed and I have a DS409+.

There's a small mistake in the commands given to upgrade ruTorrent since the location is changed here is the correct way:

Code: Select all

#  ruTorrent 3.0 beta
cd /opt/share/www
svn co http://rutorrent.googlecode.com/svn/trunk/rutorrent/ rtorrent3
cd rtorrent3
rm -r plugins
svn co http://rutorrent.googlecode.com/svn/branches/3.0/plugins/
cd plugins
rm -r darkpal rpc
cd ..
sed -i 's/scgi_port\s*=\s*5000/scgi_port = 5050/' conf/config.php

ser78
I'm New!
I'm New!
Posts: 6
Joined: Sun Feb 07, 2010 6:39 pm
Location: ptz, Russia

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by ser78 » Fri Mar 12, 2010 5:59 pm

JD2k3 wrote:Hey ser78 thanks for this guide :)
I did a installation based on this guide by hand since I already had IPKG installed and I have a DS409+.

There's a small mistake in the commands given to upgrade ruTorrent since the location is changed here is the correct way:

Code: Select all

#  ruTorrent 3.0 beta
cd /opt/share/www
svn co http://rutorrent.googlecode.com/svn/trunk/rutorrent/ rtorrent3
cd rtorrent3
rm -r plugins
svn co http://rutorrent.googlecode.com/svn/branches/3.0/plugins/
cd plugins
rm -r darkpal rpc
cd ..
sed -i 's/scgi_port\s*=\s*5000/scgi_port = 5050/' conf/config.php
just now rutorrent 3.0 no longer beta
NAS Synology DS210j | DSM 2.3-1139 | 2 x WD15EARS (JBOD)

laser21
Novice
Novice
Posts: 41
Joined: Mon Feb 01, 2010 9:57 pm

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by laser21 » Fri Mar 12, 2010 10:14 pm

plugins are actually here:

http://rutorrent.googlecode.com/svn/tags/plugins/
here is the correct link:
http://rutorrent.googlecode.com/svn/trunk/plugins/

I tried it with a different ipkg for my 109+ but didnt get it running... :(

rtorrent works fine, but connecting through the browser with port 8081 does nothing...
Last edited by laser21 on Sat Mar 13, 2010 4:31 pm, edited 1 time in total.

ser78
I'm New!
I'm New!
Posts: 6
Joined: Sun Feb 07, 2010 6:39 pm
Location: ptz, Russia

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by ser78 » Fri Mar 12, 2010 10:31 pm

laser21 wrote:plugins are actually here:

http://rutorrent.googlecode.com/svn/tags/plugins/

I tried it with a different ipkg for my 109+ but didnt get it running... :(

rtorrent works fine, but connecting through the browser with port 8081 does nothing...
may be the lighttpd does not start
NAS Synology DS210j | DSM 2.3-1139 | 2 x WD15EARS (JBOD)

laser21
Novice
Novice
Posts: 41
Joined: Mon Feb 01, 2010 9:57 pm

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by laser21 » Fri Mar 12, 2010 11:16 pm

how do I check if its running/stops running?

JD2k3
I'm New!
I'm New!
Posts: 7
Joined: Wed Nov 11, 2009 11:32 pm

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by JD2k3 » Sat Mar 13, 2010 1:45 am

laser21 wrote:how do I check if its running/stops running?
By running the following from the shell:

# ps aux | grep lighttpd

This should give an output like:

24394 root 1788 S /opt/sbin/lighttpd -f /opt/etc/lighttpd/lighttpd.conf

arbitrabbit
I'm New!
I'm New!
Posts: 7
Joined: Fri Mar 12, 2010 10:46 pm

Re: autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

Unread post by arbitrabbit » Mon Mar 15, 2010 6:17 pm

Unfortunately the init script of lighttpd kills all instances of lighttpd, not just the one running from /opt (so the mediaserver is killed as well). The pidof doesn't accept the -s option so was wondering if there is anyway to modify the script so that it only kills the lighttpd from /opt?

Post Reply

Return to “Torrent Engines/Download Station Mods”