Sharing RW dataset between syncthing and smb

iLikeWaffles

Dabbler
Joined
Oct 18, 2019
Messages
15
Hi,

I have a dataset assigned to syncthing and on it's own it works fine. I have added this dataset to smb shares and after some permission twiddling, managed to get both to sort of coexist.

However, whenever the smbuser writes a new file to the dataset though samba, this new file is owned by the smbuser. Syncthing is unable to synchronize this file.

I have made a temporary workaround in the form of a cronjob that chowns every file on the shared dataset back to being owned by the syncthg user, but I feel this is the wrong solution.

Assuming that both SMB and syncthing will need to do reads and writes on this share, what's the recommended configuration for allowing both equal access to the dataset, without periodic chowning?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Add an ACL entry for the syncthing user. Assuming that syncthing is running in a jail with id 8675309 (which it isn't), you can run the following command at the root of your SMB share: setfacl -m u:8675309:MODIFY_SET:fd:allow /path/to/share then winacl -a clone -rv -p /path/to/share.
 

iLikeWaffles

Dabbler
Joined
Oct 18, 2019
Messages
15
So both working directory and path/to/share should point to dataset, and not the iocage's syncthing jail's mountpoint, right?

Code:
root@nas[/mnt/primary/Music]# pwd
/mnt/primary/Music
root@nas[/mnt/primary/Music]# setfacl -m u:8:MODIFY_SET:fd:allow /mnt/primary/Music
setfacl: malformed ACL: "access permissions" field contains invalid flag "M"
setfacl: u:8:MODIFY_SET:fd:allow: Invalid argument


Path to dataset
Code:
/mnt/primary/Music/


Path to syncthing mountpoint
Code:
/mnt/primary/iocage/jails/syncthing/root/mnt/Music/


Using FreeNAS 11.2. Will update if I find a solution.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
So both working directory and path/to/share should point to dataset, and not the iocage's syncthing jail's mountpoint, right?

Code:
root@nas[/mnt/primary/Music]# pwd
/mnt/primary/Music
root@nas[/mnt/primary/Music]# setfacl -m u:8:MODIFY_SET:fd:allow /mnt/primary/Music
setfacl: malformed ACL: "access permissions" field contains invalid flag "M"
setfacl: u:8:MODIFY_SET:fd:allow: Invalid argument

Sorry. That day I was probably switching back and forth between setfacl and the 11.3 websocket API for permissions. "MODIFY_SET" should be lower-case.
setfacl -m u:8:modify_set:fd:allow /mnt/primary/Music
 
Top