Debian And Ubuntu Server Unofficial Packages For Bittorrent Sync


Recommended Posts

Thanks, Tuxpoldo! That was exactly what I needed. But I hadn't to create my configuration file. Setting DAEMON_GID in  debconf-default.conf works just fine.

Believe me acmodeu: you have to. Obviously it works. Both the automatically created file as the file you would create manually are parsed by the same btsync daemon - so there is no reason, why it should not work.

BUT:

The next time btsync is updated or btsync is reconfigured with dpkg-reconfigure, all your changes are lost. And this will create also additional problems, since on the next start btsync will again start as root and will write files with different ownerships and permissions. And if you repair it (by readding DAEMON_UID and DAEMON_GID to the config file, perhaps it will not work any more, since btsync then tries to write on files that are owned by root, but btsync is not running as root any more.. BTW: Since the whole btsync daemon now runs with different credentials, you should have changed the ownership of /var/lib/btsync and all files in this directory - otherwise btsync will get in trouble when trying to write to his own internal database files.

One question:

When you opened debconf-default.conf in the editor, the first lines you should see are:

 

//!/usr/lib/btsync/btsync-daemon --config//// Default instance automatically created by debconf//// DO NOT EDIT THIS FILE MANUALLY//// use dpkg-reconfigure btsync to modify the// configuration

Do you think, "DO NOT EDIT THIS FILE MANUALLY" was a joke? You are not the only one, that was convinced, I was kidding. Look here: http://forum.bittorrent.com/topic/18974-debian-and-ubuntu-server-packages-for-bittorrent-sync/page-12#entry66632

In order to avoid such misunderstandings in the future, I improved the warning in the next version:

 

// 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 reason why you have to manage settings like DAEMON_UID in manually managed configuration files, is that the interactive configuration via debconf does not offer the possibility to specify those settings. There is a reason for this:

 

The automated configuration via debconf is a help facility mainly intended to support less advanced users in getting a standard configuration without many efforts. If you want instead to tweak every possibility that the software gives you with the configuration file, you are an advanced user and you will not need such a facility. You have more freedom, but you have also more chances to break everything. Since debconf offers no simple way to ask for user credentials in a secure way (you can break so many things if you do not really understand the implications), this is considered an advanced feature. Advanced features are for power users, and power users prefer to edit their configuration files manually and not use GUIs that limit them in their freedom.

 

 

Please do the following now:

  • Stop btsync (sudo stop btsync)
  • Since you are creating a separate instance of btsync, you should not use /var/lib/btsync as the storage_dir, since this directory is reserved for the default instance. Let's say that /var/lib/btsync-acmodeu will become your new storage_dir. Create it, and then move the contents (ONLY THE FILES settings.dat, settings.dat.old, sync.dat, sync.dat.old, sync.lng, sync.log, sync.pid, webui.zip) of /var/lib/btsync in /var/lib/btsync-acmodeu
  • Unfortunately I noticed, that you messed up some things: you used /var/lib/btsync also to store replicated content (/var/lib/btsync/Archive). THIS IS A FATAL MISUNDERSTANDING! The storage_dir is the directory in which btsync holds its internal data. It is NOT an area for the user to keep his replicated content! In btsync you can decide in the configuration which folders shall be replicated and these folders can be everywhere.
  • Change the ownership of the new storage directory and the files within to the uid and gid under which you want the btsync daemon to run
  • Make a duplicate of the default configuration file by creating a copy (sudo cp /etc/btsync/debconf-default.conf /etc/btsync/acmodeu.conf)
  • Open /etc/btsync/acmodeu.conf in an editor and do the following:
    • Write something informative in the header (like: THIS IS ACMODEU'S VERY PERSONALIZED CONFIGURATION FILE) and remove the old header information. It is always a good idea to keep things well documented. Since the file is now maintained by you, it would be wrong to keep information like "this file is maintained by debconf"
    • Change the storage_dir to /var/lib/btsync-acmodeu
    • Make all changes you need (like adding DAEMON_UID and DAMON_GID)
  • Invoke sudo dpkg-reconfigure btsync and answer immediately to the first question THAT YOU DO NOT WANT BTSYNC TO CREATE A DEFAULT INSTANCE.

After that, the file /etc/debconf-default.conf should disappear and btsync will be restarted (with the instance defined by your personal configuration file.

 

The most important thing, is that you understand exactly what you are doing:

  1. You will have a btsync daemon configurated by your very personal configuration file /etc/btsync/acmodeu.conf
  2. The daemon will run under specific credentials you have defined
  3. The daemon will store his internal database, state and helper files in /var/lib/btsync-acmodeu
  4. The directory /var/lib/btsync-acmodeu and all its contents are owned by the uid and gid under which the daemon will run
  5. The daemon must be able to access and write all the directory and files that are part of a replication set
Link to post
Share on other sites
  • Replies 802
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

BTSYNC PACKAGES FOR DEBIAN, UBUNTU AND OTHER DERIVED DISTRIBUTIONS BitTorrent® Inc. delivers for Linux users only a raw binary file without any deployment concept or setup system. It's up to the user

Released new packages 1.1.82-1 with some bugfixes and many additions. Beside of the upstream update to 1.1.82, this release adds the powerpc architecture both for btsync and btsync-user packages. Furt

I used Btsync some time ago, but stopped when it began a subscription model. With the creation of the one-payment option I thought I would try Btsync again. Seeing that the official-unofficial package

Posted Images

 

I followed the instructions and installed it successfully.

 

However some problems that I cannot solve:

 

The webui is not loading. Cannot establish connection to ip:port. Even if I try connecting from localhost.

 

Is btsync supposed to be running after following the instructions?

How to run it?

btsyncsh: btsync: command not found

 

Since you are asking in the server thread, I suppose you installed the server version of btsync. The behaviour of the server version is highly dependent upon what you specified to the debconf questions during the installation. For this reason it is not possible to give you an answer to your questions because there may be several configuration options that prevented you from accessing the web gui.

 

I think it is better to ask you a fundamental question:

 

Do you really need the server version? I have the impression that you are more a typical desktop user that wants btsync to run on its desktop linux machine. In this case you should uninstall the server version, install the desktop version and then logout and login again:

 

sudo apt-get --purge remove btsyncsudo apt get install btsync-user

 

After logging in, you should see the btsync indicator in the tray and you will have also some desktop shortcuts that permits you to launch the web UI. See the desktop thread for more clarifications:  http://forum.bittorrent.com/topic/19560-debian-and-ubuntu-desktop-packages-for-bittorrent-sync/

 

In any case I give you the advice to read CAREFULLY the initial posting (since it contains a lot of information). Many problems and solution that people has encountered were discussed in the topic thread.

Link to post
Share on other sites
Please do the following now:

        

         Open /etc/btsync/acmodeu.conf in an editor and do the following:

  • Write something informative in the header (like: THIS IS ACMODEU'S VERY PERSONALIZED CONFIGURATION FILE) and remove the old header information. It is always a good idea to keep things well documented. Since the file is now maintained by you, it would be wrong to keep information like "this file is maintained by debconf"
  • Change the storage_dir to /var/lib/btsync-acmodeu
  • Make all changes you need (like adding DAEMON_UID and DAMON_GID)

 

As long as I set DAEMON_UID variable btsync can't start. May be there is something else that should be done?

Link to post
Share on other sites

Seems I also have to take ownership of the acmodeu.conf file itself. Worked like a charm. Thanks for the help.

You are right! Sorry. I forgot but it was logical: the daemon must at least be able to access his configuration file ;-)

....and since the file contains security relevant information (the access data to the web interface), it is always a good idea to make it owned by the uid and gid under which the btsync daemon runs AND limit the access rights to only that user (sudo chmod 400 /etc/btsync/acmodeu.conf). Don't worry. root will always be able to access the file...

Link to post
Share on other sites

You are right! Sorry. I forgot but it was logical: the daemon must at least be able to access his configuration file ;-)

....and since the file contains security relevant information (the access data to the web interface), it is always a good idea to make it owned by the uid and gid under which the btsync daemon runs AND limit the access rights to only that user (sudo chmod 400 /etc/btsync/acmodeu.conf). Don't worry. root will always be able to access the file...

 

Maybe you can add this to the opening post. I ran in the same issue.

Link to post
Share on other sites

Hi,

 

After having used your package with one single config, for security reasons, I would like now to have a separate daemon for each user.
What's the cleanest way to do it ?
I have a master configuration file with the usernames and their secrets.
 
Thanks for your help.
 
Magali
Link to post
Share on other sites

Just check out this post and don't forget to do this for every user.

 

 

Hi,

 

After having used your package with one single config, for security reasons, I would like now to have a separate daemon for each user.
What's the cleanest way to do it ?
I have a master configuration file with the usernames and their secrets.
 
Thanks for your help.
 
Magali

 

Link to post
Share on other sites

After having used your package with one single config, for security reasons, I would like now to have a separate daemon for each user.

What's the cleanest way to do it ?

I think that you will find a good explanation on how to handle separate configuration files in the initial posting.

I have a master configuration file with the usernames and their secrets.

Unfortunately the btsync configuration files do not support includes, but you can write some scripts that generate the dedicated configuration files for each user on the fly.

Link to post
Share on other sites

Released new packages 1.1.82.1-3 with a few bugfixes and a fundamental change in the structure of the packages (the official components from BitTorrent Inc have been moved into a separate package that will be installed automatically). Both Debian and Ubuntu builds are online on debian.yeasoft.net - The Ubuntu builds on Launchpad will be probably available in 8-10 hours :angry:. If you are Ubuntu User and prefer to switch to the debian.yeasoft.com repository, you should delete the file tuxpoldo-btsync-precise.list in your /etc/apt/sources.list.d directory and follow the instructions in the initial posting.

 

Changelog:

btsync (1.1.82.1-3) unstable; urgency=low  - The native upstream components from BitTorrent Inc. are no more    included. All packages are now dependant upon the external    package btsync-common which contains the btsync executables and    documentation (Closes #18 and #19)  - Fixed: The init script now tests on ARM systems if the btsync    executable is compatible with the alignment handling and adapts    it when needed (Closes #31 and #32)  - Fixed: frontend was not be stopped on update in btsync-user    (Closes #20)  - Fixed: handling of update and remove of btsync-user is now    working as expected (Closes #22)  - Fixed: made initial installation less sensible against    startup errors  - Added German translation to debconf templates (Closes #23)  - Added Italian translation to debconf templates contributed    by Leo Moll and Andrea Pennelli (Closes #24)  - Added French translation to debconf templates contributed    by Quentin Scouflaire (Closes #25)  - Added Russian translation to debconf templates contributed    by dimitriy5181 (Closes #27)  - Added Dutch translation to debconf templates contributed    by Andras Kiss (Closes #28)  - Added Hungarian translation to debconf templates contributed    by Andras Kiss (Closes #29)  - Added Czech translation to debconf templates contributed    by Marek Lukas (Closes #30)  - Added Greek translation to debconf templates contributed    by Thanos Papaoikonomou (Closes #33)  - Added Catalan translation to debconf templates contributed    by VCLL (Closes #34) -- Leo Moll <leo.moll@yeasoft.com>   Thu, 31 Oct 2013 14:57:49 +0100
Link to post
Share on other sites

Released new btsync-common 1.2.67 upstream package. All packages are online on debian.yeasoft.net and ubuntu.yeasoft.net - users served by the Launchpad PPA have as usual to wait a few hours for the packages being built....

 

btsync-common (1.2.67-1) unstable; urgency=low   * New upstream release  -- Leo Moll <leo.moll@yeasoft.com>  Tue, 05 Nov 2013 16:18:01 +0100 
Link to post
Share on other sites

Be careful upgrading! Does not start anymore.

 

Please give me more details! I tested it here both on my i386 and amd64 machines and it worked perfectly. Which platform? Which error message when trying to start manually by invoking it directly on the command line:

sudo /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/debconf-default.conf
Link to post
Share on other sites

 

Please give me more details! I tested it here both on my i386 and amd64 machines and it worked perfectly. Which platform? Which error message when trying to start manually by invoking it directly on the command line:

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

 

you need to restart the computer, then it is ok

the error is that btsync is running already and it can't lock a PID file

Link to post
Share on other sites

you need to restart the computer, then it is ok

the error is that btsync is running already and it can't lock a PID file

 

Probably you were the first one to upgrade - Unfortunately I uploaded to my repositories an older version that did not restart the daemon if found. After updating, I found out that someone did a download. Probably it was you ;-)

 

2001:4dd0:fbc4:0:10ff:44b6:5044:528d - - [05/Nov/2013:16:42:13 +0100] "GET /btsync/pool/main/b/btsync-common/btsync-common_1.2.67-1_amd64.deb HTTP/1.1" 200 3445808 "-" "Debian APT-HTTP/1.3 (0.8.16~exp12ubuntu10.15)"xxx.x47.134.19 - - [05/Nov/2013:16:46:44 +0100] "GET /btsync/pool/main/b/btsync-common/btsync-common_1.2.67-1_amd64.deb HTTP/1.1" 200 3445752 "-" "Debian APT-HTTP/1.3 (0.9.12.1)"

 

(The first download was one of my test machines)

Link to post
Share on other sites

just updated to 1.2.68 and again had to restart the server to be able to start btsync

 

Is anybody out here able to reproduce this and collect some additional information? All my machines (i386, amd64 (Ubuntu 12.04 LTS) and armhf (Raspbian)) did the update and automatically restarted the daemon during the update... After the update the web interface was reachable and displayed 1.2.68

 

One question to knireis: What do you mean, when you say "restart the server"? Does this mean, that after the update the web interface was not reachable and you had to reboot your server or you had to restart btsync because the web interface was not reachable any more?

Link to post
Share on other sites

Dear Tuxpoldo

 

I am trying to install btsync on a ReadyNAs from Netgear, which is basically a full wheezy debian.

 

Unfortunately the following happens:

 

~# apt-get install btsync
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  btsync
0 upgraded, 1 newly installed, 0 to remove and 27 not upgraded.
Need to get 2,357 kB of archives.
After this operation, 6,335 kB of additional disk space will be used.
Get:1 http://apt.readynas.com/packages/readynasos/ 6.1.4/apps btsync all 1.1.48 [2,357 kB]
Fetched 2,357 kB in 1s (1,595 kB/s)

...

 

 

This means that btsync is also provided from Readynas, but a very old version (1.1.48).

 

Do you know how I can force the NAS to install it from your repository?

 

It's not really related to your product, but I would appreciate a lot any help :)

 

KR, Christoph

 

 

Edit: After another apt-get update I get this:

 

 

 

:/etc/apt# apt-get update
Hit http://apt.readynas.com 6.1.4 Release.gpg
Ign http://ppa.launchpad.net wheezy Release.gpg                                       
Hit http://apt.readynas.com 6.1.4 Release                                             
Ign http://ppa.launchpad.net wheezy Release                           
Hit http://mirrors.kernel.org wheezy Release.gpg                      
Hit http://apt.readynas.com 6.1.4/updates armel Packages
Hit http://mirrors.kernel.org wheezy Release   
Err http://ppa.launchpad.net wheezy/main Sources                     
  404  Not Found
Err http://ppa.launchpad.net wheezy/main armel Packages
  404  Not Found
Hit http://apt.readynas.com 6.1.4/apps armel Packages
Hit http://mirrors.kernel.org wheezy/main armel Packages
Hit http://apt.readynas.com 6.1.4/main armel Packages
W: Failed to fetch 404  Not Found

W: Failed to fetch 404  Not Found


E: Some index files failed to download. They have been ignored, or old ones used instead.

 

 

Is that the issue?

Link to post
Share on other sites

I am trying to install btsync on a ReadyNAs from Netgear, which is basically a full wheezy debian.

 

Unfortunately the following happens:

...

This means that btsync is also provided from Readynas, but a very old version (1.1.48).

 

Do you know how I can force the NAS to install it from your repository?

 

It's not really related to your product, but I would appreciate a lot any help :)

 

KR, Christoph

 

 

Edit: After another apt-get update I get this:

...

Is that the issue?

 

Yes. I do not now how you managed it, but you have added the Ubuntu PPA to your package sources. I have no idea why you did that. Ubuntu does not provide packages for debian.

 

Please remove the Ubuntu PPA from your sources and follow the instructions in the initial posting to add a correct source for your distribution.

 

p.S.: Interesting: the readynas package source offers a package named btsync... This should not interfere, since the packages from my source are newer.

Link to post
Share on other sites

Hi Tuxpoldo

 

I see !!!

 

I just did add-apt-repository ppa:tuxpoldo/btsync

 

Unfortunately I have no clue how to add the repository on Debian then.

 

I am lost with these commands:

 

 

CODENAME=$(lsb_release -cs | sed -n '/lucid\|precise\|quantal\|raring\|saucy\|squeeze\|wheezy\|jessie\|sid/p')
`which sudo` echo deb http://debian.yeasoft.net/btsync ${CODENAME:-sid} main > /etc/apt/sources.list.d/btsync.list
`which sudo` echo deb-src http://debian.yeasoft.net/btsync ${CODENAME:-sid} main >> /etc/apt/sources.list.d/btsync.list
unset CODENAME

 

Those .list files were created in sources.list.d but it seems that with apt-get update tis not taking them into account.

 

btsync.list  tuxpoldo-btsync-wheezy.list  tuxpoldo-btsync-wheezy.list.save

 

(I know this is just me being an amatuer, so sorry to waste everyones time...)

 

EDIT: The solution was to comment out the repository from READYNAS. Then apt-get install btsync used the tuxpoldo repository. All happy!

 

Thanks for everyones patience.

Link to post
Share on other sites

Is anybody out here able to reproduce this and collect some additional information? All my machines (i386, amd64 (Ubuntu 12.04 LTS) and armhf (Raspbian)) did the update and automatically restarted the daemon during the update... After the update the web interface was reachable and displayed 1.2.68

 

One question to knireis: What do you mean, when you say "restart the server"? Does this mean, that after the update the web interface was not reachable and you had to reboot your server or you had to restart btsync because the web interface was not reachable any more?

 

during upgrade when btsync starts again, it gives a fail.

i think only after server restart btsync would start. 

Link to post
Share on other sites
Guest
This topic is now closed to further replies.