This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
ruTorrent extension?
Moderator: crest
-
cp.engr
- Starter

- Posts: 22
- Joined: 09 Jul 2012 03:55
- Status: Offline
ruTorrent extension?
Hi all,
I'm looking into possibly making an ruTorrent (forums) extension for NAS4Free.
Questions:
1. Is anyone else already working on this?
2. Would others be interested in using it?
3. From what I understand, having it run in a jail is recommended--or is it required?
4. It's been suggested that I use the jails guide (link above), and use another extension as a template / example. Any other tips for how to do it?
(Yes, I know Transmission comes with N4F, but AFAICT, ruTorrent with its own plugins is more featureful--and better looking, IMHO.)
P.S. I know I'm new, but given the nature of the post, I took the liberty of posting it here (not in newbies). I hope that's okay.
I'm looking into possibly making an ruTorrent (forums) extension for NAS4Free.
Questions:
1. Is anyone else already working on this?
2. Would others be interested in using it?
3. From what I understand, having it run in a jail is recommended--or is it required?
4. It's been suggested that I use the jails guide (link above), and use another extension as a template / example. Any other tips for how to do it?
(Yes, I know Transmission comes with N4F, but AFAICT, ruTorrent with its own plugins is more featureful--and better looking, IMHO.)
P.S. I know I'm new, but given the nature of the post, I took the liberty of posting it here (not in newbies). I hope that's okay.
- raulfg3
- Site Admin

- Posts: 4865
- Joined: 22 Jun 2012 22:13
- Location: Madrid (ESPAÑA)
- Contact:
- Status: Offline
Re: ruTorrent extension?
2 - I´m interesing and aprecciate your efforts.
3 - not sure , but I think that is recommended, not requiered
3 - not sure , but I think that is recommended, not requiered
12.1.0.4 - Ingva (revision 7743) on SUPERMICRO X8SIL-F 8GB of ECC RAM, 11x3TB disk in 1 vdev = Vpool = 32TB Raw size , so 29TB usable size (I Have other NAS as Backup)
Wiki
Last changes
HP T510
Wiki
Last changes
HP T510
- ChriZathens
- Forum Moderator

- Posts: 758
- Joined: 23 Jun 2012 09:14
- Location: Athens, Greece
- Contact:
- Status: Offline
Re: ruTorrent extension?
Yes!!!
Thanks a lot for offering to do this!
I would definitely use it
I currently have one PC dedicated for downloader (rutorrent+rtorrent) . Perhaps I could get rid of it lol... (OK, maybe not - it has a lot more besides rtorrent)
Thanks a lot for offering to do this!
I would definitely use it
I currently have one PC dedicated for downloader (rutorrent+rtorrent) . Perhaps I could get rid of it lol... (OK, maybe not - it has a lot more besides rtorrent)
My Nas
Backup Nas: U-NAS NSC-400, Gigabyte MB10-DS4 (4x4TB Seagate Exos disks in RaidZ configuration - 32GB RAM)
- Case: Fractal Design Define R2
- M/B: Supermicro x9scl-f
- CPU: Intel Celeron G1620
- RAM: 16GB DDR3 ECC (2 x Kingston KVR1333D3E9S/8G)
- PSU: Chieftec 850w 80+ modular
- Storage: 8x2TB HDDs in a RaidZ2 array ~ 10.1 TB usable disk space
- O/S: XigmaNAS 11.2.0.4.6625 -amd64 embedded
- Extra H/W: Dell Perc H310 SAS controller, crosflashed to LSI 9211-8i IT mode, 8GB Innodisk D150SV SATADOM for O/S
Backup Nas: U-NAS NSC-400, Gigabyte MB10-DS4 (4x4TB Seagate Exos disks in RaidZ configuration - 32GB RAM)
-
Babovand
- Starter

- Posts: 46
- Joined: 23 Jun 2012 16:25
- Status: Offline
Re: ruTorrent extension?
I've managed to get the rutorrent web-front-end to start working, and connecting it to rtorrent/libtorrent with xmlprc, however, there is currently a bug in libtorrent that makes the CPU go up 200% when download in 0-400 KB/s this makes your machine unusable and of course the rtorrent/libtorrent hangs. As I dont posses the knowledge to compile and make the patch work (link below) im stuck until the developer updates the code, then wait for the new version port to be available. After that i will post a guide to add rTorrent and ruTorrent to N4F 
More about this here
https://github.com/rakshasa/libtorrent/pull/21
More about this here
https://github.com/rakshasa/libtorrent/pull/21
-
cp.engr
- Starter

- Posts: 22
- Joined: 09 Jul 2012 03:55
- Status: Offline
Re: ruTorrent extension?
Hi all,
Sorry for the delay. So much to do...
I researched, and spent some time in IRC...and it seems that there isn't an actual "plug-in" or "extension" framework to NAS4Free (like Firefox's Add-Ons, for instance, where you can install with a couple mouse clicks). There are ways to package things with custom installer scripts so that they are "extension-like", and you can make a php page for it to go under "Extensions" in the webgui. Jails are recommended for that, but I don't want to go there.
So instead of an extension-like package, I planned on getting it working for myself with simple pkg_adds and union_mounts, and then writing a howto. To that end, I do have rtorrent, rutorrent, and dtach installed in a NAS4Free VM, and I've started it running and connected to it, and things looked good before (although I think something broke recently)...
I still need to figure out how to run rtorrent (daemonized) automatically at startup. I think I can put a command in "System|Advanced|Command scripts" using sudo (so that it does not run as root) and dtach that should do the trick.
Babovand, a couple of things:
1. Since you mentioned writing a howto...well, I don't know if you want to try to work together, or let me do it, or race, or what...feel free to PM me if you want.
2. I haven't noticed the bug you described yet, but I haven't even put this on real hardware yet, and I've only downloaded a few files with it.
Sorry for the delay. So much to do...
I researched, and spent some time in IRC...and it seems that there isn't an actual "plug-in" or "extension" framework to NAS4Free (like Firefox's Add-Ons, for instance, where you can install with a couple mouse clicks). There are ways to package things with custom installer scripts so that they are "extension-like", and you can make a php page for it to go under "Extensions" in the webgui. Jails are recommended for that, but I don't want to go there.
So instead of an extension-like package, I planned on getting it working for myself with simple pkg_adds and union_mounts, and then writing a howto. To that end, I do have rtorrent, rutorrent, and dtach installed in a NAS4Free VM, and I've started it running and connected to it, and things looked good before (although I think something broke recently)...
I still need to figure out how to run rtorrent (daemonized) automatically at startup. I think I can put a command in "System|Advanced|Command scripts" using sudo (so that it does not run as root) and dtach that should do the trick.
Babovand, a couple of things:
1. Since you mentioned writing a howto...well, I don't know if you want to try to work together, or let me do it, or race, or what...feel free to PM me if you want.
2. I haven't noticed the bug you described yet, but I haven't even put this on real hardware yet, and I've only downloaded a few files with it.
-
Babovand
- Starter

- Posts: 46
- Joined: 23 Jun 2012 16:25
- Status: Offline
Re: ruTorrent extension?
Hi cp.engr!
Yes, forgot to tell all that what i've done is NOT an extension like this viewtopic.php?f=71&t=1278
As you described it is possible to make "extension-like" which installs all the ports necessary for rutorrent to work, however, I can only see more problems with this, since N4F is constantly updating we/someone may need to update that script when necessary. Thats why my how-to guide will be command copy-paste (as you said simple_pkg add commands).
Yeah jails are recommened, but I really dont understand why, its good if you run a system with multiple users and want to isolate them from each other and the system itself, but its a big waste of time and totally unnecessary for a home-owned media server/NAS, I doubt enterprise systems would ever consider installing Rtorrent, hence jails are unnecessary.
Also forgot to tell that i've managed to compile and patch libtorrent so I've fixed the 100 CPU issue in the link above. Rutorrent is amazing and should replace transmission.
We could work together on this, but, the FreeBSD or *BSD really love to complicate even the easiest of tasks, now, i cant seem to run the newest build .323 in vmware, getting stuck on the BTX loader, and since it do not want to play around with my real machine, im stuck.
Yes, forgot to tell all that what i've done is NOT an extension like this viewtopic.php?f=71&t=1278
As you described it is possible to make "extension-like" which installs all the ports necessary for rutorrent to work, however, I can only see more problems with this, since N4F is constantly updating we/someone may need to update that script when necessary. Thats why my how-to guide will be command copy-paste (as you said simple_pkg add commands).
Yeah jails are recommened, but I really dont understand why, its good if you run a system with multiple users and want to isolate them from each other and the system itself, but its a big waste of time and totally unnecessary for a home-owned media server/NAS, I doubt enterprise systems would ever consider installing Rtorrent, hence jails are unnecessary.
Also forgot to tell that i've managed to compile and patch libtorrent so I've fixed the 100 CPU issue in the link above. Rutorrent is amazing and should replace transmission.
Having problems with this also, tried both screen and dtach to make it work, it wont run as a command script, since that terminal that runs it will be "stuck" in the screen and dtach "mode" running rtorrent.I still need to figure out how to run rtorrent (daemonized) automatically at startup. I think I can put a command in "System|Advanced|Command scripts" using sudo (so that it does not run as root) and dtach that should do the trick.
We could work together on this, but, the FreeBSD or *BSD really love to complicate even the easiest of tasks, now, i cant seem to run the newest build .323 in vmware, getting stuck on the BTX loader, and since it do not want to play around with my real machine, im stuck.
-
the-razer
- Starter

- Posts: 26
- Joined: 09 Jul 2012 18:42
- Status: Offline
Re: ruTorrent extension?
Does rtorrent create a file in /etc/rc.d? If yes, you should do a unionfs mount there too and start it via this init script. Perhaps you have to enable it with something like rtorrent_enable=YES in rc.conf, which you can alter via the NAS4Free web gui.
-
Babovand
- Starter

- Posts: 46
- Joined: 23 Jun 2012 16:25
- Status: Offline
Re: ruTorrent extension?
Good Idea, but sadly it does not create any scripts/files in the rc.d folder, there are scripts out there in the web for FreeBSD, but they are not designed for N4F, and needs some editing.the-razer wrote:Does rtorrent create a file in /etc/rc.d? If yes, you should do a unionfs mount there too and start it via this init script. Perhaps you have to enable it with something like rtorrent_enable=YES in rc.conf, which you can alter via the NAS4Free web gui.
-
cp.engr
- Starter

- Posts: 22
- Joined: 09 Jul 2012 03:55
- Status: Offline
Re: ruTorrent extension?
Care to share with the class?Babovand wrote:Also forgot to tell that i've managed to compile and patch libtorrent so I've fixed the 100 CPU issue in the link above.
I mean, is the fix merged into the release, or did you merge and build it yourself? Please give details on whatever you did.
-
cp.engr
- Starter

- Posts: 22
- Joined: 09 Jul 2012 03:55
- Status: Offline
Re: ruTorrent extension?
Hey all,
I did get it working. I hope to post a HOW-TO draft here soon (within a few days/weeks). I have several open questions still. After we resolve enough of them, then I will make a new thread for the HOW-TO.
CPU usage does go kinda high sometimes, like 90% - 99% sometimes while downloading. Babovand, please let us know what you did to resolve this issue.
I did get it working. I hope to post a HOW-TO draft here soon (within a few days/weeks). I have several open questions still. After we resolve enough of them, then I will make a new thread for the HOW-TO.
CPU usage does go kinda high sometimes, like 90% - 99% sometimes while downloading. Babovand, please let us know what you did to resolve this issue.
-
Babovand
- Starter

- Posts: 46
- Joined: 23 Jun 2012 16:25
- Status: Offline
Re: ruTorrent extension?
I thought i was the only one that had the problem, did'nt know!cp.engr wrote:Hey all,
I did get it working. I hope to post a HOW-TO draft here soon (within a few days/weeks). I have several open questions still. After we resolve enough of them, then I will make a new thread for the HOW-TO.
CPU usage does go kinda high sometimes, like 90% - 99% sometimes while downloading. Babovand, please let us know what you did to resolve this issue.
It was quite complicated but I can explain what I did.
I downloaded FreeBSD 9.0 and installed it in a virtual machine, then i downloaded the source to the libtorrent port using make extract, edited the source code myself with a fix that was applied in the link about the issue, this fix has not yet been added by the developer, (https://github.com/Yamagi/libtorrent/co ... 7fcd264c53), when I was done i did make build (for compile the "new" libtorrent", then make install (to install it), after the install was complete I made a package file (pkg_create) and uploaded the package to my N4F machine and installed it with pkg_add.
Anyhow...i uploaded the fixed libtorrent here on dropbox so you can just upload it yourself and pkg_add it to your system
https://www.dropbox.com/s/un7np6yrpfnvp ... 0.13.2.tbz
And btw it might fail for you due to a package that is installed in N4F that is old, just replace this package with the version that it demands or higher, this occurred because the newer version of that package was on the FreeBSD machine when i compiled libtorrent, cant remember what the name of the package was, but I remember that i fixed it easy, you might have to replace several,
wow i just loved Free*BSD when that happend, Im very new to the *BSD operating system, and to be honest so far it has been a pain in the ass, but love ZFS, and N4F ofc
EDIT: if you want more details on all the commands i did for applying the fix, I could write it here, but at the time of writing iam (was) tired, and i uploaded i fix so i thought it would be unnecessary
EDIT2: You will need another 2 packages that i forgot to upload, the pkg_conf package was the packages that needed to be replaced, the one i forgot about.
Anyhow here is the links for all package files required.
libtorrent-0.13.2.tbz
https://www.dropbox.com/s/un7np6yrpfnvp ... 0.13.2.tbz
libsigc++-2.2.10.tbz
https://www.dropbox.com/s/b05ra0m2jzst5 ... 2.2.10.tbz
pkgconf-0.8.9.tbz
https://www.dropbox.com/s/9utwdcil32e8q ... -0.8.9.tbz
Last edited by Babovand on 18 Oct 2012 06:20, edited 1 time in total.
-
cp.engr
- Starter

- Posts: 22
- Joined: 09 Jul 2012 03:55
- Status: Offline
Re: ruTorrent extension?
Just to be clear, it's not all the time for me, but sometimes.Babovand wrote:I thought i was the only one that had the problem, did'nt know!cp.engr wrote:CPU usage does go kinda high sometimes, like 90% - 99% sometimes while downloading. Babovand, please let us know what you did to resolve this issue.
Is the file you uploaded a package, or a port? I thought that packages are binaries, and that ports are source...but inside the tarball I see both.Babovand wrote:It was quite complicated but I can explain what I did.
I downloaded FreeBSD 9.0 and installed it in a virtual machine, then i downloaded the source to the libtorrent port using make extract, edited the source code myself with a fix that was applied in the link about the issue, this fix has not yet been added by the developer, (https://github.com/Yamagi/libtorrent/co ... 7fcd264c53), when I was done i did make build (for compile the "new" libtorrent", then make install (to install it), after the install was complete I made a package file (pkg_create) and uploaded the package to my N4F machine and installed it with pkg_add.
Will the file you posted also work on NAS4Free 64-bit 9.1.0.1 - Sandstorm (revision 344) / FreeBSD 9.1-RC2 (reldate 901000)? Or is the patch even already included there?Babovand wrote:Anyhow...i uploaded the fixed libtorrent here on dropbox so you can just upload it yourself and pkg_add it to your system
https://www.dropbox.com/s/un7np6yrpfnvp ... 0.13.2.tbz
Thanks for sharing.Babovand wrote:And btw it might fail for you due to a package that is installed in N4F that is old, just replace this package with the version that it demands or higher, this occurred because the newer version of that package was on the FreeBSD machine when i compiled libtorrent, cant remember what the name of the package was, but I remember that i fixed it easy, you might have to replace several,
wow i just loved Free*BSD when that happend, Im very new to the *BSD operating system, and to be honest so far it has been a pain in the ass, but love ZFS, and N4F ofc
I'm interested in learning some more, if it's not much trouble for you to share some of the details.Babovand wrote:EDIT: if you want more details on all the commands i did for applying the fix, I could write it here, but at the time of writing iam (was) tired, and i uploaded i fix so i thought it would be unnecessary
-
Babovand
- Starter

- Posts: 46
- Joined: 23 Jun 2012 16:25
- Status: Offline
Re: ruTorrent extension?
The high CPU issue only kicks in when downloading/uploading a torrent, even at low speeds the CPU will get high usage, try and you will see.Just to be clear, it's not all the time for me, but sometimes.
Only packages can be installed with pkg_add, so yes its a package :p, the package is created from a port (like all packages are), the libtorrent (port) source code.Is the file you uploaded a package, or a port? I thought that packages are binaries, and that ports are source...but inside the tarball I see both.
The inside of the tarball is not the package, the tarball itself IS the package!
( pkg_add libtorrent-0.13.2.tbz ) is the command to install libtorrent, libtorrent-0.13.2.tbz being the file I posted.
I would'nt have uploaded it if it was not includedWill the file you posted also work on NAS4Free 64-bit 9.1.0.1 - Sandstorm (revision 344) / FreeBSD 9.1-RC2 (reldate 901000)? Or is the patch even already included there?
The libtorrent program/package dosen't care which version of FreeBSD that its using, no package/port/porgram does, as long as the operating system can support the functions of the program, and yes it will work as Iam using it myself at the moment with NAS4Free 64-bit 9.1.0.1 - Sandstorm (revision 344).
The file i posted is a compiled package with the patch included (compiled) so you or anyone else don't have to download the port, edit the source code, then compile it, and then create a package, the work is alredy done (by me :p), just add the package and you will have the fixed libtorrent
Okey, will do this soonI'm interested in learning some more, if it's not much trouble for you to share some of the details.
-
Babovand
- Starter

- Posts: 46
- Joined: 23 Jun 2012 16:25
- Status: Offline
Re: ruTorrent extension?
For this to work you need FreeBSD 9.0 or 9.1 dont matter , installed in a real machine or vmware/virtualbox, 15GB space minimum, just to be safe.(not Nas4Free, the real FreeBSD 9.0/9.1 operating system)cp.engr wrote:I'm interested in learning some more, if it's not much trouble for you to share some of the details.Babovand wrote:EDIT: if you want more details on all the commands i did for applying the fix, I could write it here, but at the time of writing iam (was) tired, and i uploaded i fix so i thought it would be unnecessary
Okey after you have installed it, you need to download and upgrade the ports, this will take alot of time, so go do some coffee or tea while you wait.
Code: Select all
portsnap fetch
portsnap extract
portsnap updatenow cd into the libtorrent port directory and download the source code using make extract.
Code: Select all
cd /usr/ports/net-p2p/libtorrent
make extracthere you can edit the source code, i will not go in detail on how to do this, i used nano and edited the right file with the patch that i've linked before.
Code: Select all
cd /work/libtorrent-0.13.2Code: Select all
cd /usr/ports/net-p2p/libtorrent
make buildCode: Select all
make installCode: Select all
pkg_infoCode: Select all
pkg_create -Rb libtorrent-0.13.2_1Code: Select all
lsIf you have edited the source code exactly as i did, you will now have the same package tarball as i've alredy uploaded, and this method works with any port/program.
If packages did'nt exist, we all would have to compile each program and install them, and if its a slow machine it could take forever just to install a couple of programs. with package, this process becomes almost instant.
Now transfer your new package file with SFTP/FTP/USB whatever you want to use, to the machine you want to install libtorrent on.