Add smb folder without restarting service

Good afternoon,
how can I create shared folders in SMB and not restart the service, since if I have active transfers these are dropped

I know that Samba can be instructed to reload the config with a sighup:

killall -HUP smbd

However, I’m unsure of how Rockstor manages share creation (and am not near my box at the moment to test)
It’s possible that the Rockstor interface fully restarts the service.

@Haioken I can chip in on the following point after a quick look at the code:

we have (when adding a share):

where if the systemctl status of first smb and then nmb have a return code of 0,

read by _restart_samba()

Where the hard restart is a restart, rather than a reload:

So on a cursory look it would seem we have provision for a config reload but in the 2 direct calls of restart_samba() they are both hard wired to restart ie (hard=True) and one of those is for a config change:

where we find:

So it may be we have an overkill bug here where we could use our own hard=False default for some samba actions.

It would need more looking into, ie how this relates to active directory for example, as those last 2 code excepts are close to code that considers active directly configs. It might be good to open an issue on this once we have proved reload’s capability in some of our existing settings as, from a quick look, I suspect it was intended to reload sometime when we are actually restarting.

Thanks @Jhonattan_Godoy_LorD and @Haioken for bringing attention to this. It would be a nice refinement to pin down. I can’t adopt this one myself for a bit however as I’ve got a bit of a backlog.