Debian And Ubuntu Server Unofficial Packages For Bittorrent Sync


Recommended Posts

You can see which version was installed by the debian/ubuntu packaging by executing the commmand


sudo dpkg -l btsync

I suppose that you have more than one btsync running on your machine. One installed via the repository with


apt-get install btsync

the other installed by other means. This is the only explanation for what you are describing. One thing is clear. If the Web UI does not show the version of the currently installed btsync (that should be 1.1.27), then it comes from another btsysnc.

p.S.: Are you sure to perform a regular


sudo apt-get update

in order to keep your package index file synchronised with their sources? If you did not, then your computer does never update anything! Keeping the machine up to date means to perform the following commands on a regular base:


sudo apt-get update
sudo apt-get upgrade

Thank you for all those pointers, I do a regular sudo apt-get update and upgrade, and checking the version via sudo dpkg -l btsync is telling me 1.1.27

2013-07-10_1029.png

I have never installed btsync via any other means, so I am very confused here. I also noticed, I have changed my system name to "WACOCloud" and yet on the clients it shows up as "ubuntu - Default Instance" I believe you are right that I have two versions running somehow so I'll look into that.

EDIT: looked into it and see btsync running as the proper user "WACOMalt" and another btsync-daemon running as root. I'm assuming the daemon is the wrong one?

EDIT: ok well I fixed it. There were indeed two different versions running, apparantly the "btsync" one was the wrong one and btsync-daemon was right. I simply uninstalled and reinstalled btsync and took a look at top. btsync-daemon is the only one running now, as root, and shows correct version in web interface. Thanks for the pointers folks!

Link to comment
Share on other sites

Good news!

Version 1.1.30 fixes the problem!

Hell no! After uncommenting DAEMON_UMASK=0002 string in debconf-default.conf btsync pretends to start but the webface becomes unavailable and telnet probe to connection port fails. ps ax | grep btsync shows only grep btsync. After reverting the changes everything backs to normal.
Link to comment
Share on other sites

Hell no! After uncommenting DAEMON_UMASK=0002 string in debconf-default.conf btsync pretends to start but the webface becomes unavailable and telnet probe to connection port fails. ps ax | grep btsync shows only grep btsync. After reverting the changes everything backs to normal.

STOP! You are making two fundamental errors!

First error: should never edit debconf-default.conf manually. As it says in the comment section at the beginning:


// DO NOT EDIT THIS FILE MANUALLY
//
// use dpkg-reconfigure btsync to modify the
// configuration

What does this mean? It means: DO NOT EDIT THIS FILE MANUALLY ;-P

You can/must reconfigure the default btsync instance by issuing the command:


sudo dpkg-reconfigure btsync

With this command you can set all operating parameters of btsync (including the umask) interactively. If you edit the file manually, all your changes are lost at the next update, since the parameters are stored into the debconf database and the configuration file will be regenerated at each update/install or reconfiguration.

If you do not like this and you want to manage your configuration files manually, you should select at the very beginning of the installation (or dpkg-reconfigure) that you do not want a default instance.

Second Error: as clearly described in the documentation, parameters like DAEMON_UID, DAEMON_GID and DAEMON_UMASK are not parsed by btsync itself, but by the daemon scripts and that they should be placed in the comments. So if you uncomment them, you are creating a broken configuration file and btsync will not start. This is the reason because nothing is working now!

See the documentation included in the package, the documentation written in the initial post and what I wrote to another user in one of the previous postings:

The file has a huge comment section at the beginning (lines staring with //) with a complete documentation on how to set the parameters.

Since it is not btsync itself which understands DAEMON_UID, DAEMON_GID and DAEMON_UMASK, these parameters have to be set in the comments section.

Simply specify before of the json part of the configuration file the DAMON_ parameters:


//
// DAEMON_UID=myuserid
//

The daemon script parses the parameters right out of the comment section.

This shows why it is always a good idea to RTFM ;-)

Link to comment
Share on other sites

...btsync pretends to start...

Unfortunately this is another problem with btsync. If the configuration file contains errors, btsync will not start but also not return any error code, and for this reason it is not possible to detect a start failure in the daemon scripts. I am thinking about adding some additional tests after launching the daemon in order to verify that something is not working...

Link to comment
Share on other sites

Very tiny update 1.1.30-2. Unfortunately Ubuntu will take a while... and this time no ARM builds.

Changelog:


btsync (1.1.30-2~sid) sid; urgency=low

- New: The init script now detects startup failures and shows an error message.
- New: The init script now issues some syslog messages on failures
- New: The init script now supports the "status" command

-- Leo Moll <leo.moll@yeasoft.com> Thu, 11 Jul 2013 16:07:24 +0200

This release is inspired by:

...btsync pretends to start...

Link to comment
Share on other sites

Updated all packages to 1.1.33 - All Debian builds are now online. Unfortunately today again there is high load on launchpad and so Ubuntu builds will be probably available in about 8 hours (launchpad shows 4-8 hours for all builds). I'm sorry, but again I can't change this :-(

Changelog:


btsync (1.1.33-1~sid) sid; urgency=low

* New upstream release

-- Leo Moll <leo.moll@yeasoft.com> Thu, 11 Jul 2013 22:10:09 +0200

Link to comment
Share on other sites

I'm running btsync on Debian Wheezy with very few packages from testing. I now need python3.3 but when I try installing it it tells me it will remove btsync. Can you have a look please and let me know if this is fixable from your side?


apt-get install -t testing python3.3 -u
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libc-dev-bin libc6 libc6-dev libffi6 libpython3.3-minimal libpython3.3-stdlib locales
python3.3-minimal
Suggested packages:
glibc-doc python3.3-doc binfmt-support
The following packages will be REMOVED:
btsync
The following NEW packages will be installed:
libffi6 libpython3.3-minimal libpython3.3-stdlib python3.3 python3.3-minimal
The following packages will be upgraded:
libc-dev-bin libc6 libc6-dev locales
4 upgraded, 5 newly installed, 1 to remove and 346 not upgraded.
Need to get 17.1 MB of archives.
After this operation, 14.8 MB of additional disk space will be used.
Do you want to continue [Y/n]?

Link to comment
Share on other sites

Raspbian is now available for jessie, but your package for wheezy requires libc6 (< 2.14).

Jessie comes with libc6 2.17. Would it be possible for you to provide jessie packages for armhf ?

In order to build the packages for jessie, I meed a jessie installation on my PI. I will try to do this in the next days.

Link to comment
Share on other sites

I'm running btsync on Debian Wheezy with very few packages from testing. I now need python3.3 but when I try installing it it tells me it will remove btsync. Can you have a look please and let me know if this is fixable from your side?


apt-get install -t testing python3.3 -u
...
libc-dev-bin libc6 libc6-dev libffi6 libpython3.3-minimal libpython3.3-stdlib locales
...

I think that the problem is that phyton3.3 upgrades also the libc6. The standard build process creates a library dependency in the package metainformation. I think that you can solve the problem, by installing the package for sid instead.

You can achieve that, by editing the file /etc/apt/sources.list.d/btsync.list and changing the reference of wheezy to sid. Probably you have to uninstall btsync before (but you will not lose your settings). You should do things in the following order:

  1. uninstall btsync (apt-get remove btsync).. the references in the debconf database, the config files in /etc/btsync and the data files in /var/lib/btsync will not be removed (if you do not explicitely specify --purge)
  2. modify the file /etc/apt/sources.list.d/btsync.list
  3. apt-get update
  4. install your python stuff
  5. apt-get install btsync

Link to comment
Share on other sites

Updated all packages to 1.1.40 - All Debian builds are going online. As usual, Ubuntu builds will be probably available in 30-60 Minutes.

Changelog:


btsync (1.1.40-1~sid) sid; urgency=low

* New upstream release

-- Leo Moll <leo.moll@yeasoft.com> Mon, 15 Jul 2013 16:13:43 +0200

Link to comment
Share on other sites

I'm getting strange behaviour using the UMASK setting. Any time I enable it, the web UI stops working.

The first lines of my config file are:


//!/usr/lib/btsync/btsync-daemon --config
//
// DAEMON_UID=chris
// DAEMON_GID=executives
// DAEMON_UMASK=0770
//

I am managing the file myself, not using dpkg. I have the same behaviour for 1.1.33 and now 1.1.40.

As an aside, the dpkg options allow for setting umask, but not UID or GID.

Link to comment
Share on other sites

I'm getting strange behaviour using the UMASK setting. Any time I enable it, the web UI stops working.

...


// DAEMON_UID=chris
// DAEMON_GID=executives
// DAEMON_UMASK=0770

I think, that the problem is caused by the combination of your settings. First of all, you must assure that btsync is able to read and write all files into the data directory. If the files were created by btsync before you set the credentials and the umask, you must change the ownership and permission of all files in the data directory accordingly.

I'm also wondering about 0770 as UMASK. This means, that directories will be created with 007 and files with 006 mode. Is that really what you want?

These options give the user a lot of power, but must be used wisely...

Link to comment
Share on other sites

These options give the user a lot of power, but must be used wisely...

:D

The umask was not what I wanted...after changing to 0007 things are working as I'd expected. I had a momentary lapse of thinking and forgot that the umask erases bits. The webUI works now. I suspect that putting a '7' in the user umask caused problems.

Link to comment
Share on other sites

Hallo tuxpoldo,

thanks for creating the Ubuntu-/Debian-Packages. And (of course) thanks to the developers of btsync. I love it. :-)

My Problem(s):

I can't get your init-script starting more than one instance of btsync. And it tells me that starting has failed, but btsync "debconf-default" is running well.

My Setup:

  1. Minimal Netinst Debian Squeeze (amd64)
  2. OpenMediaVault installation as described in their forum
  3. btsync installation as you described

More Detail:

Btsync ist working well as root on port 8888. So i tried to get 3 instances with differend UIDs running. The configs are placed in /etc/btsync/ ...


/etc/btsync/user1.conf
/etc/btsync/user2.conf
/etc/btsync/user3.conf

... and looks like this one:


//!/usr/sbin/btsync-daemon --config
//
// DAEMON_UID=user1
// DAEMON_GID=user1
// DAEMON_UMASK=0000
//
{
"device_name": "user1@server.domain.lan",
"listening_port" : 0,
"storage_path" : "/home/user1/.btsync",
"pid_file" : "/home/user1/.btsync/btsync.pid",
"check_for_updates" : false,
"use_upnp" : false,
"download_limit" : 0,
"upload_limit" : 0,
"disk_low_priority" : true,
"lan_encrypt_data" : false,
"lan_use_tcp" : false,
"rate_limit_local_peers" : false,
"folder_rescan_interval" : 600,
"webui" :
{
"listen" : "0.0.0.0:61009",
"login" : "admin",
"password" : "********"
}
}

(with different ports of course) ;-)

But "/etc/init.d/btsync restart" fails: (without trying to start user1, user2 and user3)


Stopping P2P file synchronisation daemon(s)...Stopping btsync instance 'debconf-default':.
Starting P2P file synchronisation daemon(s)...Autostarting btsync instance 'debconf-default': failed!

A look at http://server:8888/ gave me a running btsync-gui. I think the init-script is failing to detect if btsync "debconf-default" is running.

A look at http://server:61009/ fails. So i tried "pgrep btsync" and got only one PID back.

Btsync itself runs well with /etc/btsync/user1.conf:


root@server:/etc/btsync# /usr/lib/btsync/btsync-daemon --config /etc/btsync/user1.conf
BitTorrent Sync forked to background. pid = 6854

Now port 61009 is responding with a btsync-gui.

Final Question(s):

Am i doing something wrong? Or is there a bug in the init-script?

Update:

Workaround:

I edited /etc/init.d/btsync and commented out the check if btsync is running.

Line 185 to 192:


# if which pgrep > /dev/null; then
# if pgrep $(basename $DAEMON) > /dev/null; then
# STATUS=0
# else
# log_error "Failed to start $NAME instance $BASENAME - please check the configurat$
# STATUS=1
# fi
# fi

Now i can start and stop the instances via init-script and everything seems to work correctly.

Link to comment
Share on other sites

Updated all packages to 1.1.42 - All Debian builds are now online. As usual, Ubuntu builds will be probably available in 1-2 hours.

Changelog:


btsync (1.1.42-1~sid) sid; urgency=low

* New upstream release

-- Leo Moll <leo.moll@yeasoft.com> Tue, 16 Jul 2013 17:45:08 +0200

Link to comment
Share on other sites

...

My Problem(s):

...

I will test this during the evening and try to find a solution. It seems that one of my last changes broke something...

Update 1:

On my first test I am not able to reproduce the error. I admit that the part you have removed is not really perfect, but currently is seems to work....


yeasoft-gate2 /etc/btsync # service btsync start
* Starting P2P file synchronisation daemon(s)...
* Autostarting btsync instance 'debconf-default' [ OK ]
* Autostarting btsync instance 'serversync' [ OK ]
yeasoft-gate2 /etc/btsync # ps axu
...
6698 ? Sl 0:01 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/debconf-default.conf
6739 ? Sl 0:32 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/serversync.conf
yeasoft-gate2 /etc/btsync #

But I'm still trying to reproduce the error...

Update 2:

I took your configuration file, copied it to user2.conf and user3.conf, changed names and ports, created the users, restarted the show...


yeasoft-gate2 /etc/btsync # useradd -m user1
yeasoft-gate2 /etc/btsync # useradd -m user2
yeasoft-gate2 /etc/btsync # useradd -m user3
yeasoft-gate2 /etc/btsync # ls -la /home/
total 24
drwxr-xr-x 6 root root 4096 Jul 17 00:04 .
drwxr-xr-x 22 root root 4096 Jul 7 18:07 ..
drwxr-xr-x 4 leo leo 4096 Feb 25 15:01 leo
drwxr-xr-x 2 user1 user1 4096 Jul 17 00:04 user1
drwxr-xr-x 2 user2 user2 4096 Jul 17 00:04 user2
drwxr-xr-x 2 user3 user3 4096 Jul 17 00:04 user3

yeasoft-gate2 /etc/btsync # service btsync restart
* Stopping P2P file synchronisation daemon(s)...
* Stopping btsync instance 'debconf-default' [ OK ]
* Stopping btsync instance 'serversync' [ OK ]
* Starting P2P file synchronisation daemon(s)...
* Autostarting btsync instance 'debconf-default' [ OK ]
* Autostarting btsync instance 'serversync' [ OK ]
* Autostarting btsync instance 'user1' [ OK ]
* Autostarting btsync instance 'user2' [ OK ]
* Autostarting btsync instance 'user3' [ OK ]
yeasoft-gate2 /etc/btsync # ps axu
...

root 15278 1.2 0.1 463520 7404 ? Sl 00:06 0:01 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/debconf-default.conf
root 15319 14.8 0.1 397252 5616 ? Sl 00:06 0:16 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/serversync.conf
user1 15370 0.0 0.0 260848 2220 ? Sl 00:06 0:00 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/user1.conf
user2 15420 0.0 0.0 260848 2228 ? Sl 00:06 0:00 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/user2.conf
user3 15469 0.0 0.0 260848 2212 ? Sl 00:06 0:00 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/user3.conf
yeasoft-gate2 /etc/btsync #

Strange. Everything seems to work....

This machine is running Ubuntu 12.04 LTS amd64 with 4GB of RAM. Anybody here able to reproduce the behaviour reported by Christian Wantia?

Edited by tuxpoldo
Link to comment
Share on other sites

I've testet a little bit more. The "problem" seems to be debian-(squeeze)-specific. I'm able to reproduce the behaviour with a clean debian squeeze and a fresh btsync. With Ubuntu (13.04) everything works well.

Update 3:

  1. Installed Debian 6 i386 on a virtual machine with desktop (i didn't want this!) and ssh server from netinstall image
  2. Removed all the not needed desktop stuff

The attachment is the file with the list of installed packages:

packages.txt

Now:


root@debian:~# gpg --keyserver pgp.mit.edu --recv-keys 6BF18B15
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: requesting key 6BF18B15 from hkp server pgp.mit.edu
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 6BF18B15: public key "Leo Moll <leo.moll@yeasoft.com>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1

root@debian:~# gpg --armor --export 6BF18B15 | apt-key add -
OK
root@debian:~# echo deb http://debian.yeasoft.net/btsync $(lsb_release -cs) main contrib non-free >> /etc/apt/sources.list.d/btsync.list
root@debian:~# echo deb-src http://debian.yeasoft.net/btsync $(lsb_release -cs) main contrib non-free >> /etc/apt/sources.list.d/btsync.list
root@debian:~# apt-get update
...

root@debian:~# 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 0 not upgraded.
Need to get 2,037 kB of archives.
After this operation, 3,969 kB of additional disk space will be used.
Get:1 http://debian.yeasoft.net/btsync/ squeeze/main btsync i386 1.1.42-1~squeeze [2,037 kB]
Fetched 2,037 kB in 2s (858 kB/s)
Preconfiguring packages ...
Selecting previously deselected package btsync.
(Reading database ... 21343 files and directories currently installed.)
Unpacking btsync (from .../btsync_1.1.42-1~squeeze_i386.deb) ...
Setting up btsync (1.1.42-1~squeeze) ...
Starting P2P file synchronisation daemon(s)...
root@debian:~#
root@debian:~# useradd -m user1
root@debian:~# useradd -m user2
root@debian:~# useradd -m user3
root@debian:~# cd /etc/btsync/

Now copied the 3 configuration files from another machine:

user1.conf.txtuser2.conf.txtuser3.conf.txt



root@debian:/etc/btsync# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.7 (squeeze)
Release: 6.0.7
Codename: squeeze

root@debian:/etc/btsync# uname -a
Linux debian 2.6.32-5-686 #1 SMP Fri May 10 08:33:48 UTC 2013 i686 GNU/Linux

root@debian:/etc/btsync# service btsync start
Starting P2P file synchronisation daemon(s)...Autostarting btsync instance 'user1':.
Autostarting btsync instance 'user2':.
Autostarting btsync instance 'user3':.
root@debian:/etc/btsync# ps ax
PID TTY STAT TIME COMMAND
1 ? Ss 0:00 init [2]
2 ? S 0:00 [kthreadd]
...
947 ? Ss 0:00 sshd: root@pts/0
949 pts/0 Ss 0:00 -bash
1109 ? Sl 0:00 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/user1.conf
1153 ? Sl 0:00 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/user2.conf
1197 ? Sl 0:00 /usr/lib/btsync/btsync-daemon --nodaemon --config /etc/btsync/user3.conf
1210 pts/0 R+ 0:00 ps ax

Everything is working properly. Any idea?

Link to comment
Share on other sites

Update 3:

  1. Installed Debian 6 i386 on a virtual machine with desktop (i didn't want this!) and ssh server from netinstall image
  2. Removed all the not needed desktop stuff

[...]

Everything is working properly. Any idea?

Two virtual machines and a lot testing later i've found an interesting behaviour. After failing 4 times, the init-script starts correctly and than fails again.


root@debomvbtsync-vm:~# service btsync restart
Stopping P2P file synchronisation daemon(s)...Stopping btsync instance 'debconf-default':.
Starting P2P file synchronisation daemon(s)...Autostarting btsync instance 'debconf-default': failed!

root@debomvbtsync-vm:~# service btsync restart
Stopping P2P file synchronisation daemon(s)...Stopping btsync instance 'debconf-default':.
Starting P2P file synchronisation daemon(s)...Autostarting btsync instance 'debconf-default': failed!

root@debomvbtsync-vm:~# service btsync restart
Stopping P2P file synchronisation daemon(s)...Stopping btsync instance 'debconf-default':.
Starting P2P file synchronisation daemon(s)...Autostarting btsync instance 'debconf-default': failed!

root@debomvbtsync-vm:~# service btsync restart
Stopping P2P file synchronisation daemon(s)...Stopping btsync instance 'debconf-default':.
Starting P2P file synchronisation daemon(s)...Autostarting btsync instance 'debconf-default': failed!

root@debomvbtsync-vm:~# service btsync restart
Stopping P2P file synchronisation daemon(s)...Stopping btsync instance 'debconf-default':.
Starting P2P file synchronisation daemon(s)...Autostarting btsync instance 'debconf-default':.
Autostarting btsync instance 'user1':.
Autostarting btsync instance 'user2':.
Autostarting btsync instance 'user3':.

root@debomvbtsync-vm:~# service btsync restart
Stopping P2P file synchronisation daemon(s)...Stopping btsync instance 'debconf-default':.
Stopping btsync instance 'user1':.
Stopping btsync instance 'user2':.
Stopping btsync instance 'user3':.
Starting P2P file synchronisation daemon(s)...Autostarting btsync instance 'debconf-default': failed!

root@debomvbtsync-vm:~# service btsync restart
Stopping P2P file synchronisation daemon(s)...Stopping btsync instance 'debconf-default':.
Starting P2P file synchronisation daemon(s)...Autostarting btsync instance 'debconf-default': failed!

Then i putted a new line with "sleep 1" at line 185 in "/etc/init.d/btsync".


183 # since btsync does not return an acceptable error
184 # code, we must check that it is really running
185 sleep 1
186 if which pgrep > /dev/null; then
187 if pgrep $(basename $DAEMON) > /dev/null; then
188 STATUS=0
189 else
190 log_error "Failed to start $NAME instance $BASENAME - please check the configurat$
191 STATUS=1
192 fi
193 fi

Now, i can restart btsync 10 times without any problems. :huh:

Well ...

If no one else has noticed or reported this problem, I can live with a workaround.

Link to comment
Share on other sites

Released new packages 1.1.42-2 with a few bugfixes. All Debian builds are now online. As usual, Ubuntu builds will be probably available in a few hours.

Changelog:


btsync (1.1.42-2~sid) sid; urgency=low

- Fixed: On slow systems the init scripts may fail
under certain conditions (Reported by Christian Wantia)
- Fixed: The init script did not reliably detect if a
btsync instance is really started when more than one
instance was defined

-- Leo Moll <leo.moll@yeasoft.com> Tue, 18 Jul 2013 14:03:27 +0200

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.