xkiter Posted July 8, 2013 Report Share Posted July 8, 2013 Friends of this forum.I believe this is a bug or lack of deep knowledge but... I exhausted all my tricks to solve it, so maybe you can help.When installing btsync on a Ubuntu 13.04 headless, I have it sync quite fast w/ other windows machines and everything seems working ok. Problem is that I want to use the sync folders in OwnCloud setup, that makes mandatory that folders (and files) are writeable. I was able to make all the "remotely" created files (synced from remote machines) read/write by btsync (and thus also OwnCloud), but all the folders/directories created by btsync are r-x only, ie, read only and thus one can't delete them from OwnCloud.Any suggestions on how to force btsync to rw the new folders it creates?Thanks all for help. Quote Link to comment Share on other sites More sharing options...
Disappointed Cat Posted July 8, 2013 Report Share Posted July 8, 2013 Run btsync from the same user as owncloud.Or you could use file ACLs. Quote Link to comment Share on other sites More sharing options...
xkiter Posted July 8, 2013 Author Report Share Posted July 8, 2013 Tried the file ACLS, but btsync creates the files OK (rw) but insists on directories/folders as (rx)... does anyone else reproduce this? Quote Link to comment Share on other sites More sharing options...
LazyWolf Posted July 8, 2013 Report Share Posted July 8, 2013 I have not been able to reproduce it, I think it might be a mask issue...I would check /etc/login.defs, /etc/profile, and $HOME/.profile to see what your umask is set to, should be 022(rwxr-xr-x).Also you could use setfacl to set a default mask for the folders. Quote Link to comment Share on other sites More sharing options...
christophk Posted July 8, 2013 Report Share Posted July 8, 2013 Hi xkiterI also tried to use BTsync as the owncloud sync client instead of the original one.The problem that accurs is this as far as I am concerned:Go to the folder where your owncloud data folder is in (e.g. for /home/user/data)/home/user/and ls -l it:drwxrwx--- 7 www-data www-data 4096 Jul 8 14:49 dataNow go to the folder that is being synced by BTsync:/home/user/data/oc-user/files and type ls -l.inside that folder I have a synced folder (syncfolder) and the permissions are:drwxr-xr-x 3 root root 4096 Jul 8 15:15 syncfolder.That's because BTsync is running as root on my machine.Is that the same for you?Then we should just run BTSync as www-data as "Lighting" is proposing.Can someone explain me how this is done? Probably not really a btsync issue, more a linux isssue...Anyways, would be glad if someone could help!I hope the above makes sense...Kind Regards,CK Quote Link to comment Share on other sites More sharing options...
Disappointed Cat Posted July 8, 2013 Report Share Posted July 8, 2013 Like this: Preferably with a simple init script.Startsu "www-data" -c "/path/to/btsync --config /path/to/config"Stopkillall -u "www-data" btsync Quote Link to comment Share on other sites More sharing options...
christophk Posted July 8, 2013 Report Share Posted July 8, 2013 Thanks a lot, Lightning!For now i get :su: unrecognized option '--config' So it didn't work when i run it directly in the command line. I will try it as an init... Quote Link to comment Share on other sites More sharing options...
christophk Posted July 8, 2013 Report Share Posted July 8, 2013 Did run it in an init.d. I get an error message when i run Sudo service btsync start:"Can't open pid file /home/user/.btsync/btsync.pid. Permission denieduser@server:/etc/init.d$"Can you give ma another hint on what to do now? Quote Link to comment Share on other sites More sharing options...
LazyWolf Posted July 9, 2013 Report Share Posted July 9, 2013 Here is some quick python I typed up, havent had time to test it properly but it looks like it should run...It needs to be launched by root(maybe something simple like adding to /etc/rc.local), and the system needs to have python.Filename: BTSync-launcher.pyroot:root(rwx------)#!/usr/bin/pythonfrom subprocess import Popen, PIPE# used to open the process and to hide the outputfrom os import setuid# Force the process to run as the set userfrom os.path import exists# Check to make sure config and bin existfrom sys import exit# early exitsfrom pwd import getpwnam# Used to get the uid of the given useruser = "www-data"pathToBTSync = "/path/to/btsync"pathToConfig = "/path/to/config"#\userUID = getpwnam(user)[2]# Dont touch!def main(): if not exists(pathToBTSync) or not exists(pathToConfig): print "Error finding %s or %s." % (pathToBTSync, pathToConfig) exit(1) Popen([pathToBTSync, '--config', pathToConfig], stdout=PIPE)if __name__ == "__main__": try: setuid(userUID) except OSError: print "You do not have permission to run this as %s try running it as root!" % user exit(1) main()Also in your BTSync config file make sure "pid_file" is in use and points to a folder that www-data owns and has rwx to. Quote Link to comment Share on other sites More sharing options...
christophk Posted July 9, 2013 Report Share Posted July 9, 2013 Hi LazyWolfThanks a lot for your help. I ran into some problems and am now trying to follow the apporach of tuxpoldowhich allows to run different instances of btsync based on different users.I will go on asking my questions there. ;-)Thanks for all already! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.