Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
BitTorrent Sync linux service script

####Go to temp dir $ cd /tmp ####Download your version of btsync i386 or x64 $ curl http://btsync.s3-website-us-east-1.amazonaws.com/btsync_i386.tar.gz -o btsync.tar.gz # i386 $ curl http://btsync.s3-website-us-east-1.amazonaws.com/btsync_x64.tar.gz -o btsync.tar.gz # x64 ####Then unpack this shit $ tar -xf btsync.tar.gz ####And move to your local bin $ mv btsync /usr/local/bin/ ####Okey, generate sample config $ btsync --dump-sample-config > ~/.btsync ####Change "storage_path" to correct path, I'm use /home/andrii/.sync, if u want too $ mkdir ~/.sync $ nano ~/.btsync ####Autorun $ update-rc.d btsync defaults

I'm trying to use this on Fedora 18 and I modified line 25 and line 19 to reflect the location of btSync and the sync.conf. Also the user to run as.

I'm getting an error at line 55 that start-stop-daemon command is not found. Should my changes work? This is for BTsync (the file syncing project) right?

  1. I changed the following to avoid this output , when callinig /etc/init.d/btsync
    ( X11 connection rejected because of wrong authentication. )

    config="su -c 'echo $HOME' $user/.btsync"
    to
    homedir=$(getent passwd $user | awk -F: '{print $6}')
    config="$homedir/.btsync"

  2. in the config file $home/.btsync I set the PID file like in /etc/init.d/btsync

    "pid_file" : "/var/run/syncapp/syncapp.pid",

  3. The system V Skript should always start on boot

    update-rc.d btsync defaults

Thank you for your work
bernd

Dear Korzhyk
Never mind my initial question.

What was missing for me was to run the command

update-rc.d btsync defaults

to add btsync to the default startups.

Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment