Christian Wantia

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by Christian Wantia

  1. 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.

  2. 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.