SMB : really bad form to have to restart the smb server every time a new share is added. (Dragonfish-24.04-RC.1)

Rob Granger

Dabbler
Joined
May 12, 2015
Messages
23
I only have a few TM shares that I use, but to create a new one will kill any other TM backup running. I guess I only have a few macs, so not a big fish, this would be totally bad in a production env if this is the same with standard smb shares.
 

PhilD13

Patron
Joined
Sep 18, 2020
Messages
203
You normally will need to restart services such as SMB when making configuration changes It only takes a few seconds to toggle off the service then toggle it back on, and it is how the service reads the new configuration. This is normal and applies to most systems and middlewhere like Truenas, Some systems will automatically trigger a service restart (QNAP will) on save of a configuration change.

I don't use a Mac or TM, but my understanding is the backup process will resume where it left off either when the share is remounted on the Mac or at the next run. You should also be able to pause then resume any backups.

Service restarts and even server restarts if necessary are done all the time even during production so it's not usually a big deal.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
You don't need to restart SMB every time a share is added. There is a prompt, but you can choose not to do that.

The situations where you must restart SMB are somewhat limited:
1. Enabling guest access for a share.
2. Setting up a new homes share.
3. Making global server changes to Services->SMB.
 

nabsltd

Contributor
Joined
Jul 1, 2022
Messages
133
You normally will need to restart services such as SMB when making configuration changes
Well-behaved services don't need restarts after a configuration change...they just read the new configuration. How they handle current connections when this happens depends of the type of service and what changed. For SMB, adding a new share shouldn't even be a blip on already connected sessions to existing shares. Changing the config of an existing share...that might require connections to be dropped.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Well-behaved services don't need restarts after a configuration change...they just read the new configuration. How they handle current connections when this happens depends of the type of service and what changed. For SMB, adding a new share shouldn't even be a blip on already connected sessions to existing shares. Changing the config of an existing share...that might require connections to be dropped.
See comments above. The situations where restart is warranted are limited.
 

nabsltd

Contributor
Joined
Jul 1, 2022
Messages
133
See comments above. The situations where restart is warranted are limited.
I figured that was the case, but I wasn't sure if Samba on TrueNAS had any differences from the reference code.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I figured that was the case, but I wasn't sure if Samba on TrueNAS had any differences from the reference code.
No, generally we try to avoid restarting services unless we absolutely must, it's best avoid impacting production. For instance, when user renames an SMB share we will close the original share (disconnecting clients to it), then create the new one rather than forcing a service restart. Least invasive approach is preferred because it should be up to the sysadmin whether to take more production-impacting steps. This is why we have some prompts saying basically "if you're doing one of these things, you may wish to restart the SMB service".
 

Rob Granger

Dabbler
Joined
May 12, 2015
Messages
23
You don't need to restart SMB every time a share is added. There is a prompt, but you can choose not to do that.

The situations where you must restart SMB are somewhat limited:
1. Enabling guest access for a share.
2. Setting up a new homes share.
3. Making global server changes to Services->SMB.
Ok, super, my thought was that it was mandatory. I do have to restart "/usr/sbin/service avahi-daemon restart" avahi to get a new or updated Timemachine share to propagate out.
Thanks for the clarification.
Rob
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Ok, super, my thought was that it was mandatory. I do have to restart "/usr/sbin/service avahi-daemon restart" avahi to get a new or updated Timemachine share to propagate out.
Thanks for the clarification.
Rob
We force reload of avahi on SMB share add if it is time machine share. Perhaps the clients are slow to pick up changes (mDNS is notoriously spotty).
 
Top