I’m unable to make Syncthing to set UID/GID of files. Files syncs well but ownership is syncthing:syncthing. I dont want to edit the user running the service since I want my setup to work for multiple users.
Wether I tick “Sync Ownership” or “Copy Ownership From Parent“ I get syncing: handling dir (setting metadata): copy owner from parent: lchown *my folder*: invalid argument.
I created a brand new share, as clean as possible, enabled the CopyOwnershipFromParent, I get syncing: finishing: setting metadata: copy owner from parent: lchown .syncthing.*my file*.tmp: invalid argument. The file has no special character and looks like that on the receiving end -rw-r–r-- 1 syncthing syncthing 0 Jan 25 15:53 .syncthing.site_content.html.tmp
For what it’s worth, I had this issue with many other services. So what I did instead is I tried replicating how debian does group permissions.
Create a group for your user and change your files and folders to have group ownership to that group. ‘chown -R user:user /home/user’
Add syncthing to your user group, this will allow syncthing to inherit your group permissions for any file/folder
Set all folders to have a sticky group (preventing syncthing from taking group ownership). find /home/user -type d -exec chmod 2770 {}\;
Set the systemd service umask to 5007 (2770 mode) this makes the syncthing service preserve rw access to the group and created folders inherit the sticky gid