Bittorrent Sync - not, er, syncing

Status
Not open for further replies.

voyager529

Dabbler
Joined
Jul 27, 2011
Messages
36
Hello everyone!

Here's my situation: I've got a Nas4Free box that's my primary NAS, built with identical hard drives, an LSI controller card, etc. I recently built a secondary box running ESXi that I've dubbed "The FrankenNAS", as it's an amalgam of whatever parts I had lying around. I just got done reading the threads on what a bad idea using non-ECC RAM is, so I'm completely aware that the FrankenNAS is the kind of situation that would get me yelled at quite loudly...which is why it's a pet project instead of anything I'm deeming "production grade", but I digress.

FreeNAS is a VM using 4GB of RAM with 4x800GB virtual hard disks assigned to it in a RAIDz configuration, otherwise fairly bone stock. It's got two datasets, mnt/nas/jails (playing with some plug-ins), and /mnt/nas/sync, where Bittorrent Sync was originally downloaded. Now what worked for me on the N4F box (where everything is happily functioning) was to make a new dataset, wget the .tar.gz file, extract it into a folder, and then add an init script that would run the executable at startup. N4F, things are perfectly happy. FreeNAS...not so much.

In my initial attempt to make this happen, I did basically the same thing. The application ran fine, I was able to access the browser interface and do my thing. The problem was simple - things weren't syncing. I couldn't get files to replicate, be it from my laptop or my other NAS. My first thought was that it was a permissions issue, so I chmod'd the whole dataset to 777 (yes, I know...), even though btsync was running as root (yes, I know...). Even under those circumstances, I couldn't get the FreeNAS box to pull files either from my laptop or my N4F unit, both of which have been happily talking for quite some time.

I came to the forums to look around, and it turned out that there was a PBI for the application. I downloaded it and ran the installer, but no luck. By "no luck", I mean "couldn't access the UI at all, let alone get files to transfer". I did add the folder in the 'sync' dataset to the fstab via the gui, but still no luck. I could see the plug-in, which was technically running, on the books...but no luck getting it to do anything else.

Google searching confirms my N4F experience, and leads me to believe that I'm not entirely inept and that I did perform the steps correctly. All machines were tested on the same LAN, with LAN searching explicitly enabled, including adding specific hosts. I also tried 'nudging' it by making a manual config file using nano and the template export, also to no avail.

I appreciate any and all assistance in this regard. Thank you in advance.

Joey
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I just downloaded and tested my btsync PBI and was able to sync data across my lan both from a Linux and Windows machine.
You couldn't reach the UI? Was the plugin able to start?
 

voyager529

Dabbler
Joined
Jul 27, 2011
Messages
36
Hey Joshua!

Thanks so much for getting back to me Sorry I took so long to respond. I did indeed have issues getting the plugin's UI to load, then I lost a hard drive, causing VMWare to wig out, so the 'pet project' died a fairly recent death. No data was harmed in the making of this train wreck.

That said, I did get some new components and just built my new NAS. It's having a slightly different-but-related issue with regards to installing plug-ins, so I shall resolve the underlying issue and report back with whether I can get the BTSync PBI to work correctly this time around.

Thanks for your response, and thanks for making it! =)

Joey
 

voyager529

Dabbler
Joined
Jul 27, 2011
Messages
36
Hey Josh!

So, bad news and good news.

Bad news: On the new build, the BT Sync plug-in doesn't work.

Good news: I found I didn't really need it.

Solution:

1.) Attached to this post is a RAR file. It's not a RAR file, it's the actual binary. download it and remove the extension.

2.) Make a folder somewhere on your NAS. In my case, it's /mnt/nas/sync (NAS is a dataset, 'sync' is a folder).

3.) Upload the btsync executable to the folder you just made.

4.) In the GUI, go to System->Init/Shutdown Scripts->Add Init/Shutdown Script.

5.) Add the following command:
Code:
cd /mnt/nas/sync && ./btsync

Adjust it based on the location of the btsync executable file.

Voila! BT Sync, running on port 8888 of your FreeNAS's IP address, that will run every time your NAS reboots. If you're going to make a config file, just put it in the same place as the executable and BT Sync will read it.

Advantages over the Plug-In version:
-Can access your filesystem without having to map location mountings.
-Runs as root, so no permissions issues.
-Doesn't require a jail, separate IP address, or additional RAM.
-System starts faster.

Disadvantages over Plug-In version:
-Runs as root, so it effectively ignores any permissions on the NAS box. Security conscious folks may not be happy with this, either.
-No separate IP address, so BT Sync traffic can't be routed separately.
-I don't know if it will update or not.
-No disabling/management from the main FreeNAS GUI.


I hope this helps someone!
Mods can mark this thread as 'solved', since my NAS units are happily replicating. Joshua, you are welcome to contact me if you'd like to troubleshoot my situation as an academic exercise.

Joey
 

Attachments

  • btsync.rar
    3.7 MB · Views: 286

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hey Josh!

So, bad news and good news.

Bad news: On the new build, the BT Sync plug-in doesn't work.

Good news: I found I didn't really need it.

Solution:

1.) Attached to this post is a RAR file. It's not a RAR file, it's the actual binary. download it and remove the extension.

2.) Make a folder somewhere on your NAS. In my case, it's /mnt/nas/sync (NAS is a dataset, 'sync' is a folder).

3.) Upload the btsync executable to the folder you just made.

4.) In the GUI, go to System->Init/Shutdown Scripts->Add Init/Shutdown Script.

5.) Add the following command:
Code:
cd /mnt/nas/sync && ./btsync

Adjust it based on the location of the btsync executable file.

Voila! BT Sync, running on port 8888 of your FreeNAS's IP address, that will run every time your NAS reboots. If you're going to make a config file, just put it in the same place as the executable and BT Sync will read it.

Advantages over the Plug-In version:
-Can access your filesystem without having to map location mountings.
-Runs as root, so no permissions issues.
-Doesn't require a jail, separate IP address, or additional RAM.
-System starts faster.

Disadvantages over Plug-In version:
-Runs as root, so it effectively ignores any permissions on the NAS box. Security conscious folks may not be happy with this, either.
-No separate IP address, so BT Sync traffic can't be routed separately.
-I don't know if it will update or not.
-No disabling/management from the main FreeNAS GUI.


I hope this helps someone!
Mods can mark this thread as 'solved', since my NAS units are happily replicating. Joshua, you are welcome to contact me if you'd like to troubleshoot my situation as an academic exercise.

Joey
on your host system and as root! not the way I'd do it, but your free to do it your way =P

I would be interested to see why my plugin isn't working on you system still. I wonder if anyone else is having issues cause it works perfectly for me?

you're running amd64 right?
 

voyager529

Dabbler
Joined
Jul 27, 2011
Messages
36
on your host system and as root! not the way I'd do it, but your free to do it your way =P
Well, being as it's running exclusively on the LAN at the moment, I'm cool with that. Besides, the nature of BT Sync means that its system access is not generally exploitable; since you're setting sync folders, it can only access those folders. Additionally, I think that while it runs as root by default, you can specify a user account in the config file that would determine which user account would instead be responsible for spawning bt sync. I don't see the harm in letting BT Sync run on the host system, though. Sure, it's got access to all the datastores in theory, but in practice, doesn't it only access the stuff you specify anyway? I mean, I know in broad principle it's a bad idea, but it's not like BT Sync accesses folders that aren't listed.

I would be interested to see why my plugin isn't working on you system still. I wonder if anyone else is having issues cause it works perfectly for me?

you're running amd64 right?


I'm indeed running amd64. If there is somewhere you want me to look in the log file, I'm totally down for figuring out why BT Sync isn't functioning as a part of the plug-in. I'm completely willing to believe that the problem is between the hard disk and the chair, but I am fairly certain I set everything I should care about regarding LAN settings and such. The browser UI never came up using the plug-in route. Let me know how I can be of assistance.

Joey
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Well, being as it's running exclusively on the LAN at the moment, I'm cool with that. Besides, the nature of BT Sync means that its system access is not generally exploitable; since you're setting sync folders, it can only access those folders. Additionally, I think that while it runs as root by default, you can specify a user account in the config file that would determine which user account would instead be responsible for spawning bt sync. I don't see the harm in letting BT Sync run on the host system, though. Sure, it's got access to all the datastores in theory, but in practice, doesn't it only access the stuff you specify anyway? I mean, I know in broad principle it's a bad idea, but it's not like BT Sync accesses folders that aren't listed.




I'm indeed running amd64. If there is somewhere you want me to look in the log file, I'm totally down for figuring out why BT Sync isn't functioning as a part of the plug-in. I'm completely willing to believe that the problem is between the hard disk and the chair, but I am fairly certain I set everything I should care about regarding LAN settings and such. The browser UI never came up using the plug-in route. Let me know how I can be of assistance.

Joey
how are you trying to access the GUI? did you try clicking on the link that popsup after clicking the plugins icon? did you manually edit the config file?

if you didn't and it's running it should show up on http://jailip:8888
running sockstat | grep btsync should reveal if the webgui is actually binding to that port
 
Status
Not open for further replies.
Top