Debian And Ubuntu Server Unofficial Packages For Bittorrent Sync


Recommended Posts

The GeeXBoX distribution is based on OpenBricks and the devs already created a BTSync package, I wanted to have one like yours without UI support, with instances and webUI support. Perhaps this is not that hard to do by copying your init script.. just not sure how you disabled the UI.

I will check with the dev from GeeXBoX first, he is already working on a how to guide to help others create OpenBricks packages. with your permission I would like to give it a try to create something like your package for this platform.

Ā 

There was no need to disable the UI: the Linux version only has the Web UI and no other component. You're welcome to use all of my code/scripts, since it is Open Source. You will find everything you need on the GitHub project page.

Link to comment
Share on other sites

The WebUI doesn't work for me on my webserver, I think it gets lost somewhere in the current Apache/Nginx config.

Ā 

So I wanted to add a shared folder by doing it with a .conf file. Created a folder and added the secret key from a folder on my other server. Everything looked right, so I was happy.

Ā 

But after I created the new .conf file in /etc/btsync/ and restarted the service, I got an error: "Failed to start btsync instance x - please check the configuration file /etc/btsync/x.conf". But I can't find what's wrong.

//!/usr/lib/btsync/btsync-daemon --config//// DAEMON_UID=btsync// DAEMON_GID=btsync// DAEMON_UMASK=002{        "storage_path" : "/var/lib/btsync/",        "check_for_updates" : false,        "display_new_version": false,        "disk_low_priority" : true,        "lan_encrypt_data" : true,        "rate_limit_local_peers" : true,        "folder_rescan_interval" : 600,        "folder_defaults.delete_to_trash" : true,        "folder_defaults.use_dht" : false,        "folder_defaults.use_lan_broadcast" : true,        "folder_defaults.use_relay" : true,        "folder_defaults.use_tracker" : true,        "folder_defaults.known_hosts" : "","shared_folders" :  [    {      "secret" : "****", // required field - use --generate-s$      "dir" : "/folder/", // * required field    }  ]}
Edited by Tralapo
Link to comment
Share on other sites

...

But after I created the new .conf file in /etc/btsync/ and restarted the service, I got an error: "Failed to start btsync instance x - please check the configuration file /etc/btsync/x.conf". But I can't find what's wrong.

...

Ā 

You have some syntax errors in your configuration file. Remove the comments after the secret and the comma after the folder.

The resulting file should look like:

Ā 

//!/usr/lib/btsync/btsync-daemon --config//// DAEMON_UID=btsync// DAEMON_GID=btsync// DAEMON_UMASK=002{        "storage_path" : "/var/lib/btsync/",        "check_for_updates" : false,        "display_new_version": false,        "disk_low_priority" : true,        "lan_encrypt_data" : true,        "rate_limit_local_peers" : true,        "folder_rescan_interval" : 600,        "folder_defaults.delete_to_trash" : true,        "folder_defaults.use_dht" : false,        "folder_defaults.use_lan_broadcast" : true,        "folder_defaults.use_relay" : true,        "folder_defaults.use_tracker" : true,        "folder_defaults.known_hosts" : "","shared_folders" :  [    {      "secret" : "****",      "dir" : "/folder/"    }  ]}
Link to comment
Share on other sites

Ā 

You have some syntax errors in your configuration file. Remove the comments after the secret and the comma after the folder.

The resulting file should look like:

Ā 

Thanks for your help. I did what you said, but still get the same error: Failed to start, please check the configuration file.

Link to comment
Share on other sites

When upgrading to a new release of Sync (currently running 1.4.93 Beta), I lose all my set up, no sync folders are listed in the web UI.

Ā 

I guess the configs are in the hidden .sync folder (below the folder containing the executable), but is it safe simply to copy the contents of .sync to the newly installed release? Should I also copy the SQLite databases and associated files (3 files per symc'd folder)?

Ā 

(I'm running Linux Mint 17 Xfce)

Edited by driftwood
Link to comment
Share on other sites

I'm probably in the wrong thread with my question... sorry about that. :)

Ā 

Anyway, I put the same question to BitTorrent support and here's their reply:

Yes, you may copy the content from local storage (.sync folder near binary) of older version to that of newer version. This can be done only within one PC.
Before copying it, make sure you quit Sync.
Or you may simply replace older binary with newer binary.

Ā 

I copied the binary as instructed and it worked OK.

Link to comment
Share on other sites

  • 2 weeks later...

I'm pleased to announce a new version of the BitTorrent Sync server package. Users of the YeaSoft repository will get the new package immediately. Users of the Launchpad PPA have probably to wait for a few hours...

Ā 

btsync (1.4.1-1) unstable; urgency=low  * Removed check for mandatory disablement of misinterpreted    "check_for_updates" setting (Closes #170)  * Fixed redundant restart messages (Closes #166)  * Added support for modular configuration files (Closes #124)  * Updated debconf localisation from poeditor.com - Thanks to all    volunteers -- Leo Moll <leo.moll@yeasoft.com>  Sat, 06 Dec 2014 14:52:11 +0100
Link to comment
Share on other sites

Thank you for your great work!

Ā 

There is something where I'm not sure whether it's a bug or a feature:

Ā 

The recent update (normally via apt-get update/upgrade) created a new debconf-default.conf configuration file and afterwards restarted the service with two instances - both my own configuration and the default configuration. That's annoying because I had to stop the services manually and delete the new default conf file again and then restart the services.

Ā 

I have no clue about packaging, but could you implement a check that there is no other conf file in /etc/btsync before writing a new one?

Link to comment
Share on other sites

There is something where I'm not sure whether it's a bug or a feature:

Ā 

The recent update (normally via apt-get update/upgrade) created a new debconf-default.conf configuration file and afterwards restarted the service with two instances - both my own configuration and the default configuration. That's annoying because I had to stop the services manually and delete the new default conf file again and then restart the services.

Ā 

It is a feature and you should read the documentation (e.g. the first posting in this thread) to understand how it works. In any case: look at the beginning of the file

Ā 

//!/usr/lib/btsync/btsync-daemon --config//// Default instance automatically created by debconf//// DO NOT EDIT THIS FILE MANUALLY - SERIOUSLY!!!//// THIS FILE WILL BE OVERWRITTEN AT EVERY UPDATE// OR RECONFIGURATION SO DO NOT EVEN TRY IT//// USE dpkg-reconfigure btsync INSTEAD TO MODIFY// THE CONFIGURATION

The file is created, because on the initial installation you chose that you want debconf to maintain a default instance. If you do not want this, or you want to reconfigure your default instance, you have to execute dpkg-reconfigure to change this behaviour.

Ā 

Since you prefer to maintain you own configuration file, please execute:

Ā 

dpkg-reconfigure btsync

and answer no to the first question ("Do you want to define a default BitTorrent Sync instance?").

Link to comment
Share on other sites

  • 2 weeks later...

I have had tuxpoldo's server version running on my Rpi for a long time now, mostly problem free, but since the last two? updates I've been having lots of problems. Is there any way to reinstall earlier versions of the unofficial server package like V1.4.0-3 ?

I tried `which sudo` apt-get install btsync=1.4.0-3 for example but I get unable to locate package errors. Does this mean that old packages are removed from the server when new ones are added?
Ā 
Link to comment
Share on other sites

  • 3 weeks later...

For some reasonĀ copying theĀ debconf-default.conf to a new file name causes the service to fail, but renaming the file will work! This must be some kind of weird bug. I have never seen that behaviour in any software before. Is there some kind of hardlink mystery going on here? Taking a gander at my experiment below should hopefully be enlightening.

root@ip-172-31-34-81:/etc/btsync# /etc/init.d/btsync start * Autostarting btsync instance 'debconf-default'      [ OK ] root@ip-172-31-34-81:/etc/btsync# /etc/init.d/btsync stop * Stopping btsync instance 'debconf-default'          [ OK ] root@ip-172-31-34-81:/etc/btsync# mv debconf-default.conf test.confroot@ip-172-31-34-81:/etc/btsync# /etc/init.d/btsync start * Autostarting btsync instance 'test'                 [ OK ] root@ip-172-31-34-81:/etc/btsync# /etc/init.d/btsync stop * Stopping btsync instance 'test'                     [ OK ] root@ip-172-31-34-81:/etc/btsync# mv test.conf debconf-default.conf.bakroot@ip-172-31-34-81:/etc/btsync# cp debconf-default.conf.bak test.confroot@ip-172-31-34-81:/etc/btsync# /etc/init.d/btsync start * Autostarting btsync instance 'test' * Failed to start btsync instance test - please check the configuration file /etc/btsync/test.confroot@ip-172-31-34-81:/etc/btsync# md5sum test.conf debconf-default.conf.bak b2ab63cf544cc65ca506c417f19642ad  test.confb2ab63cf544cc65ca506c417f19642ad  debconf-default.conf.bak
Link to comment
Share on other sites

  • 2 weeks later...

For some reasonĀ copying theĀ debconf-default.conf to a new file name causes the service to fail, but renaming the file will work! This must be some kind of weird bug. I have never seen that behaviour in any software before. Is there some kind of hardlink mystery going on here? Taking a gander at my experiment below should hopefully be enlightening.

Ā 

Don't worry, this has a very Linux-typical reason that can easily be solved I believe.

You may have much linux knowledge and just not thought about it, but just in case you do not or someone else has the same problem, a detailed explanation:

Ā 

Moving and/or Renaming a file (with the mv command) doesn't change the file itself which means it keeps its filesystem metadata, which are ownership (the system user and group that "own" the file) and permissions (read/write/execute permissions for owning user, owning group and every other user/group).

Ā 

When you copy a file (with cp command) it replicates the file's data into a new file. However cp doesn't copy the mentioned filesystem metadata. The new file rather has the ownership of the user you are currently logged in as (e.g. "root" in your example) and who-knows-whatever permissions.

Ā 

So if your btsync instance is not run as the same user ("root") but as another user (e.g. "btsync", see DAEMON_UID value in the conf file) it will not be able to access the copied file.

You solve the problem by looking at the old file's properties - The dir command lists owner, group and rwxrwx.. stuff of all files in the folder, alternatively, the command

getfacl ./

shows all permission/ownership stuff. Compare the values of the old and the new conf file and ajust the new file as needed:

chown myowner:mygroup test.conf ...to adjust the ownership (replace myowner and mygroup by the values of your old conf file, they should be the very same values that are DAEMON_UID and DAEMON_GID in the conf)

chmod 740 test.conf ...to adjust permissions if necessary.

Ā 

greetings,

elvenbone

Link to comment
Share on other sites

  • 3 weeks later...

I have a VPS and the most important service installed in it is btsync.

Ā 

I used this package to install it some months ago, and really do not remember if I used defaut config, but I suppose I followed your instructions. :-)

Ā 

The problem today is that aptitude allways hungs, and I cannot upgrade btsync nor any other package.

Ā 

I also tried to remove btsync, just to try a clean install, but it also do not work.

Ā 

I use Debian, and this is the output:

Ā 

=====================

Ā 

root@debian:/home/USERNAME# aptitude remove btsync
The following packages will be REMOVED:
Ā  btsync btsync-common{u}
0 packages upgraded, 0 newly installed, 2 to remove and 38 not upgraded.
Need to get 0 B of archives. After unpacking 6,946 kB will be freed.
Do you want to continue? [Y/n/?] Y
(Reading database ... 24304 files and directories currently installed.)
Removing btsync ...
Stopping btsync
Terminated
invoke-rc.d: initscript btsync, action "stop" failed.
dpkg: error processing btsync (--remove):
Ā subprocess installed pre-removal script returned error exit status 143
insserv: warning: script 'K01btsync' missing LSB tags and overrides
insserv: warning: script 'btsync' missing LSB tags and overrides
Starting Bittorrent Sync
By using this application, you agree to our Privacy Policy, Terms of Use and End User License Agreement.
http://www.bittorrent.com/legal/privacy
http://www.bittorrent.com/legal/terms-of-use
http://www.bittorrent.com/legal/eula

BitTorrent Sync forked to background. pid = 2676. default port = 8888
Bittorrent Sync is alive

Ā 

===>>> (at this point it stops, when I press CTRL+Z it continues...)

[1]+Ā  StoppedĀ Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  aptitude remove btsync
root@debian:/home/USERNAME# apt-get clean
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the download directory
Ā 

=====================

Ā 

Any other aptitude command gives me the same error:

Ā 

E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)

Ā 

Ā 

Can you help me? Thank you.

Link to comment
Share on other sites

I have a VPS and the most important service installed in it is btsync.

I used this package to install it some months ago, and really do not remember if I used defaut config, but I suppose I followed your instructions. :-)

The problem today is that aptitude allways hungs, and I cannot upgrade btsync nor any other package.

I also tried to remove btsync, just to try a clean install, but it also do not work.

I use Debian, and this is the output:

=====================

root@debian:/home/USERNAME# aptitude remove btsync

The following packages will be REMOVED:

btsync btsync-common{u}

0 packages upgraded, 0 newly installed, 2 to remove and 38 not upgraded.

Need to get 0 B of archives. After unpacking 6,946 kB will be freed.

Do you want to continue? [Y/n/?] Y

(Reading database ... 24304 files and directories currently installed.)

Removing btsync ...

Stopping btsync

Terminated

invoke-rc.d: initscript btsync, action "stop" failed.

dpkg: error processing btsync (--remove):

subprocess installed pre-removal script returned error exit status 143

insserv: warning: script 'K01btsync' missing LSB tags and overrides

insserv: warning: script 'btsync' missing LSB tags and overrides

Starting Bittorrent Sync

By using this application, you agree to our Privacy Policy, Terms of Use and End User License Agreement.

http://www.bittorrent.com/legal/privacy

http://www.bittorrent.com/legal/terms-of-use

http://www.bittorrent.com/legal/eula

BitTorrent Sync forked to background. pid = 2676. default port = 8888

Bittorrent Sync is alive

===>>> (at this point it stops, when I press CTRL+Z it continues...)

[1]+ Stopped aptitude remove btsync

root@debian:/home/USERNAME# apt-get clean

E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)

E: Unable to lock the download directory

=====================

Any other aptitude command gives me the same error:

E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)

Can you help me? Thank you.

The error you're getting in the end is because you have created a background zombie process by issuing ctrl +Z, you should either use Ctrl +C or let it finish.

Use "fg" to bring it into a foreground process once again and terminate it correctly, or use the "kill -15" command on the process ID to send a correct terminate signal.

The error you're seeing when removing the btsync package, is due to the /etc/init.d/btsync script missing a linux standard base compliant (another description) if you don't want to alter the script before removing the package, use the [--force] flag to dpkg.

IE:

> dpkg --force-all --remove btsync

> dpkg --force-all --remove btsync-common

Link to comment
Share on other sites

  • 2 weeks later...

My Sync is 1.2.67, and claims to be up-to-date, and apt-get update doesn't do anything.

Ā 

This might be related to the lack of updates: how do I find out whether I have installed the Server or the Desktop version? If I have the server installation, I should probably uninstall as I should be using desktop instead - how do I uninstall this?

Link to comment
Share on other sites

apt-get remove

Ā 

What should I remove? I tried both

sudo apt-get remove btsync

and

sudo apt-get remove btsync-daemon

and Sync is still installed and working after reboot.

Ā 

Below what

 pgrep -lf sync

gives:

1438 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/debconf-default.conf

Also, I still don't know whether I'm running the server or desktop version. How can I tell?

Link to comment
Share on other sites

I have installed btsync using "sudoĀ apt-get install btsync".

It installed a bunch of files, but config app did not autostart!

"dpkg-reconfigure btsync" works fine.

but when I "service btsync start"

It says "btsync: unrecognized service"Ā 

Ā 

UPDATE:

I uninstalled the btsync and deleted all of its files.

Now when I "apt-get install btsync" the config app does not autostart and webui does not show up after dpkg-reconfig.

Link to comment
Share on other sites

What should I remove? I tried both

sudo apt-get remove btsync
and
sudo apt-get remove btsync-daemon
and Sync is still installed and working after reboot.

Below what

pgrep -lf sync
gives:
1438 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/debconf-default.conf
Also, I still don't know whether I'm running the server or desktop version. How can I tell?
> apt-get remove btsync-common btsync

And its the server version you're running.

Sent from my GT-I9195 with Tapatalk

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.