teoky Posted August 11, 2014 Report Share Posted August 11, 2014 Hello QNAP Model: TS-809UFirmware version: 4.1.0Bittorrent Sync verison: 1.3.109Linux version: 3.4.6 (root@NasX86-13) (gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #1 Normally, by default, Bittorrent Sync runs on linux as the user: “root” and group: “administrators” and writes these owner:group permissions to syncronized files and folder that it creates. In the case of the QNAP NAS, Bittorrent Sync writes files and runs as the user “admin”. I have successfully managed to enforce all sub-folders and files in my sync folder to inherit the group “btsync” in the file permissions by using:chown admin:btsync /syncchmod g+s /syncThe problem is that Bittorrent Sync creates new files and folders with read-only permissions for the group “bysync” (i.e. wxr-xr-x / octal 0755). From researching I have found that the 2 ways to change this normally would be: 1) Add this line to the btsync.conf file and restart btsync:// DAEMON_UMASK=0022) Use the following command and when prompted enter "002" as the umaskdpkg-reconfigure btsyncNeither of the 2 above methods resolve the issue. In the case of item 1, this setting seems to be ignored by btsync. With item 2, “dpkg-reconfigure” is not a command available on the version of linux used by the QNAP NAS. Thank you in advance for your help! Quote Link to comment Share on other sites More sharing options...
tuxpoldo Posted August 13, 2014 Report Share Posted August 13, 2014 Hello QNAP Model: TS-809UFirmware version: 4.1.0Bittorrent Sync verison: 1.3.109Linux version: 3.4.6 (root@NasX86-13) (gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #1 .... From researching I have found that the 2 ways to change this normally would be: 1) Add this line to the btsync.conf file and restart btsync:// DAEMON_UMASK=0022) Use the following command and when prompted enter "002" as the umaskdpkg-reconfigure btsyncNeither of the 2 above methods resolve the issue. In the case of item 1, this setting seems to be ignored by btsync. With item 2, “dpkg-reconfigure” is not a command available on the version of linux used by the QNAP NAS. Thank you in advance for your help! The command and the configuration file setting will not work in your case. I suppose you took your information from the thread Debian And Ubuntu Server Unofficial Packages For Bittorrent Sync. All information in that thread is only related to the Debian/Ubuntu packages. Since your system is a QNAP NAS, I'm quite sure that you are using the btsync QPKG that is totally different from the Debian/Ubuntu package (that is not compatible with the QNAP OS and IMHO there is no way to install it on QOS). Quote Link to comment Share on other sites More sharing options...
teoky Posted August 13, 2014 Author Report Share Posted August 13, 2014 Hi tuxpolodoYes it is the QPKG. Is there a way to make the QPKG version of btsync write the file permissions we need?Thanks! Quote Link to comment Share on other sites More sharing options...
RomanZ Posted August 14, 2014 Report Share Posted August 14, 2014 @teoky The official QPKG contains 1.3.106 build. Did you use some unofficial QPKG or simply updated binary manually? Quote Link to comment Share on other sites More sharing options...
teoky Posted August 14, 2014 Author Report Share Posted August 14, 2014 Hi RomanZ Sorry for the confusion!.. I made a mistake.... I am running Bittorrent Sync on PCs and Macs also and they are all version 1.3.109. The version I am running on the QNAP is the QPKG standard installation and yes you are correct, I just double-checked and it is 1.3.106 Thanks Quote Link to comment Share on other sites More sharing options...
richard-bt Posted August 19, 2014 Report Share Posted August 19, 2014 teoky, I am not sure what you are trying to accomplish with the group "btsync". This is not a user or group created by the official BitTorrent QNAP package. Are you following some how-to/tutorial? On QNAP we run Sync under the "admin" user and so all files/folders will be owned by "admin". I am not aware of any way to change the default permissions for new files. What are you trying to accomplish? This way we may investigate other solutions. Quote Link to comment Share on other sites More sharing options...
teoky Posted August 21, 2014 Author Report Share Posted August 21, 2014 Hi Richard I'm just trying to give users of the NAS read/write access to the syncronised files. Currently, if a file/folder is created on a PC or MAC which is running btsync, these files/folders are added to the QNAP NAS so that only the user "admin" has read/write access. Other users access this NAS as via network shares and can not edit anything created on the NAS by btsync (except for the user "admin") The group "bysync" is just an example. On the QNAP NAS, groups can be created (i.e. "department_a", "department_b", etc..) and users can be added to that group. We actually have several shared folders which bysync now sycronises across different physical sites. I have successfully managed to make files/folders created by btsync inherit the group permissions from the share's parent folder. The problem is that the group only has read permission and this needs to be read/write. I can't have all users logging on to the NAS' network share as the user "admin". Thanks Quote Link to comment Share on other sites More sharing options...
Vitalii2014 Posted September 10, 2014 Report Share Posted September 10, 2014 Hello! We have same problem. Any local person, except admin, can not edit files.Sorry for my question. Is there worked method to resolve this problem? Thanks Quote Link to comment Share on other sites More sharing options...
adam1v Posted September 10, 2014 Report Share Posted September 10, 2014 I would also like to add we have exactly the same problem between two Synology devices With the BTSync not correctly setting the file permissions on these files, its very much defeating the purpose of the software and means it cannot be used out of the box Quote Link to comment Share on other sites More sharing options...
teoky Posted September 11, 2014 Author Report Share Posted September 11, 2014 Hi Vitalii2014 and adam1v Still trying to find a solution. If you find one, please share it with me. I will do the same on here if I do. Thanks! Quote Link to comment Share on other sites More sharing options...
adam1v Posted September 13, 2014 Report Share Posted September 13, 2014 Any feedback from BTSync secs on this issue would greatly be appreciated Quote Link to comment Share on other sites More sharing options...
aaronliao Posted September 22, 2014 Report Share Posted September 22, 2014 adam1v - thanks for bringing this to my attention. Can you post some details about your configuration (ver of Sync, which Synology devices, etc?) Thanks!aaron Quote Link to comment Share on other sites More sharing options...
adam1v Posted September 22, 2014 Report Share Posted September 22, 2014 We are currently using BTSync 1.3, but we will test tomorrow with version 1.4We have a number of Synology devices at work and are lucky enough to have V1.3 for our production environment and V1.4 for our test environment.Due to the criticality and remote location of our production devices, we've decided to wait until version 1.4 matures a little and will consider upgrading around Christmas time when we recall the devices for maintenance and upgrades, during the shutdown.All devices are running DSM5 (latest update).We are using1x RS3614XS+2x DS421+All 3 devices are on the same network and part of a windows active directory.Please let me know if there is any further information required? I will test version 1.4 first thing tomorrow morning and will let you know our findings.Adam Quote Link to comment Share on other sites More sharing options...
adam1v Posted September 23, 2014 Report Share Posted September 23, 2014 We are testing V1.4 now, but wanted to update with 1.3 incase its an obvious the problem still exists in 1.4. The left side is the original file on the RS3614XS+ and the right side if the newly created file on the DS421+ It seems to have taken permission of the file, and not applied the same file permissions after sync; Quote Link to comment Share on other sites More sharing options...
RomanZ Posted September 23, 2014 Report Share Posted September 23, 2014 @adam1v As to your permissions issue - it is the design. Permissions (and owning users as well) are not transferred by Sync. Sync runs under some user. When Sync receives new file - it creates a file with the user and user group which actually running the process as owner and sets permission according to umask. Quote Link to comment Share on other sites More sharing options...
teoky Posted September 26, 2014 Author Report Share Posted September 26, 2014 @RomanZ In the case of a QNAP NAS,... There doesn't appear to be a way to change the owner of the btsync process. Therefore users can not edit edit files and folders created by btsync because the users are not "Admin". There also appears to be no way to make btsync write with the correct UMASK to allow for the "group" to read/write. Thanks Quote Link to comment Share on other sites More sharing options...
adam1v Posted September 26, 2014 Report Share Posted September 26, 2014 @Roman,I think this needs to be re-considered for a more permanent solution, you cannot expect NAS owner to have to SSH into their devices and modify user permissions of the running process? Quote Link to comment Share on other sites More sharing options...
teoky Posted September 26, 2014 Author Report Share Posted September 26, 2014 @adam1vAm I able to SSH into a QNAP NAS and modify the user of the btsync process? While I agree this this is not a solution, this would at least be a work around for me for now. I can not seem to find a way to do this. Actually, even if I could just set btsync to write the correct UMASK would be a workaround for now. I think the solution should be that the files and folders inherit the permissions of the parent directory. This is how it appears to work on the Windows and OS X versions. Thanks Quote Link to comment Share on other sites More sharing options...
adam1v Posted September 26, 2014 Report Share Posted September 26, 2014 Hi teoky,Im not familiar with QNAP but I imagine you can telnet in, its probably running some form of unix.Im not overly familiar with SSH commands so I will have to seek further information on running this command. Quote Link to comment Share on other sites More sharing options...
teoky Posted September 26, 2014 Author Report Share Posted September 26, 2014 Thanks adam1vActually that is the issue I am having. It is running 'a form' of linux but none of the normal linux fixes to this problem seem to apply to the QNAP version so I am stuck. If anyone does know how to do this, please let me know. Thanks! Quote Link to comment Share on other sites More sharing options...
Nonplay Posted September 26, 2014 Report Share Posted September 26, 2014 I have exatcly the same issue with a new SEAGATE NAS 2BAY. The BitTorrent Sync was installed directly by the App Center on the NAS.The daemon runs with root privileges and writes new folders and files with the same permissions. However, the group owner assigned to the files seems to be equal to that of the parent folder. In my configuration it would be sufficient to set automatically the group mask in RW in order to modify the files from other sources. Thanks. Quote Link to comment Share on other sites More sharing options...
Shaav Posted October 17, 2014 Report Share Posted October 17, 2014 It's been a bit of a nightmare, but I finally got this sorted on my two QNAP TS-421 Two step process: 1. I had to ssh in and edit the startup script: /etc/init.d/btsync.sh (which just links to /share/MD0_DATA/.qpkg/BitTorrentSync/btsync.sh and add the line: umask 002 somewhere near the beginning. I added it just before the "case". Note: it seems extremely likely that if you update the package you will need to redo this step! 2. Make sure that all your existing files and directories have sufficient privileges and the correct ownership. From the top level share (/share/MD0_DATA/<folder>): chgrp -R everyone * <--- make sure all the existing files and folders belong to the group "everyone"chmod -R 775 * <--- make sure all that the group has full permissions (this is what the umask above takes care of for new files and directories).chmod -R g+s * <--- set the "sgid" bit which forces new files and directories to inherit the group ownership. ---- One additional thing that was weird and frustrating while trying to test stuff; while logged in as admin the sgid bit was not being inherited by directories that I manually created. (!!) So you'd create be in a directory; create a new subdirectory---it would have the correct group but NOT the sgid which it should also inherit. Then you'd create a new file in the subdirectory and it would NOT have the correct group. Fortunately, it seems that btsync still runs OK and sets it correctly. Quote Link to comment Share on other sites More sharing options...
drego85 Posted October 17, 2014 Report Share Posted October 17, 2014 It's been a bit of a nightmare, but I finally got this sorted on my two QNAP TS-421Two step process:1. I had to ssh in and edit the startup script: /etc/init.d/btsync.sh (which just links to /share/MD0_DATA/.qpkg/BitTorrentSync/btsync.shand add the line:umask 002somewhere near the beginning. I added it just before the "case".Note: it seems extremely likely that if you update the package you will need to redo this step!2. Make sure that all your existing files and directories have sufficient privileges and the correct ownership. From the top level share (/share/MD0_DATA/):chgrp -R everyone * <--- make sure all the existing files and folders belong to the group "everyone"chmod -R 775 * <--- make sure all that the group has full permissions (this is what the umask above takes care of for new files and directories).chmod -R g+s * <--- set the "sgid" bit which forces new files and directories to inherit the group ownership.----One additional thing that was weird and frustrating while trying to test stuff; while logged in as admin the sgid bit was not being inherited by directories that I manually created. (!!) So you'd create be in a directory; create a new subdirectory---it would have the correct group but NOT the sgid which it should also inherit. Then you'd create a new file in the subdirectory and it would NOT have the correct group. Fortunately, it seems that btsync still runs OK and sets it correctly.Thanks, I try... Quote Link to comment Share on other sites More sharing options...
teoky Posted October 23, 2014 Author Report Share Posted October 23, 2014 Thank you @Shaav I was about to try out what you suggested but I updated to version 1.4 before trying and now btsync isn't working at all :/ I'll let you know once I can try it. Thanks!! Quote Link to comment Share on other sites More sharing options...
bnmlp Posted October 23, 2014 Report Share Posted October 23, 2014 Has anyone figured this out? I am running btsync on a Synology NAS with several users who cannot save to folders created by btsync. Very frustrating. I added // DAEMON_UMASK=002 to btsync.conf and it changed nothing. Any other versions of this change to btsync.conf caused btsync to refuse to run. 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.