Jump to content


Become a part of the community today! Registration is quick and easy and will enable you to post, send personal messages, and join in on the chat! It's as simple as clicking on the links above.

Debian And Ubuntu Server Unofficial Packages For Bittorrent Sync

debian ubuntu package daemon

  • Page 1 of 27
  • 1
  • 2
  • 3
  • Please log in to reply
533 replies to this topic

#1 tuxpoldo

tuxpoldo

    Advanced Member

  • Members
  • PipPipPip
  • 645 posts
  • LocationMunich, Gemany

Posted 03 May 2013 - 02:11 PM

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 to create a reliable startup and shutdown logic, manage configuration files, internal storage directories and everything else related to file and directory permissions, application update and various other aspects.

The BitTorrent Sync Server Package (btsync) is the ideal solution for all users that want to deploy BitTorrent Sync on Linux servers running Debian or other derived distributions like Ubuntu, Raspbian, Linux Mint or similar.

THIS SERVER PACKAGE IS UNOFFICIAL AND NOT THE WORK OF BITTORRENT® INC. PLEASE DO NOT CONTACT THE BITTORRENT® INC. SUPPORT WITH QUESTIONS OR PROBLEMS RELATED TO THE USE OF THE PACKAGE. YOU WILL FIND COMPETENT HELP AND SUPPORT IN THIS THREAD


TYPICAL USE CASES

The BitTorrent Sync Server Package is designed to run one or more BitTorrent Sync background processes (called "instances") on servers where no specific user is usually logged on. Since the server package does not provide any GUI (except for the optional Web UI provided by BitTorrent Sync itself), it can be also installed on headless servers (without any desktop environment).

The server version is particularly suitable for the following use cases:
  • BitTorrent Sync is used as a background service, to keep directories in sync between all servers of a distributed infrastructure like a PXE boot system and groups of shared configuration files.
  • Always-on instances of BitTorrent Sync for providing an always available external copy and source of replicated data for other BitTorrent Sync clients.
  • A content distribution network based on shared folders.
  • Customized services built upon the functionality of BitTorrent Sync.
This topic covers only the server package. If you are searching for the desktop user package, please look here.


INSTALLATION ON DEBIAN, UBUNTU, LINUX MINT, RASPBIAN OR OTHER DEBIAN DERIVATES

The most easy and fast way to install the repository is to paste that at a terminal prompt:
sh -c "$(curl -fsSL http://debian.yeasoft.net/add-btsync-repository.sh)"
The script explains what it will do and then pauses before it does it asking for your permission. If you encounter any problems or prefer to do it manually, please look here.

Now update the package index and install btsync by pasting that at a terminal prompt:
`which sudo` apt-get update
`which sudo` apt-get install btsync
After downloading the packages, the installation begins. The package manager will ask you, if you want a default instance of BitTorrent Sync to be created. If you answer yes, you will be guided through the installation and when finished you will have a fully operational BitTorrent Sync instance maintained by debconf. The configuration can be modified and fine tuned at any time by performing the following command:
`which sudo` dpkg-reconfigure btsync
Here you can also choose to delete the default instance by answering no to the initial question.


USAGE NOTES

The BitTorrent Sync Server Package mainly consists of an init-style startup script that manages every operational aspect of running BitTorrent Sync instances.


Instance Configuration Files

All operational parameters for BitTorrent Sync instances are configured in configuration files located in the directory /etc/btsync. These configuration files basically are JSON Files and follow a very strict syntax. In addition to the JSON specification, comments are also supported. The support of commented lines permits to specify additional parameters that are not directly parsed by the BitTorrent Sync executable itself but by the init-script.

The naming convention for configuration files defining BitTorrent Sync instances is:
<instance_name>.conf
where <instance_name> should be a string consisting of alphanumeric characters.

The default instance maintained by debconf has also a configuration file that is named debconf-default.conf. This name shall never be used by manually created configuration files, since it may be deleted or overwritten by debconf. This file shall also never be edited manually since it is often rewritten and/or created/deleted by debconf. If you want to manage the default instance, you must always use the command:
`which sudo` dpkg-reconfigure btsync
Each configuration file in /etc/btsync defines a separate running BitTorrent Sync instance (that means: a process). When defining more than one instance on a system, there are some rules that must be considered:
  • The listening ports (parameter listening_port) must be unique for each BitTorrent Sync instance
  • The internal database path (parameter storage_path) must be unique for each BitTorrent Sync instance
  • If the Web UI is enabled, the Web UI bind address and listening port (parameter listen) must be unique for each BitTorrent Sync instance
The syntax and configuration parameters of a BitTorrent Sync configuration file are partially documented in the example file /etc/btsync/samples/complex.conf and in the official BitTorrent Sync manual which can be also found in /usr/share/doc/btsync-common/BitTorrentSyncUserGuide.pdf.gz.

There are additional parameters that are parsed by the init script upon startup and affect many important aspects. These parameters are not parsed directly by BitTorrent Sync and therefore have to be placed in comment lines. In order to improve the readability of configuration files, they should be grouped together and placed at the beginning of the configuration file. The generic syntax of such parameters is:
// PARAMETER_NAME=<parameter value>
The following parameters are supported:
  • DAEMON_UID: A uid (user id) for specifying the user under which the BitTorrent Sync instance should run
  • DAEMON_GID: A gid (group id) for specifying the group under which the BitTorrent Sync instance should run
  • DAEMON_UMASK: The umask (up to 4 octal digits) for the BitTorrent Sync instance. If omitted the default umask is used.
  • DAEMON_DEBUG: The debug mask (4 hex digits) for the BitTorrent Sync instance. If omitted the init script will not touch potential settings defined manually. If set to 0000, a potential settings file will be deleted. Full detail is set by specifying FFFF. The log file can be found in the directory specified by storage_path and is named sync.log
  • DAEMON_NICE: The niceness level of the BitTorrent Sync instance, which affects the process scheduling. Nicenesses range from -20 (most favorable scheduling) to 19 (least favorable).
  • DAEMON_BIND: This parameter works only in conjunction with the package bind-shim. Please see the specific section below covering the specific interface binding topic.
//
// DAEMON_UID=jdoe
// DAEMON_UMASK=0002
//
This example will launch the instance running under the credentials of the user "jdoe" using 0002 as umask.

By specifying DAEMON_UID and DAEMON_GID it is possible to specify under which credentials the instance runs. In this case it must be assured that the instance is able to read and write all files it must access:
  • The instance must be able to read its own configuration file. Since the configuration file may contain sensitive data (the userame and password for the web interface), it is usually owned by the user under which the instance runs and has the mode 400 (-r--------) in order to limit the access to the specific user. Usually the init script takes care of adjusting the file permissions.
  • The instance must be able to read and write in its storage_path, since all internal control and status files (and the database of file hashes) are kept there. The ideal solution is to keep the storage_path somewhere in the home directory of the user under which the instance will run. Usually the init script takes care of adjusting the file permissions.
  • Obviously the instance must be able to read and write the files and directories that will be synchronized.
Some example configuration files are provided under /etc/btsync/samples


Default Startup Parameters

The additional configuration file /etc/default/btsync permits to specify some default startup parameters that may affect every configured instance of BitTorrent Sync.

The variable AUTOSTART defines which instances are started automatically. It can take the following values:
  • none No instance is started automatically
  • all (default) All instances are started automatically
  • <list> Only the specified instances are started automatically
Instances not started automatically upon system startup can be managed manually from the command line:
# start a specific instance
service btsync start <instance_name>
# stop a specific instance
service btsync stop <instance_name>
The advanced variable DAEMON_ARGS allows to specify additional command line parameters passed to the daemon. WARNING: Be careful! You should only add things here if you know EXACTLY what you are doing!

The variable DAEMON_BIND has the same purpose as the same parameter in the instance configuration files, but in this scope it will be applied by default to all instances. Please see the specific section below covering the specific interface binding topic.

The variable DAEMON_INIT_DEBUG permits to enable extended debug output of the init-script.


HANDLING OF SSL CERTIFICATES

BitTorrent Sync 1.4 supports also SSL connections to the Web UI. The default instance is automatically configured to use a self signed certificate and key created during the installation.

The configuration file does not point directly to the self signed certificate but to the following symbolic links:
/etc/btsync/debconf-default.crt
/etc/btsync/debconf-default.key
The default instance can be operated also with user provided certificates without tampering with the configuration file by deleting the symbolic links and replacing them with files containing the desired certificate and key. Debconf will detect that the files are not symbolic links and leave them untouched during reconfiguration.

The certificate file and key file must be accessible by the BitTorrent Sync daemon.


BINDING BITTORRENT SYNC TO A SPECIFIC INTERFACE

Unfortunately BitTorrent Sync currently does not support to bind the main service routine to a specific network interface. Currently only the internal web server providing the Web UI and the BitTorrent Sync API can be specifically bound to a specific address.

In order to limit the operation of BitTorrent Sync to a specific interface in a multihomed environment, a so called preload shim) can be used. The BitTorrent Sync repository contains a precompiled version of Daniel Ryde's bind.so shim that must be installed with:
`which sudo` apt-get install bind-shim
The BitTorrent Sync init script does detect the presence of the library and enables support for the additional parameter DAEMON_BIND that can be specified either in /etc/default/btsync or in instance configuration files.

By specifying a valid TCP/IP address assigned to one of the interfaces of the system, the BitTorrent Sync instance will bind only to that specific address. This will affect also the Web UI, if 0.0.0.0 is specified as the bind address.


SOME ADDITIONAL WORDS ABOUT AUTOUPDATE

The daemon scripts require that autoupdate is disabled in the configuration script, otherwise the instance will not be started. The reason for that is, that updates are handled by the Debian/Ubuntu package handling utility itself.

COMPATIBILITY

The server packages are available for the same architectures as released by BitTorrent Inc.:
  • i386 Intel/AMD 32 Bit
  • amd64 Intel/AMD 64 Bit
  • armel ARM EABI
  • armhf ARM hard float
  • powerpc PowerPC
Since the packages still have not been tested on every platform, any related feedback is highly appreciated.


BUG REPORTS, CONTRIBUTION AND SOURCES

If you want to contribute to the development of the packages or if you are curious how this all works, you may find the current sources of the deployment scripts and packaging on GitHub under the following URL: https://github.com/tuxpoldo/btsync-deb
If you have experienced a reproducible issue that is related to the packaging and not to BitTorrent Sync itself you are strongly encouraged to open an issue on the project's GitHub Page. Issues related to the native functionality of BitTorrent Sync should rather by creating a new topic or partecipating to an already existing topic in the BitTorrent Sync Forum.

Edited by tuxpoldo, Today, 03:08 PM.

  • kos13, maartenvc, nexx and 4 others like this

If you like the Linux GUI and/or the Debian/Ubuntu btsync packages, you may consider to flattr-badge-large.png


#2 kos13

kos13

    BitTorrent Sync Team

  • Employees
  • 690 posts

Posted 03 May 2013 - 02:39 PM

Thanks!
  • tuxpoldo likes this

#3 toxic-hero

toxic-hero

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 03 May 2013 - 06:16 PM

there's already a newer version than the one on PPA.

#4 tuxpoldo

tuxpoldo

    Advanced Member

  • Members
  • PipPipPip
  • 645 posts
  • LocationMunich, Gemany

Posted 05 May 2013 - 05:38 PM

there's already a newer version than the one on PPA.


Thank you for the information but: is it an official version? I'm uncertain if I should create a new package version using that binaries, since it seems not to be released over the normal download links or the autoupdate mechanism.

Hey staff! Any information about that?

If you like the Linux GUI and/or the Debian/Ubuntu btsync packages, you may consider to flattr-badge-large.png


#5 toxic-hero

toxic-hero

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 05 May 2013 - 05:47 PM

deleted

#6 GreatMarko

GreatMarko

    BitTorrent Sync Alpha Tester

  • Moderators
  • 1,850 posts
  • LocationUK

Posted 05 May 2013 - 08:07 PM

The latest official "public" build on the website is 1.0.116.

1.0.125, however, has since be made available through the forums to users experiencing issues with 1.0.116, but 1.0.125 is considered a "test build" (mind you, it could be argued that all these builds are "test builds" anyway as we're still in "alpha"!)

So, tuxpoldo, 1.0.125 is endorsed by BitTorrent Sync, as it's been posted a number of times in the forums now by BitTorrent staff (for instance here, here, here and here)... but, that said, I wouldn't spend too much time packaging up 1.0.125, as there is anticipated to be a more significant update made generally available this next week! ;)

#7 tuxpoldo

tuxpoldo

    Advanced Member

  • Members
  • PipPipPip
  • 645 posts
  • LocationMunich, Gemany

Posted 06 May 2013 - 06:19 AM

Updated packages to 1.0.125 - Initial post updated
  • GreatMarko likes this

If you like the Linux GUI and/or the Debian/Ubuntu btsync packages, you may consider to flattr-badge-large.png


#8 lux

lux

    Member

  • Members
  • PipPip
  • 20 posts

Posted 08 May 2013 - 01:12 AM

Unpacking btsync (from btsync_1.0.125-1_amd64.deb) ...
dpkg: dependency problems prevent configuration of btsync:
 btsync depends on libc6 (>> 2.15); however:
  Version of libc6:amd64 on system is 2.13-38.

dpkg: error processing btsync (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 btsync

^<- didn't work on my Debian.
http://syncapp.bittorrent.com/1.0.130/ is out now btw, the http://syncapp.bitto...-1.0.130.tar.gz build there did work for me

#9 linux only

linux only

    Member

  • Members
  • PipPip
  • 11 posts
  • Locationblue planet, turning grey

Posted 08 May 2013 - 02:07 AM

Does it have different functionality or look/feel than the tar.gz packages? If so, how about a screenshot or 2? Thanks!

#10 lux

lux

    Member

  • Members
  • PipPip
  • 20 posts

Posted 08 May 2013 - 06:18 AM

He wrote some funky setup scripts (dpkg-configuration) that ask you to enter some initial settings (so you don't necessarily have to write your own JSON). His default binary path was "/usr/sbin/btsync-daemon" on my system, rather than for example keeping the binary named "btsync".
His /etc/init.d/ scripts didn't work for me, don't know if that's because the setup ultimately failed for me or because of something being wrong with his script or....
His launch script also makes sure you have "check_for_updates" : false, else it refuses to start.

#11 tuxpoldo

tuxpoldo

    Advanced Member

  • Members
  • PipPipPip
  • 645 posts
  • LocationMunich, Gemany

Posted 08 May 2013 - 01:49 PM

Hi!

His /etc/init.d/ scripts didn't work for me, don't know if that's because the setup ultimately failed for me or because of something being wrong with his script or....


It would be really helpful to have some more information about what's the problem. Which OS are you running? Do you have installed with the DEB packages or do you have only taken the scripts in order to make your own deployment?

His launch script also makes sure you have "check_for_updates" : false, else it refuses to start.


The reason for that is simple: if you have software managed by the package management of an operating system, it's the package management that manages the updates ;-)

If you like the Linux GUI and/or the Debian/Ubuntu btsync packages, you may consider to flattr-badge-large.png


#12 lux

lux

    Member

  • Members
  • PipPip
  • 20 posts

Posted 08 May 2013 - 03:52 PM

I wrote the error I got trying to install your .deb.
I'm on Debian Unstable. x64 of course.
I renamed the .dpkg-new init.d scripts to use them with the working build from the .tar.gz (which I copied into your /usr/sbin/btsync-daemon location).

#13 tuxpoldo

tuxpoldo

    Advanced Member

  • Members
  • PipPipPip
  • 645 posts
  • LocationMunich, Gemany

Posted 08 May 2013 - 04:02 PM

Updated packages to 1.0.130 - Initial post updated

If you like the Linux GUI and/or the Debian/Ubuntu btsync packages, you may consider to flattr-badge-large.png


#14 tuxpoldo

tuxpoldo

    Advanced Member

  • Members
  • PipPipPip
  • 645 posts
  • LocationMunich, Gemany

Posted 08 May 2013 - 04:03 PM

I wrote the error I got trying to install your .deb.
I'm on Debian Unstable. x64 of course.
I renamed the .dpkg-new init.d scripts to use them with the working build from the .tar.gz (which I copied into your /usr/sbin/btsync-daemon location).


Thank you for the information! I will install a machine with debian unstable x64 and try to fix the problem.

If you like the Linux GUI and/or the Debian/Ubuntu btsync packages, you may consider to flattr-badge-large.png


#15 tuxpoldo

tuxpoldo

    Advanced Member

  • Members
  • PipPipPip
  • 645 posts
  • LocationMunich, Gemany

Posted 09 May 2013 - 11:08 AM

Updated packages to 1.0.132 - Initial post updated

If you like the Linux GUI and/or the Debian/Ubuntu btsync packages, you may consider to flattr-badge-large.png


#16 tuxpoldo

tuxpoldo

    Advanced Member

  • Members
  • PipPipPip
  • 645 posts
  • LocationMunich, Gemany

Posted 10 May 2013 - 09:22 AM

The bug in the debian versions have been fixed and it's now possible to install them on debian squeeze, wheezy and sid. There was a dependency problem, that caused the package to throw an error during installation.

Starting from now, there will be also a repository available for debian. See the initial posting for instructions on activating it on your machine.

If you like the Linux GUI and/or the Debian/Ubuntu btsync packages, you may consider to flattr-badge-large.png


#17 lux

lux

    Member

  • Members
  • PipPip
  • 20 posts

Posted 10 May 2013 - 10:47 AM

Installing via the package indeed works now :)
What does not work for me is the "<name>.<user>.{<group>.}conf" type of config. It just refuses to start as a user and not as root. If I rename the same config to "<name>.conf", it starts fine via your script.
Manually launching BTSync as my desired user also works.

#18 tuxpoldo

tuxpoldo

    Advanced Member

  • Members
  • PipPipPip
  • 645 posts
  • LocationMunich, Gemany

Posted 10 May 2013 - 11:43 AM

That's strange. I've tested it on my Debian sid amd64 installation and it works. The only problem I encountered was some syntax errors in /etc/btsync/samples/user.jdoe.conf

If you take that file, and simply rename it for your user name and change some settings inside, it will not work, since there are internal syntax errors... BTW: I check the sample files in the next release.

In any case, please try the following in a shell running under the user account of the user as which you want to run the daemon:

/usr/sbin/btsync-daemon --nodaemon --config /etc/btsync/<filename>.conf

Perhaps we will see, what's the problem....

BTW: What are the permissions of the configuration file? If you have a password (for the web ui) stored inside, it makes sense to have permissions like 400, but the problem is that the daemon will not be able to read the file. In that case I would suggest to change also the owner of the configuration file to the user...

If you like the Linux GUI and/or the Debian/Ubuntu btsync packages, you may consider to flattr-badge-large.png


#19 mickcane

mickcane

    New User

  • Members
  • Pip
  • 4 posts

Posted 10 May 2013 - 01:47 PM

Hello,

Could you please provide packages for ARM architecture ?

Thanks a lot for your work.

#20 tuxpoldo

tuxpoldo

    Advanced Member

  • Members
  • PipPipPip
  • 645 posts
  • LocationMunich, Gemany

Posted 10 May 2013 - 02:09 PM

Could you please provide packages for ARM architecture ?


This is not so simple... I need an arm machine in order to create arm packages with debuild or pbuilder. Any idea?

If you like the Linux GUI and/or the Debian/Ubuntu btsync packages, you may consider to flattr-badge-large.png



  • Page 1 of 27
  • 1
  • 2
  • 3



Also tagged with one or more of these keywords: debian, ubuntu, package, daemon