# Samba 4



## bangmyhead (Jul 15, 2016)

Hello, I have just installed Samba 4 on FreeBSD 10.3 Release. I am having a problem to start it. I have created the file smb4.conf in /usr/local/etc/ but when I go to start samba this happens:

`#service samba start`

```
samba does not exist in /etc/rc.d or the local startup directories (/usr/local/etc/rc.d)
```

Also tried with smb and smb4 with same reply. What I am doing wrong and how to fix it?


----------



## robroy (Jul 15, 2016)

bangmyhead, try `service samba_server onestart`.  And if you add samba_server_enable="YES" to /etc/rc.conf, you can use `service samba_server start`.


----------



## bangmyhead (Jul 15, 2016)

robroy said:


> bangmyhead, try `service samba_server onestart`.  And if you add samba_server_enable="YES" to /etc/rc.conf, you can use `service samba_server start`.



That worked but I have a new problem now


```
#serivce samba_server onestart
Performing a sanity check on Samba configuration: FAILED
```

and in /var/log/samba4 there is no log to check


----------



## robroy (Jul 15, 2016)

bangmyhead, your configuration file's /usr/local/etc/smb4.conf, right?  I'm asking because it looks like you may have experimented with naming it smb.conf.

Maybe the output of `smbd -d 3 -i -s /usr/local/etc/smb4.conf` would include a clue about the problem's cause.

I'd also be happy to eyeball your smb4.conf, if you feel like posting it.


----------



## walterbyrd (Aug 13, 2016)

I was having the same problem. 

The command `service samba_server onestart` seemed to work. 

FWIW: the instructions given here:

28.10. File and Print Services for Microsoft® Windows® Clients (Samba)
https://www.freebsd.org/doc/handbook/network-samba.html

Need to be updated.


----------



## fossette (Aug 14, 2016)

Because of the vulnerabilities found in 3.X & 4.X, and the none-upgrade of it, I decided to upgrade to Samba 4.4, and my shared folders broke instantly.  No Active Directory & Domain Servers & all that crap.  Wtf???  Lots of docs are not up-to-date, indeed!

I found out that only `samba-tool testparm` is useful in my specific case, only shared folders (we are allowed to say 'folders' when it's Windows related ).
I also made sure that all options in /usr/local/etc/smb4.conf are good.  This file was generated during the upgrade and contained old stuff (some incompatible), and new stuff.  Config file compared to: `man smb.conf`.  At the end, it specifically says:



> This man page is correct for version 4 of the Samba suite.



An then, my shared folders came back!  Yeah!  Hope this helps!
Dominique.


----------



## walterbyrd (Aug 14, 2016)

How do I get SAMBA to auto start?

I have the following in my /etc/rc.conf but that does not seem to do it:

`samba_server_enable="YES"`

EDIT: 

I just realized that SAMBA may have been started. I tried: 

`ps -aux | grep smbd
ps -aux | grep nmbd`

and got nothing. 

How do I know if SAMBA is running?


----------



## t1066 (Aug 15, 2016)

Look at the file /usr/local/etc/rc.d/samba. There should be instruction on the header section of this file. Mine read as


```
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
#samba_enable="YES"
```


----------



## fossette (Aug 15, 2016)

*walterbyrd*, Samba is very complex.  What Samba version have you installed?  What Samba features do you intend to use?  Do you see anything suspicious in the log files? Share your configuration file with us!  If `nmbd` and `smbd` aren't running, I would suspect Samba's config file.

For example, my Samba 4.4 server for shared folders is launched using:

```
samba_enable="NO"
samba_server_enable="YES"
```
 in /etc/rc.conf.

Dominique.


----------



## walterbyrd (Aug 15, 2016)

Now, I seem to be able to find the samba processes. No idea why.

I am curious as to way you run


```
samba_enable="NO"
samba_server_enable="YES"
```

Why do you specifically run:


```
samba_enable="NO"
```
?


----------



## SirDice (Aug 15, 2016)

It would prevent Samba 3.x from starting, probably in case something went wrong and you accidentally end up with both Samba 3.x and Samba 4.x.


----------

