Debian And Ubuntu Server Unofficial Packages For Bittorrent Sync


Recommended Posts

Thank you tuxpoldo. I already removed and purged both packages.

I did test the packages on a QEMU Armel machine I use before going to my NAS and it worked without problems.

 

What more details can I provide?

 

Something about the hardware. In any case I have two theories about what may go wrong on your machine. In the configure-phase the btsync-common package invokes the btsync executable in order to produce the sample configuration file saved together with all other documentation files. Nowadays we know that there are at least two possible causes that prevent btsync to run on machines with the armel platform:

 

  1. Alignment
  2. The ominous missing symbolic link to ld-linux.so.3

 

The first issue was already resolven in the btsync package, but this is not enough, since the btsync-common package will be configured before...

The second issue was reported a few days ago, and I'm working on a solution for the next release

 

But you can help me by looking for the following things on your machine:

 

  1. Is there a file or symbolic link called /lib/ld-linux.so.3 on your machine?
  2. Try the following:

 

sudo echo 2 > /proc/cpu/alignmentsudo apt-get isntall btsync-common

 

and let me know the result...

Link to comment
Share on other sites

On the Qemu that worked:

  • /lib/ld-linux.so.3 is present and links to ld-2.11.3.so
  • "sudo echo 2 > /proc/cpu/alignment" gives "Permission denied" error.

 

For the real NAS, I'll check this evening at home.

About HW: RAM 128Mb, system disk free space is several Gb.

 

Thanks for now.

Link to comment
Share on other sites

On the Qemu that worked:

  • /lib/ld-linux.so.3 is present and links to ld-2.11.3.so
  • "sudo echo 2 > /proc/cpu/alignment" gives "Permission denied" error.

 

For the real NAS, I'll check this evening at home.

About HW: RAM 128Mb, system disk free space is several Gb.

 

Thanks for now.

 

 

Same for me ;-) - I'm only wondering about the Permission denied error... But this is not interesting since on qemu it runs. It is really interesting to know, how this behaves on the NAS... But please let me know, which kind of NAS this is (Manufacturer, Model)

Link to comment
Share on other sites

On the Qemu that worked:

  • /lib/ld-linux.so.3 is present and links to ld-2.11.3.so
  • "sudo echo 2 > /proc/cpu/alignment" gives "Permission denied" error.

 

Here I am with my NAS!

 

First the link, same as Qemu:

root@LG-NAS:/lib# ls -l ld*-rwxr-xr-x 1 root root 122340 Jan 24  2011 ld-2.11.2.solrwxrwxrwx 1 root root     12 Mar 19  2013 ld-linux.so.3 -> ld-2.11.2.so

Second the cpu alignment: the command run without error, then I tried installing btsync and this time it seems all good!!

Selecting previously deselected package btsync-common.(Reading database ... 22784 files and directories currently installed.)Unpacking btsync-common (from .../btsync-common_1.2.72-1_armel.deb) ...Selecting previously deselected package btsync.Unpacking btsync (from .../btsync_1.1.82.1-3_armel.deb) ...Processing triggers for hicolor-icon-theme ...Setting up btsync-common (1.2.72-1) ...Setting up btsync (1.1.82.1-3) ... * Starting P2P file synchronisation daemon(s)...                                                                                                                                                              * Autostarting btsync instance 'debconf-default'       

I don't know what's the magic behind the cpu alignment, but I wonder if I have to set it at startup to avoid future possible errors...

Link to comment
Share on other sites

Here I am with my NAS!

...

Second the cpu alignment: the command run without error, then I tried installing btsync and this time it seems all good!!

...

I don't know what's the magic behind the cpu alignment, but I wonder if I have to set it at startup to avoid future possible errors...

 

Thank you for your help. On Service startup there is already a routine that checks for the bad alignment and fixes it if needed. The problem was in the installation routine of btsync-common. See https://github.com/tuxpoldo/btsync-deb/issues/45 - I will add a fix in the next version of the btsync-common package... This should not happen again...

Link to comment
Share on other sites

I meant system startup. Did you mean the same or btsync startup?

 

All packages online now will check if the alignment setting must be changed before invoking the executable. The package btsync was already doing this in the init script. The package btsync-common did it not, and so it failed to install on machines with than problem if the value was not set. This has now been corrected.

Link to comment
Share on other sites

Released new btsync server package 1.2.0-1 with a few bugfixes and another fundamental change in the structure of the packages that permit separate releases of the btsync server package and the btsync-user desktop package. Furthermore the versioning scheme has changed, since it is not dependent any more from the version number of the BitTorrent Sync core releases.

 

The btsync server package will start it's own versioning with version 1.2.0-1

 

Both Debian and Ubuntu builds are online on debian.yeasoft.net - The Ubuntu builds on Launchpad will be probably available in 2-4 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.

 

And here the change log:

 

btsync (1.2.0-1) unstable; urgency=low  * Separated server from desktop package in order to permit    separate releases (Closes #38)  * Added debconf support for all advanced settings (Closes #36)  * Fixed missing logfile generation broken with new btsync    version 1.2.67 (Closes #40)  * Added support for configuring verbose logging in the configuration    file using DAEMON_DEBUG= (Closes #44)  * Substantial improvements in error detection and reporting of the    daemon init script.  * Added Galician translation to debconf templates contributed    by Miguel Anxo Bouzada (Closes #35)  * Added Spanish translation to debconf templates contributed    by VCLL (Closes #26)  * Added Chinese simplified translation to debconf templates contributed    by Julian (Closes #43)-- Leo Moll <leo.moll@yeasoft.com>  Sat, 16 Nov 2013 17:26:58 +0100
Link to comment
Share on other sites

A simple questione: is the out-of-the-box installation supposed to start the service at system startup?

I'm asking because I always find the service down, but in the scripts I find that AUTOSTART is set to all...

 

 

Yes. The installation routine registers the btsync as default service (update-rc.d btsync defaults). Please check first, if your service starts if you are starting it manually (service btsync start). If it does not start, then you can't expect it to start at system startup. If a manual start works, you should find out, if there are some prerequisites that are not met during the startup phase (like parts of the filesystem not mounted by default...). You can find some more information about the startup of btsync in the system log.

 

A second reason for the service to be down after startup, is that it crashed. You should look at the log file of btsync and in case activate debug logging in order to find out, if the service starts but then crashes.

Link to comment
Share on other sites

Yes, manual start works; I searched log files, but haven't found: can you tell me where to look at?

 

It may depend on filesystem mounting, anyway: if that is the case, how can I postpone btsync start?

 

The logfile is stored by btsync in the storage_path and is named sync.log Instructions about how to enable debug logging can be found here: http://forum.bittorrent.com/topic/12658-if-you-have-syncapp-issue/

 

Postponing the service start does make sense only, if the service depends on filesystems mounted in a custom (non regular) way (e.g. not using automount) since by default btsync will be started after the whole base system and networking is up. If you have configured such a thing, you should also know how to manage all dependent things. If you play around with the boot sequence and start implementing your own things, you should try to learn as much as possible about the inner working of the init process in order to handle all the problems. This forum is not the rights place for discussing such topics.

 

In any case you must try to understand, what happens on your machine:

 

  1. look at the system log to see if the init script throws an error when starting up btsync
  2. If you see no btsync related error during the startup sequence in the system log, you should look at the btsync log file in order to see, if btsync stops or crashes after the start.
Link to comment
Share on other sites

Well, I didn't touch anything about mounting; I was only guessing, since I put my btsync directory outside the root filesystem and on the big data partition of the NAS.

 

In any case, I am not able to find any trace of btsync in /var/log/ files apart from when I start it manually, when I find

syslog:Nov 19 18:26:39 LG-NAS btsync.debconf-default: Changing alignment setting for executing btsync

No trace of sync.log in /var/lib/btsync neither, even if I found it on Qemu.

 

What would you suggest?

Link to comment
Share on other sites

What would you suggest?

 

I would suggest that the next time you have a problem and you ask for help in the forum, you start by telling us something about the system because this is really important ;-) At least from your last posting, we can learn some very interesting things that are absolutely relevant in order to understand your problem:

 

  1. You are running btsync on an ARM Platform
  2. You are running btsync on a LG NAS
  3. You are running a default instance
  4. There is no sync.log in /var/lib/btsync (that is the storage_path of a default instance)

 

From 3 and 4 I deduce, that you are running an outdated version. Starting with btsync 1.2.x they changed the default handling of logging, and it was not working any more with the btsync server packages (See this thread for details). In order to get again log files in the storage_path, you must make sure, that the following versions of the packages are installed on your machines:

 

btsync-common >= 1.2.73-1

btsync >= 1.2.0-1

 

From 1 and 2 I deduce, that you are not running a typical computer installed with a standard Debian or Ubuntu, but a NAS either running a Debian based OS provided by the vendor or a Debian based port for the device. In any case, it's possible that the startup of system services is implemented somehow differently from a standard computer installation.

 

And since your manual start of btsync generated the message "Changing alignment setting for executing btsync" in the system log (I suppose that you verified that the message was created by your manual start by checking the timestamp of the message) and this message can appear only once in a boot lifecycle (the alignment setting stays active until the next boot), we know for sure, that on system startup there was no attempt to start the btsync service.

 

And now I would say that you should try to find out the difference between an original Debian and the distribution running on your NAS in relation to how services are tagged to be started in certain runlevels.

 

I would start by checking if the symbolic links to the run level startup directories were created successfully. Here an example from my local router running Debian Wheezy on an ALIX board:

tuxpoldo ~ # ls -la /etc/rc?.d/*btsync*lrwxrwxrwx 1 root root 16 Nov 14 14:59 /etc/rc0.d/K01btsync -> ../init.d/btsynclrwxrwxrwx 1 root root 16 Nov 14 14:59 /etc/rc1.d/K01btsync -> ../init.d/btsynclrwxrwxrwx 1 root root 16 Nov 14 14:59 /etc/rc2.d/S03btsync -> ../init.d/btsynclrwxrwxrwx 1 root root 16 Nov 14 14:59 /etc/rc3.d/S03btsync -> ../init.d/btsynclrwxrwxrwx 1 root root 16 Nov 14 14:59 /etc/rc4.d/S03btsync -> ../init.d/btsynclrwxrwxrwx 1 root root 16 Nov 14 14:59 /etc/rc5.d/S03btsync -> ../init.d/btsynclrwxrwxrwx 1 root root 16 Nov 14 14:59 /etc/rc6.d/K01btsync -> ../init.d/btsync

If the links are missing, something prevented the setup program to create them, and this would explain, why it is not running...

Link to comment
Share on other sites

Sorry, I thought I would have been recognized as the one who asked for his Armel NAS.

 

About versions, I didn't expect them to be old, as I installed btsync a few days ago, but that was true: I'm now updating.

 

Now for the differences in the Debian provided by LG.

 

To begin with, there is no /etc/rc?.d directory!

 

I don't know if this is stanard, by I only have /etc/rc.local which contains:

#!/bin/sh -e## rc.local## This script is executed at the end of each multiuser runlevel.# Make sure that the script will "exit 0" on success or any other# value on error.## In order to enable or disable this script just change the execution# bits.## By default this script does nothing.exit 0

And if I wrote this right

 find -L / -mount -samefile /etc/init.d/btsync

there is no link to the script...

 

The same is for another service that starts for sure, though.

 

And I found that btsync is contained in /etc/runleve.conf

# This file was automatically generated by /usr/share/file-rc/rclink2file.sh.# You can use your favourite editor or update-rc.d(8) to modify it.# Read runlevel.conf(5) man page for more information about this file.## Format:# <sort> <off-> <on-levels>     <command>10      -       S               /etc/init.d/mountkernfs.sh10      -       S               /etc/init.d/hostname.sh10      -       S               /etc/init.d/module-init-tools10      -       S               /etc/init.d/udev10      -       S               /etc/init.d/nas-preinit10      0,6     S               /etc/init.d/ifplugd10      -       S               /etc/init.d/ifupdown-clean10      -       S               /etc/init.d/ifupdown10      -       S               /etc/init.d/mountdevsubfs.sh10      0,6     S               /etc/init.d/hwclock.sh20      -       S               /etc/init.d/networking20      -       S               /etc/init.d/mtab.sh20      -       S               /etc/init.d/dbus20      -       S               /etc/init.d/mountall.sh20      -       S               /etc/init.d/udev-mtab20      -       S               /etc/init.d/portmap20      0,6     S               /etc/init.d/lprng20      0,6     S               /etc/init.d/nfs-common20      0,6     S               /etc/init.d/dropbear20      0,1,6   2,3,4,5         /etc/init.d/deluged20      0,1,6   2,3,4,5         /etc/init.d/btsync30      -       S               /etc/init.d/procps30      -       S               /etc/init.d/fuse#20     -       S               /etc/init.d/s_mirror30      -       S               /etc/init.d/avahi-daemon30      -       S               /etc/init.d/lld2d30      -       S               /etc/init.d/binfmt_misc30      0,6     S               /etc/init.d/apache230      0,6     S               /etc/init.d/platformd30      0,6     S               /etc/init.d/acpid30      -       S               /etc/init.d/ip_setupd30      -       S               /etc/init.d/chs30      -       S               /etc/init.d/nas-icond40      -       S               /etc/init.d/sysklogd40      -       S               /etc/init.d/klogd40      -       S               /etc/init.d/cron40      -       S               /etc/init.d/oddmngrd40      -       S               /etc/init.d/cmsdaemon40      -       S               /etc/init.d/nas-postinit99      -       S               /etc/init.d/rc.local50      0,6     -               /etc/init.d/binfmt_misc50      0,6     -               /etc/init.d/fuse50      0,6     S               /etc/init.d/rsync50      0,6     -               /etc/init.d/hwclock.sh50      0,6     -               /etc/init.d/mountoverflowtmp50      0,6     -               /etc/init.d/klogd50      0,6     -               /etc/init.d/sysklogd50      -       0,6             /etc/init.d/sendsigs50      -       0,6             /etc/init.d/urandom50      -       0,6             /etc/init.d/umountnfs.sh50      -       0,6             /etc/init.d/portmap50      -       0,6             /etc/init.d/networking50      -       0,6             /etc/init.d/ifupdown50      -       0,6             /etc/init.d/umountfs50      -       0,6             /etc/init.d/umountroot50      -       0               /etc/init.d/halt50      -       6               /etc/init.d/reboot# THE LAST LINE IS NEVER READ

Another interesting thins, I suppose, is that "runlevel" reports "unknown".

 

At the moment I don't know what else to look at...

 

Thank you for support!

Link to comment
Share on other sites

Sorry, I thought I would have been recognized as the one who asked for his Armel NAS.

Sure. You were. But anybody here using btsync has at least two computers. The majority of us, has lots and lots of computers... ;-) I'm using btsync on 8 workstations (each different from the other), 4 routers, 2 NAS, 12 servers.... etc.

To begin with, there is no /etc/rc?.d directory!

 

I don't know if this is stanard, by I only have /etc/rc.local which contains:

I would say, that this is the final answer to the problem. The OS of your NAS is "debianoid" enough to permit the installation of .deb packages but not "debianoid" enough to be compatible to real mean Debian in relation to the startup sequence.

Since I have not such a NAS, I have no idea how to solve your problem. But looking at the file you posted, I have the impression, that your NAS boots up only in runlevel S. I would suggest to replace the line

20      0,1,6   2,3,4,5         /etc/init.d/btsync
with

20      0,6     S               /etc/init.d/btsync
If this does not work, you should ask for help in a forum with people knowing more about the distribution running on your NAS.
Link to comment
Share on other sites

Hello, sorry for being away.

 

I read your suggestion, but the file you say to edit is automatically generated by a script...

Maybe I have to work somewhere else, I'll look around to see if I find the "source" for this script.

 

Thanks for help!

 

[EDIT]

Well, I found this being interesting http://packages.debian.org/sid/file-rc

 

In any case the file shows us a fundamental difference between the btsync service and all other services installed on the system. Nearby every service will be started at runlevel S (that means Single user mode - see https://wiki.debian.org/RunLevel). Only btsync (and deluged - whatever this may be) are configured for running at runlevels 2,3,4,5. 

 

Differently from a standard Debian installation, your NAS seems always to boot into the Single user mode runlevel, and this explains why btsync does not start automatically. The automatic installation routine seems to take the default runlevels from the comment in the init script:

#!/bin/sh### BEGIN INIT INFO# Provides:          btsync# Required-Start:    $network $remote_fs $syslog# Required-Stop:     $network $remote_fs $syslog# Should-Start:      network-manager# Should-Stop:       network-manager# Default-Start:     2 3 4 5# Default-Stop:      0 1 6# Short-Description: btsync Service# Description: This script will start btsync service instances as specified#              in /etc/default/btsync and /etc/btsync/*.conf### END INIT INFO# Author: Leo Moll <leo.moll@yeasoft.com>
Basically it should be possible also to deploy an init script without these comments. In this case, the system should decide to use some default values in order to register the service.

 

Can you please make the following test and tell me about the results?

 

First of all, unregister the service:

update-rc.d -f btsync remove
And now check your /etc/runlevel.conf file in order to see, if btsync has really been removed.

 

Now remove the comment block from ### BEGIN INIT INFO to ### END INIT INFO from the /etc/init.d/btsync init script. Then reregister the service:

update-rc.d btsync defaults
And now check if something in /etc/runlevel.conf has changed. My idea is that this should work, if your NAS knows, that the Single user runlevel is default for service installation...

 

If this does not work, repeat the entire procedure, but instead of deleting the block, edit it with the following values and test the procedure again:

### BEGIN INIT INFO# Provides:          btsync# Required-Start:    $network $remote_fs $syslog# Required-Stop:     $network $remote_fs $syslog# Default-Start:     S# Default-Stop:      0 6# Short-Description: btsync Service# Description: This script will start btsync service instances as specified#              in /etc/default/btsync and /etc/btsync/*.conf### END INIT INFO
Link to comment
Share on other sites

Hello,

 

I found a bug who is a bit annoying ;)

 

I have 100 config for 100 users

 

simply

 

user1

user2

.

.

.

user10

.

.

.

user100

 

The issue is that the duplicate instance check a startup is matching user100 with user10 or user1 (longer config file name seems to be launched first)

 

I suppose the starting script is doing a "contains" instead of a "equal"

 

If you can have a look ;)

 

Thx!

 

EDIT:

problem is here

        if [ $(ls -l ${CONFIG_DIR}/${BASENAME}*.${CONFIG_EXT} 2> /dev/null | wc -l) -gt 1 ]; then
                log_error_msg "Duplicate instance name $BASENAME found. Interrupting sequence."
                exit 1
        fi
Edited by florentm
Link to comment
Share on other sites

I found a bug who is a bit annoying ;)

...

I have 100 config for 100 users

user1

user2

.

.

.

user10

.

.

.

user100

...

EDIT:

problem is here

        if [ $(ls -l ${CONFIG_DIR}/${BASENAME}*.${CONFIG_EXT} 2> /dev/null | wc -l) -gt 1 ]; then

                log_error_msg "Duplicate instance name $BASENAME found. Interrupting sequence."

                exit 1

        fi

 

Impressing! Thank you for the report. I will fix it in the next release. In the meantime you may replace the lines with:

 

 

        if [ $(ls -l ${CONFIG_DIR}/${BASENAME}.${CONFIG_EXT} ${CONFIG_DIR}/${BASENAME}.*.${CONFIG_EXT} 2> /dev/null | wc -l) -gt 1 ]; then                log_error_msg "Duplicate instance name $BASENAME found. Interrupting sequence."                exit 1        fi
See https://github.com/tuxpoldo/btsync-deb/issues/49 Edited by tuxpoldo
Link to comment
Share on other sites

Here we go.

update-rc.d -f btsync remove

removed the entry from runleve.conf

 

I removed the comments you said and run

update-rc.d btsync defaults

btsync is in runleve.conf again with this line

20      0,1,6   2,3,4,5         /etc/init.d/btsync

same as before.

 

Then I retried with different comments, but same result.

 

I'm not a Debian expert, but it looks to me that file-rc package should explain this behavior.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.