Wired behavior between mac os and linux

I copied initial a directory from linux to mac with rsync -avh as root. So we can assume that both directories 100% same, except the uids. Both devices have user g and n, which are both in a group w. The files in the folder can owned by g or n, but group is always w. The permission for group w is rw. I than added a folder with same FolderId on both devices and wait till they are completely scanned. Both show 1.596 files 94 folders complete size ~184 MiB. Then I shared them which each other. On mac os I get on Folder “Up to Date”, at device level, “Syncing 99%, 695 KiB”. On linux I get on Folder “Out of sync”, at device level, “Up to Date”. On detail, I see Out of Sync Items [940 items, ~695 KiB] and Failed Items [940 items]. The error mode is “chmod… operation not permitted”. On both devices I run syncthing as recommended as normal user. Both using version 1.16.1.

What’s wrong with my approach? Should I run syncthing better as root user? Which seems impossible for macos syncthing. Why does syncthing try a chmod? I don’t want to “Ignore Permissions”.

Hope someone can help me to solve the situation, because unison is in this setup difficult to handle.

It runs chmod because you don’t want to ignore permissions?

Permissions and ownership are different things. Syncthing does not sync ownership, only permissions, and for it to be able to manage permissions, it would make sense for it to be the owner of the files.

See: https://unix.stackexchange.com/a/76004

And why syncthing try to change the permissons if they are equal?

It runs chmod on every synced file. If permissions are unchanged, that’s a noop. The system still complains if you are not allowed to even try.

Okay that means: If I don’t set “Ignore Permission” synchthing is unusable on a folder where different users works on. Correct?

Sorry for the newbie questions (coming from linux with rsync and unison it’s a different mindset).

Generally Syncthing is meant to be used for a single user, yes. I.e. you run one instance of Syncthing for every user if data is separate, or if data is shared let it be owned by the user syncthing is running as.

You can grant the syncthing process the CAP_FOWNER privilege, then it should be able to chmod. You then likely also want to use the advanced CopyParentOwner functionality: all: Copy owner/group from parent (fixes #5445) by calmh · Pull Request #5479 · syncthing/syncthing · GitHub It’s an advanced feature, you really should be understanding well what it does and that it does what you want, otherwise better go with the “usual” scenarios described above.

Thanks to clarify. I will have a look at CAP_FOWNER and CopyParentOwner which sounds like StickyBit at Linux.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.