Odd Samba Behavior When Modifying Shares

Status
Not open for further replies.

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
All changes were made via the FreeNAS webgui. I've noted some odd behavior in samba. If I change the path of a share

Code:
[SHARE]
path = /mnt/Tank/foo

to
Code:
[SHARE]
path = /mnt/Tank/bar

Then users who have already established a tree connection on the samba server via mapped network drive on Windows will still show the contents of /mnt/Tank/foo. This will persist until the user logs out (forcing the windows SMB client to negotiate a new tree connection). Once the user does this, then navigating to the mapped network will display the contents of /mnt/Tank/bar.

Has anyone else noticed this? Would this be considered a bug, feature, holding it wrong?
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
Has anyone else noticed this? Would this be considered a bug, feature, holding it wrong?
Samba spawns a new process for every connection made. So if you change the configuration while a user is connected, then they're going to see the contents of the old dataset until, as you said, logs out. I don't think I'd consider this to be a bug or feature, just the nature that *nix processes work. If the child process gets told to re-read the config, then that might just fix it.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Samba spawns a new process for every connection made. So if you change the configuration while a user is connected, then they're going to see the contents of the old dataset until, as you said, logs out. I don't think I'd consider this to be a bug or feature, just the nature that *nix processes work. If the child process gets told to re-read the config, then that might just fix it.

Yeah, that makes sense. For some reason I was thinking that UI restarting the samba service, but it is basically executing the pre and post-samba scripts with "samba_server reload", which reloads the smb.conf but does not kill existing samba processes.

If I had just RTFMed, I would have seen:

"Reloading the configuration file will not affect connections to any service that is already established. Either the user will have to disconnect from the service, or smbd killed and restarted."

https://www.samba.org/samba/docs/man/manpages-3/smbd.8.html

So lesson learned, if you want to avoid this issue, manually toggle the CIFS service in the FreeNAS UI after making major changes such as the path.
 
Last edited:
Status
Not open for further replies.
Top