Debian BTsync daemon permissions


niekwoo10

Recommended Posts

DAEMON_UMASK=0011

More Info in the initial posting

Okay, here's the beginning of my config file:

//!/root/.btsync/btsync --config////DAEMON_UID=www-data//DAEMON_UMASK=0011{  "device_name": "Cubian",  "listening_port" : 53,                       // 0 - randomize port/* storage_path dir contains auxilliary app files   if no storage_path field: .sync dir created in the directory   where binary is located.   otherwise user-defined directory will be used*///  "storage_path" : "/home/user/.sync",// uncomment next line if you want to set location of pid file// "pid_file" : "/var/run/btsync/btsync.pid",

For some reason it doesn't work. I think it's because the line is commented, but when I remove the comment I get an error.

Link to comment
Share on other sites

It must be commented. Read the initial posting.

 

And it works. But there are some limitations:

 

  1. Files that are already present, will not be changed. You have to to change the old files manually. Only newly created files will be created based on the new UMASK
  2. The UMASK is only a mask (and not a mode). The default UMASK is typically 0022 - that means that all objects created with 666 will become 644 and all objects created with 777 will become 755. By default applications create files with 666 and directories with 777. This results by default in directories with 755 and files with 644. By setting the UMASK to 0011 you will get directories with 766 and files with 666
Link to comment
Share on other sites

Your question was "How do I change the default permissions of new files to 766?" - not "How do I change the user under which credentials the daemon runs?"

 

But I will give you good news: you will also find the answer to that question in the initial posting. Using DAEMON_UID=<username> was the right way to do it.

 

One tip: you can find out more in the system log and also when starting manually the daemon with service btsync restart, if you uncomment the last line (the one with DAEMON_INIT_DEBUG) in the file /etc/default/btsync

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.