SOLVED Disable/Enable SMB through cron?

Spud

Contributor
Joined
Oct 23, 2011
Messages
117
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
9,545
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

Contributor
Joined
Oct 23, 2011
Messages
117
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