Post 

Software

Torrential, now updated.

Torrential
Torrential, Web-interface for enhanced-ctorrent and possibly other command line torrent clients. It's designed to run on embedded systems with appweb such as the NSLU2, but can be potentially installed on any system with php and enhanced-ctorrent (tested with version dnh3.1-9 only). Please leave a comment if you tried it on any other system. I am still working on GPLing the code, so be patient. I am using the config script and some ideas from a early version of Kai-T's torrent interface, however it's a complete rewrite except for the configuration read/write script.

Update:
I decided to post a preview release. It's not tested, because i am not able to test properly right now (my overseas download speed at home in Shanghai is about 2kb/s right now with an enormous package loss). The code needs a clean-up, there's no installation manual and i borrowed some pieces of code from other projects, which will expect a proper attribution. If you decide to try this, please let me know how it went. Since this is just an Web interface, you need to have enhanced-ctorrent installed, i did not try to use ctorrent.

Update 07.07.07: I fixed problems with recent version of enhanced-ctorrent. Make sure you use the latest version "dnh3.1-9". Do ipkg update; ipkg upgrade enhanced-ctorrent
Update 25.07.07: Fixed the link in the installation howto... sorry.
Update 17.08.07: Quick fix in inc_functions.php for the stupid, no options "ps".
Update 21.01.09: Included many fixes, most stable release to date ;-)


Get the current Version from: Torrential on Google Code, License: GPL 2.0

Please Use the comments here or on my Torrential Google Code page to report bugs. Use the issues function of google code to submit screenshots, fixes, patches, etc! Thanks a lot!


Quick Installation HowTo on NSLU2 with Unslung 6.8:
ipkg update
ipkg install enhanced-ctorrent
ipkg install appweb
/opt/etc/init.d/S81appweb restartcd /opt/var/appWeb/web/

#get the latest link from the google code site linked above, example:
curl
-O http://oz4projects.googlecode.com/files/torrentialxxxxxxx.zip
unzip torrential*.zip
chown -R nobody.everyone torrential/
mkdir /public/torrent/
chmod 777 /public/torrent/
vi inc_config.php #(have a look inside)
# visit: http://nslu-ip:7777/torrential/index.php
# user: giveme pass: torrent
# click on Help.

53 Comments

Hello from a new-slugger from Toronto, Canada!

I'm new to Linux. For the life of me, I can't figure out how to add Curl. This is the error message I get when I try to do this line:

# curl -O http://pugio.net/wp-content/uploads/2007/01/torrential.zip
curl: No such file or directory

I like the work you're doing. Keep it up. I will comment on how your stuff works if I can figure out how to install it!

Regards.

Hi, try:
wget http://pugio.net/wp-content/uploads/2007/01/torrential.zip

also if you get "unzip: No such file or directory", do:
ipkg install unzip

Hi,
i liked your webinterface for enhanced-ctorrent. I took the source code and added some features like adding a queue and timecontrolled upload-speed. I don't have the possibility to publish the source, so if you are interested in it, pleas contact me by mail.

Regards

Hi,

I got Torrential installed on my slug which has a (slightly) customized appweb (non-standard web root) and I'm getting the following error when I try to start a torrent:
Warning: fopen(/public/torrent//freevo-1_1_.7.0.tar.gz.stat) [function.fopen]: failed to open stream: No such file or directory in /public/wwwroot/torrential/dyn_progress.php on line 31

Warning: fseek(): supplied argument is not a valid stream resource in /public/wwwroot/torrential/dyn_progress.php on line 33

The inc_config.php file says $download_path SHOULD end with a slash, and the "Starting torrent" msg at the top of the screen looks right, but then the fopen errors out with the double "/".

Is that really the issue or am I missing something else all-together?

Thanks.

(P.S. I'm available for some testing if you need it.)

JMVDW,

first, make sure you have the torrent directory, per default, mkdir /public/torrent

second, check if it's writable by appweb, chmod 777 /public/torrent

third, check if you have the right path and filename to enhanced-ctorrent in the config

finally, if it still does not work, then probably something is wrong with enhanced-ctorrent or the way i start it.

ssh to your nslu2, and restart appweb, /opt/etc/init.d/S81appweb
don't logout, go to the interface and start a torrent. you should get some output from appweb in your ssh session with more info.

last idea. check if you have the nice command. I am not sure if i included nice in Torrential in the released version or not... if you don't have it, set nice to 0 in the config or install it

Paul

Paul,

Thanks for the reply:
1) Default folder /public/torrent did exist
2) Default folder /public/torrent was already 777
3) I restarted appWeb. When I first hit Torrential's index.php SSH gave me an "uptime: No such file or directory" message. Logging in gave me 2 of those messages. Stopping a torrent didn't cause any output in the SSH window. Starting a torrent gave me a "nohup: No such file or directory" error.

I should mention that I have done manual torrents using:
enhanced-ctorrent -C 1 -U 10 -e 1 freevo-1_1_.7.0.tar.gz.torrent

On my NSLU2 the only uptime I have is part of busybox (busybox uptime) so I tweaked the `uptime` call in tpl_footer.php to be `busybox uptime` - now that error's gone and I get uptime in my footer.

I see that I need coreutils to get nohup, but "ipkg install coreutils" conflicts with "busybox-links". I tried to uninstall busybox-links but got a "No packages removed. Nothing to be done." msg - the coreutils install produces the same error. Sigh.

I tried a -force-overwrite install of coreutils but got the same error so I finally did a -force-depends install of coreutils. Now I have nohup and everything seems to be working! I wonder what I broke in busy-box... :-)

Thanks for the tip about the stdout/stderr stuff on the SSH session!

(P.S. I now have a non-busybox uptime but it give sme the error below so I left my busybox uptime call in the footer:
"uptime: couldn't get boot time: No such file or directory"

Paul,

Sorry for the double post but I wanted to add that coreutils gave me nice so I went ahead and put the default $priority of "12" back in. No errors came up so it looks like all my problems were lack of the "cureutils" package.

Oh - and I added a " -p".$port parm to $command in inc_functions.php and $port="" in inc_config.php so I could use a non-standard port.

And since my memory isn't so great I added some tooltips to the Running Torrents lists to make my poor brain work less. :-)

Hello here from Germany,
and thanks for the nice webinterface. I tried it out on a WL500gP and it seems to work although I found similar version on the NS2LU Forum.

@Tom
Can you send me your extended version?
Sincerly
Oliver

Hello there,

“uptime: couldn’t get boot time: No such file or directory” message as well. Torrents are definely starting and completing on my NSLU2, but I can't see the status in the web UI...Any help would be appreciated!

Thanks,
Norm

Hi Norm,

edit tpl_footer.php and replace

With nothing or whatever you want. This should solve it.

Paul,

I managed to solve the uptime problem. Torrents are starting but I'm not receiving any status updates via torrential (all I can see is the torrent name and "0% // K/s"). Torrents are downloading (I can see status via ctcs). Any ideas?

Thanks,
Norm

can you confirm your version? I guess the output is different between the versions and the parser gets confused. I will try to have a look on weekend...

# ipkg info enhanced-ctorrent
Package: enhanced-ctorrent
Version: dnh2.2-6
Depends: libstdc++, openssl
Status: install user installed
Section: net
Architecture: armeb
maintainer: Fernando Carolo
MD5Sum: a53c008073b1b943665c3114745d280a
Size: 61730
Filename: enhanced-ctorrent_dnh2.2-6_armeb.ipk
Source: http://www.rahul.net/dholmes/ctorrent/ctorrent-1.3.4-dnh2.2.tar.gz
Description: Enhanced CTorrent is a revised version of CTorrent

I'm using Release dnh3.1

I will try to fix it, there seems to be something wrong in calling it from php. Give me some time.

Hi,

I have a simular prob to JMVDW. The error get is

Warning: fopen(/public/torrent//video.stat) [function.fopen]: failed to open stream: No such file or directory in /opt/var/appWeb/web/torrential/dyn_progress.php on line 29


Warning: fseek(): supplied argument is not a valid stream resource in /opt/var/appWeb/web/torrential/dyn_progress.php on line 30

I also get the following messages from my running telnet session :-
After uploading the torrent file
uptime: No such file or directory

After starting the torrent
nohup: No such file or directory

I have also install coreutils but still get the same errors.

Please could you offer me any advice.

thanks

Hi,

**** UPDATE ****
I tried uploading the torrent again after I rebooted the slug and it worked a treat. the issue I have now is that I do not get percentage complete or S/L/P information.

Do you know what the problem could be?

Thanks, Steve.

Hi Steve,

thanks for trying it out. I will change torrential in the future, so people don't need to have uptime or nohup... I developed it on my nslu2 and thought all those standard goodies were on all nslu2s :-)

As for the problem, it's the same as above you. I will fix it when i have time, which is difficult to arrange these days... let's see if i can do it this weekend.

For me the same problem. Quote "(all I can see is the torrent name and “0% // K/s”)"

installed the "old" enhanced-ctorrent 2.2.6.

Package: enhanced-ctorrent
Version: dnh2.2-6
Depends: libstdc++, openssl
Status: install user installed
Architecture: armeb
Installed-Time: 1183730311


Does anyone got Torrential fully working?

regards,

MJ

I have to take back my comment. It works fully with enhanced-ctorrent v2.2.6

:-)

Looks Greet!

MJ

Fixed it.

Can somebody tell me if you have "nice" on your system?

Run: nice --version

Tried it. Works now. However when I use the nohup command, the status does not show. Thanks for all the work!!!!

Norm

Tried it, works a treat. Thanks for you quick response.

I reflashed my slug yesterday and unslung to another, larger flash disk. now the uptime doesn't work. If I type in uptime from a telnet session I get this message:-

uptime: couldn't get boot time: No such file or directory

Any idea's


Steve

I removed uptime from the footer, since it's not default on nslu2. If you want it back, put in the footer file.
This should install uptime: ipkg install uptime

However, I suggest you install the busybox-base package, it will give you a second busybox in /opt/bin/busybox with a wider range of applets. (including /opt/bin/busybox uptime)

I've installed busybox-base but still cannot get the uptime working. I think I'm getting the syntax wrong. Here's my tpl_footer.php. Can you let me know where i'm going wrong.


Please seed

Try this:

You need to specify the full path to busybox, because the regular one in /bin/busybox cannot display uptime.

Uptime now works again, thanks for your time and support. I have downloaded several torrents now using Torrential. Now I don't have to have the PC on 24/7 and the missus has stopped moaning.

Thanks again.

Amazing work!
Works like a charm right out of the box. :)
Thanks mate.

Hi there
i used to install apache instead of appweb
n i got torrential running

but when i try to upload a torrent just get
Could not copy the Torrent

what is wrong

Can u help me pls
Marv

1. Make sure all directories are writable by the server (chmod 777 /public/torrent, or wherever you decided to download to)

2. Reconsider you usage of apache, it's an extreme resource hog and really not suitable to be run on the nslu2.

lo paul!

i just wanted to put a BIG (and i'm really no fan of caps) THANKS in here. torrential is just working (here on a NSLU2 on cherokee webserver with php-fcgi) like a charm.
great job.

zyro

Installed your php scripts. Looks good!
I am running appweb, busybox 1.1.3 on an asus wl500gp.

I can upload and start a torrent, but in my 'screen' session i get a problem related to 'ps'
The torrent seems to download for a few seconds, but stops prematurely.

My busybox version doesn't accept any parameters with 'ps'. Are they needed?

Can you tell me which versions you are using for busybox, php and appweb?

Thanks in advance.

Ad.

BusyBox v1.5.0 (2007-03-27 21:40:36 PST) multi-call binary

Mbedthis AppWeb: Version: 2.1.0

PHP 5.2.3 (cli) (built: Jun 27 2007 11:47:57)

------

I changed to code to run with any ps, you need to have grep though... :-) Download again and replace the inc_functions.php in your install

Hi Paul,

I downloaded the zip file again, but inc_functions.php looks unchanged to me.

Did you upload the correct file?

Yes, I did :-D check your cache, to be sure use a different browser. the inc_functions should have todays date

you can also change the isRunning function:

$PID="ps| grep `cat ". escapeshellarg( $download_path."/". $torrent .".pid" ) ."`| grep ctorrent";

Hi Paul,

The problem with 'ps' solved, but the original problem is still there. The torrent starts, but after
a fe seconds goes to 'stopped'.
I have upgraded enhanced torrent to version dnh3.1.9.

Can you make sense of the 'error.log' of AppWeb?

GET /torrent/dyn_progress.php HTTP/1.1
request:3 main 8: 10.0.0.149:81: is the serving host
request:3 main 8: response: >>>>>>>>>>>>
HTTP/1.1 200 OK
Date: Sat, 18 Aug 2007 16:07:48 GMT
Server: Mbedthis-AppWeb/2.1.0
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Content-type: text/html
ETag: "466ead-859-468f54b7"
Content-length: 110
Connection: keep-alive
Keep-Alive: timeout=60000, max=191
X-Powered-By: PHP/5.2.2
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache

request:3 main 8: finishMaRequest: Attempting keep-alive
request:3 main 9: Request from 10.0.0.154:2016 to 10.0.0.149:81
request:3 main 9: parseFirstLine:
>>>>>>>>>>>
HTTP/1.1 200 OK
Date: Sat, 18 Aug 2007 16:07:48 GMT
Server: Mbedthis-AppWeb/2.1.0
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Content-type: text/html
ETag: "466eab-a9e-468f5495"
Content-length: 1831
Connection: keep-alive
Keep-Alive: timeout=60000, max=193
X-Powered-By: PHP/5.2.2
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache

request:3 main 9: finishMaRequest: Attempting keep-alive

Is there any way i can check what goes wrong?

I assume enhanced-ctorrent works if you launch it on the console. Try lowering the cache_size or have a look at the comment: "pk on March 6th, 2007 5:19 am" for a way to get more details. You can also open the .stat file and see if there's any info at the end.

Hi Paul,

I see that the torrent starts ok when i do a 'ps' in a screen session.
If i do 'ps' again quickly, i see this:

sh -c cd '/opt/var/appWeb/web/torrential' ; ps| grep `cat '/tmp/harddisk/torrent//bean.pid'`| grep ctorrent

and the the torrent dies...

Is the 'sh' command ok?

Hi Love the layout of torrential but cant get
any torrent to start?
Have these 2 versions installed on my fsg3

CTorrent dnh2.2
/bin/ctorrent
Enhanced CTorrent dnh3.2
/opt/bin/enhanced-ctorrent

Uploads the torrent ok to folder I get the message
at the top saying starting but then it goes back
to the not running section?

The fsg3 nativly runs apache...
have ipkg installed nice, ctcs

cant chown -R nobody.everyone torrential/
as the group does not exist on the fsg

any help?

Hi,

enhanced ctorrent will fail if the download directory is not writeable.
if you don't know the user and group of your server, do:

chmod 777 directory

where directory is the full path to your download directory, not the
directory where torrential is located.

you have to use /opt/bin/enhanced-ctorrent, torrential was not tested
with ctorrent and most likely will fail without some changes to the
code.

let me know if you still have problems to start

As of enhanced_ctorrent dnh3.2 the stat files seem to grow rapidly!
Either this has to do with the improved buffering, or some parameter just went crazy.
This causes the status display to fail (I presume OOM with .stat files >100MB)

Generally, isn't there a way to reduce the stat file to a single line, or even use a pipe for the output to preserve precious memory (on the nslu2) to avoid parsing the whole file for the display of the status?

Hi there
i got torrential installed on my nslu2 n i can log into it
when i upload a torrent it tells me torrent uploaded n then i see the torrent under stopped.

but when i push start button the cirle runs but nothing happens

what is goin wrong?

Greets
Marvx

Its working for me, but the files arnt removable for me. Is there a way to chmod 777 them automaticly.

Sollie.

I just installed your web-interface on my gentoo box. (headless - via ssh). It works like a charm out of the box.
I am currently using apache2 + php.
I did chown apache:apache for the torrential directory.

Thank you very much, keep up the great work!

hasardeur

Hi
Now have torrential working on FSG-3
with v4.27 beta firmware and enhanced-ctorrent dnh3.2.

Great tool! Any plans to implement queue for downloads? Or schedule when torrent downloads are active for example from midnight to 8 am.

Hey Miikka, sorry no plans for that. as i am quite busy with other things i don't have time to work on torrential (it does what i need it to do ;-)). but if anyone is willing to continue extending torrential, i can offer to host his changes, or to link to his version

Nicely done.. Just what I was looking for..
Actually I use this with lighttpd on a NSLU2..
Love it..

Uh I have one problem.. After rebooting the NSLU2 the torrents are gone from the webinterface (still on the drive..)! If I try to reupload it says that the torrent is already there but it's still not on the list. It there any way of getting them back?


eatfishdk at gmail you-know-the-drill

Hi just like to say lovin the gui but
after say 2 hours of a torrent running the
torrential index page fails to load i think this is due to the size of the stat files as posted By fizze on August 24, 2007 11:41 AM ....
Is there any way to solve this ?

Regards
Pete

Yes, there is - but i had no time to fix it :-)

Check out the comment here: http://code.google.com/p/oz4projects/wiki/Torrential

I have tried to download torrential but seem to have some problems.
I have used wget command ,but it just says Connecting to pugio.net[69.64.34.176]:80
Nothing else happens then. Also tried curl -O with no luck.
Is there a directory on the Unslung NSLU2 where I can put the torrential.zip myself and cotinue from the unzip command?

Torrential is great, much easier to set up than transmission / clutch, and a lot better than sshling into rtorrent. Running on my unslung slug on lighttpd no problem.

I'll check out the source if i get time, a torrent queue would be very handy, as would a separate "done" queue.

Thanks.

Hi, i installed ctorrent, torrential and everything thats needed to download torrents.
i have the chmod 777 the download folder.. web interface starts normaly, i see the torrent files i put into the download folder, but when i hit "start download" it writes " starting .... but nothing happens, adding and deleting works (it deletes the torrent file from the web interface, but still in download folder)

i tryed to start a download via ctorrent blabla.torrent.. and this works fine

any ideas? (web app also works!)

Leave a comment

Creative Commons License
This weblog is licensed under a Creative Commons License.