Restarting Samba from command line

diskmaster23

Dabbler
Joined
May 13, 2013
Messages
16
Tried looking for a solution, but wasn't able to find out how to restart services for FreeNAS. How do you restart the Samba service from the command line?

In addition, I would like to do a cron job where it restarts Samba once a night. I have a problem with not having swap space and the Samba freaks out causing it to crash. Having a cron job to restart Samba once a night will levitate this problem until I am able to create swap space for the OS.

Any assistance is greatly appreciated.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
You know if you search for "samba restart" the top thread(ignoring yours which is the top) has your answer.
 

cogprying

Dabbler
Joined
Jun 3, 2017
Messages
12
I'll second the love. I don't know whether it's inbreeding or some other affliction, but some developer thought it'd be an awesome idea to limit the auxiliary parameters of the smb share section of the webgui to 120 characters*, seemingly making the only way to now actually edit and add any being via CLI and a restart with it.

(And of course, Freenas doesn't do silly things like just leave things unchanged, so references like https://www.freebsd.org/doc/handbook/network-samba.html which state it's
Code:
service samba
are inaccurate.)
*
r82L9AN.png
(and just removing the maxlength does nothing...)
 

appliance

Explorer
Joined
Nov 6, 2019
Messages
96
command not doing anything, only service -R helps. happy for advice for 2019..
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
command not doing anything, only service -R helps. happy for advice for 2019..
Please read 11.3 BETA1 release notes. https://www.ixsystems.com/blog/library/freenas-11-3-beta1/
This is covered in detail:
You can restart all samba services by the command service samba_server onerestart or restart the service in question without the 'one' prefix. service smbd restart. Alternatively, you can restart by issuing the middleware command to do this midclt call service.restart cifs
 
Top