Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

SOLVED Disable/Enable SMB through cron?

Spud

Member
Joined
Oct 23, 2011
Messages
106
Without going into details why I want to do this...

Is it possible to turn off the service SMB using cron some how and then turning it back on again? And if it is possible, once you turned it back on it would keep the same setting as defined in services/SMB configuration?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
6,646
It will keep the same service configuration. You can have the shell scrip run the command midclt call service.stop cifs to stop it and midclt call service.start cifs to start it. This may not be feasible if you are in an AD environment (because it will stop winbindd at the same time). In 11.3 I'm de-coupling the samba daemons so that they can be started and stopped independently.
 

Spud

Member
Joined
Oct 23, 2011
Messages
106
It will keep the same service configuration. You can have the shell scrip run the command midclt call service.stop cifs to stop it and midclt call service.start cifs to start it. This may not be feasible if you are in an AD environment (because it will stop winbindd at the same time). In 11.3 I'm de-coupling the samba daemons so that they can be started and stopped independently.
Excellent, thanks dude!
 
Top