OpenWrt Forum Archive

Topic: enhanced-ctorrent WEBIF

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

(This is the same post as I made on X-Wrt forum)

Hi, I am using OpenWRT for a while now, and now I'm using the X-Wrt extensions too. I am using my WL-5500GP as router, firewall and download client and datastore. So I am using samba to get access with windows clients. I searched a way to get aMule working on OpenWRT, and I found a Tutorial on it. (http://eko.one.pl/index.php?page=openwrt-amule).

I searched a while for a webif for ctorrent, I found webifs for ctorrent, but ctorrent is very buggy and very old. So I found enhanced-ctorrent in Unslung packages, that can be used for OpenWRT too. (http://www.nslu2-linux.org/wiki/Optware … edCTorrent)
But I could not find a webif for OpenWRT. So I searched other websites and I found one for Oleg's firmware, made by Seaky.

Yesterday I tried to install it on OpenWRT and It worked with only one change in the start script. You can find more info about Seaky's CTCS on his webpage (http://sctcs.seaky.hu/). Download it, and install it using ipkg.
Seaky is providing detailed infos about configuring his webif (he wrote an install pdf, downloadable from his webpage). The only file to config is /opt/etc/sctcs.conf

After you configured that, make two changees in /opt/etc/init.d/S90sctcs
Find BUSYBOX_HTTPD and change it to:
BUSYBOX_HTTPD=/usr/sbin/httpd

and in function stop()
killall busybox_httpd has to be changed to killall httpd

So that it is using the correct httpd. After that change you can launch the script by /opt/etc/init.d/S90sctcs start and it should work, you should have access trough the browser on the port specified by you in the config.

I found this the best way to control torrents, it is the webif using the better client ;-)

Greetz
fireandy

(Last edited by fireandy on 19 Mar 2007, 02:43)

Hello
i tried to install enhanced ctorrent but it returns a message about dependency with openssl and it does not install.

Please help.

OK i found it on http://ipkg.nslu2-linux.org/feeds/optwa … ss/stable/
Now i have another problem. enhanced-ctorrent denies running. It returns '-ash: enhanced-ctorrent: not found' but it has x attribute. :-((

(Last edited by simfun on 11 Apr 2007, 21:12)

OK i found it :-) You have to install ctorrent package along with enhanced-ctorrent.

Latest update on testing stcts..... CPU load is always on 100% during checking torrents. After that the Asus 500GP crashes and needs restart :-(

Have you enabled swap somewhere??

STCTS was working quite good for me with max. 4 torrents active, after enabling swap (You have to download some rc5 packages to get swapon working)

I found out, that the changes that I reported aren't optimal, because httpd is needed by the webif too..

No swap is not available at this time for me :-( Is it neccessary? I get the message SCTCS_E.RROR: Connection refused on sctcs screen

I dont think it is possible to really use ctorrent without swap.

For a working version without all kinds of dependency issues, and with explanation on using screen to use ctorrent in the background, I have made a tutorial here:
http://www.macsat.com/macsat/content/view/34/30/

The version used isnt excately new, but it works great at my place on a WL-500G Deluxe with an attached harddrive and swap enabled.

You can always create swap in a file on your disk / SD-card instead of creating a real partition - but you really do need to swap.

(Last edited by macsat on 12 Apr 2007, 09:54)

Hey macsat, nice to read something written by you in here. I like youre tutorials, you are one of the guys who brought me OpenWRT near...I learned a lot with this kind of support - with tutorials. Thanks for that.

The problem with your ctorrent is, that it isn`t accepted by all trackers, so I needed something better / newer... thatswhy I used enhanced ctorrent with this nice webif I found.

But currently I am testing around with additonal debian installation on hdd to let run mlonkey, that would be a target for me..

The one from my site is enhanced ctorrent, even if I write ctorrent on the pages. But it is getting old (dnh2 build), and you might be right about not all trackers supporting it.

Maybe I should try to make a new build....:-)

(Last edited by macsat on 12 Apr 2007, 20:10)

I enabled swap space but i keep getting message "SCTCS_ERROR: Success" on Status page until the torrent is fully downloaded.....

(Last edited by simfun on 13 Apr 2007, 00:55)

Take a look at Seaky's forum at http://sctcs.seaky.hu/, I think the message described by you is a debug output that Seaky has left in this build...

After a while, that I have tested around with other torrent webif or RemoteGUI solutions, I refined the SCTCS launch script, so that it is correctly launching its httpd instance and stopping it.
I am using latest enhanced ctorrent available (also if it is suggested by the author of SCTCS to use a 2.x version) with this modified start script:

#!/bin/sh
# Based on Oleo transmission_watchdog script for Transmission Package
. /opt/etc/sctcs.conf

PATH=/sbin:/bin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin
BUSYBOX_HTTPD=/usr/sbin/httpd
SCTCS=/opt/bin/sctcsd
HTTPD_CONF=/opt/etc/sctcs_httpd.conf
SCTCS_WEB_LOCATION=/opt/share/www

create_httpd_conf() {
  cat > ${HTTPD_CONF} << __EOF
A:*
__EOF
if [ ! -z "${SCTCS_HTTP_USER}" ]; then
  echo "/cgi-bin:${SCTCS_HTTP_USER}:${SCTCS_HTTP_PASSWORD}" >> /opt/etc/sctcs_httpd.conf
fi
}

start() {
  if [ ! -x "${BUSYBOX_HTTPD}" ]; then
    echo "sctcs httpd ${BUSYBOX_HTTPD} not started."
    exit 2
  fi
  create_httpd_conf
  echo "Starting sctcs httpd at port ${SCTCS_HTTP_PORT} ... "
  ${BUSYBOX_HTTPD} -c ${HTTPD_CONF} -p ${SCTCS_HTTP_PORT} -h ${SCTCS_WEB_LOCATION}
  if [ ! -x "${SCTCS}" ]; then
    echo "SCTCS not found on ${SCTCS}. Not started."
    exit 2
  fi
  echo "Starting SCTCS daemon at port ${SCTCS_PORT} ... "
  ${SCTCS} ${SCTCS_PORT} 1>${SCTCS_WEB_LOCATION}/sctcs.log &
  echo "done"
}

stop() {
    echo "Shutting down sctcs httpd... "
    for i in `ps -ax | grep ${BUSYBOX_HTTPD}' -c '${HTTPD_CONF}' -p '${SCTCS_HTTP_PORT}`; do kill $i; break; done
    echo "Shutting down sctcs daemon... "
    killall sctcsd
    echo "Shutting down enhanced ctorrent..."
    killall enhanced-ctorrent
    echo "done"
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        sleep 1
        start
        ;;
    *)
        echo "Usage: $0 (start|stop|restart)"
        exit 1
        ;;
esac

I am using a large swap file (about 2gb - used up to 200mb after a while), with the swap file enhanced ctorrent & SCTS are working stable.
The only problem that I have is, that I can't start this script by another script like a init.d script, I have to launch it manually by console, otherwise the httpd process "hangs" see this post: http://forum.openwrt.org/viewtopic.php?id=11326

Greetz
fireandy

The discussion might have continued from here.