Seems like chowning the file fails. Anything I am missing?
The above was tried in Ubuntu 20.04.5, using v1.21.0 from the official apt repo, with a simple 2-machine sync with default settings (and syncOwnership, syncOwnership set to true).
We have a bunch of hardening options in the systemd file, maybe they interfere with the capabilities; or maybe capabilities need to be stated some other way in the systemd file?
So I’ll try the various systemd options to figure it out…
PS. ideally it could be possible to set the caps only in systemd (not in the executable). This would allow to use syncOwnership without messing with system updates!
To avoid having to edit syncthing’s systemd service file directly (which will cause conflicts on upgrades), you can use systemctl edit to create an override file (to be applied on top of the existing service file).
# systemctl edit syncthing@vagabond.service
then add CapabilityBoundingSet and AmbientCapabilities (with your caps as value, see the documentation) in the [Service] section.