# samba (nmbd) will not start at boot

## hitemp

Damn noob needs more help. 

Samba will not start on boot but will start on interactive boot and can be started after boot. I can only guess this has something to do with netmount not having time to fully start (in interactive mode if I pause about 3 seconds between netmount and samba it loads fine, if I go too fast samba (nmbd) will not load). Thats about as far as I can get, I would greatly appreciate any help.

Thanks hiTemp

Boot

```

*Starting eth0

*  Starting ifplugd on eth0 ...                [ok]

*    Backgrounding ...

*Starting wlan0

*  Starting wpa_supplicant on wlan0 ...        [ok] 

*  Starting wpa_cli on wlan0 ...               [ok]  

*    Backgrounding ...                         

*Mounting network file systems ...             [ok]

*samba -> start: smbd ...                      [ok]  

*samba -> start: nmbd ...                      [!!]

*Error: starting services (see system logs)

*samba -> stop: smbd ...                       [ok]

*samba -> stop: nmbd ...                       [ok]    

*Starting local ...                            [ok]

```

dmesg

```

[   19.517728] eth0: link down

[   19.518691] ADDRCONF(NETDEV_UP): eth0: link is not ready

[   20.343071] b43 ssb0:0: firmware: requesting b43/ucode5.fw

[   20.394742] b43 ssb0:0: firmware: requesting b43/pcm5.fw

[   20.397985] b43 ssb0:0: firmware: requesting b43/b0g0initvals5.fw

[   20.407304] b43 ssb0:0: firmware: requesting b43/b0g0bsinitvals5.fw

[   20.528053] b43-phy0: Loading firmware version 478.104 (2008-07-01 00:50:23)

[   20.556816] ADDRCONF(NETDEV_UP): wlan0: link is not ready

[   22.315428] wlan0: authenticate with 00:26:f2:fd:e6:d9 (try 1)

[   22.316825] wlan0: authenticated

[   22.317248] wlan0: associate with 00:26:f2:fd:e6:d9 (try 1)

[   22.319791] wlan0: RX AssocResp from 00:26:f2:fd:e6:d9 (capab=0x431 status=0 aid=2)

[   22.319794] wlan0: associated

[   22.320849] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

[   22.387636] nmbd used greatest stack depth: 4144 bytes left

[   32.837028] wlan0: no IPv6 routers present

```

log.nmbd

```

[2010/11/13 21:44:54,  0] nmbd/nmbd.c:854(main)

  nmbd version 3.4.9 started.

  Copyright Andrew Tridgell and the Samba Team 1992-2009

[2010/11/13 21:44:54,  0] nmbd/asyncdns.c:155(start_async_dns)

  started asyncdns process 3995

[2010/11/13 21:44:54,  0] nmbd/nmbd.c:693(open_sockets)

```

log.smbd

```

[2010/11/13 21:44:54,  0] smbd/server.c:1065(main)

  smbd version 3.4.9 started.

  Copyright Andrew Tridgell and the Samba Team 1992-2009

```

##########################################################################

#########################################################################

Boot (Interactive)

```

About to start the service net.eth0

1) Start servive          3) Continue boot process

2) Skip service           4) Exit to shell

Enter your selection: 1

 *Starting eth0

 *  Starting ifplugd on eth0 ...                [ok]

 *    Backgrounding ...

About to start the service net.wlan0

1) Start servive          3) Continue boot process

2) Skip service           4) Exit to shell

Enter your selection: 1

 *Starting wlan0

 *  Starting wpa_supplicant on wlan0 ...        [ok] 

 *  Starting wpa_cli on wlan0 ...               [ok]  

 *    Backgrounding ...

About to start the service netmount

1) Start servive          3) Continue boot process

2) Skip service           4) Exit to shell

Enter your selection: 1

 *Mounting network file systems ...             [ok]

About to start the service samba

1) Start servive          3) Continue boot process

2) Skip service           4) Exit to shell

Enter your selection: 1

 *samba -> start: smbd ...                      [ok]  

 *samba -> start: nmbd ...                      [ok]

About to start the service udev-postmount

1) Start servive          3) Continue boot process

2) Skip service           4) Exit to shell

Enter your selection: 1

About to start the service

1) Start servive          3) Continue boot process

2) Skip service           4) Exit to shell

Enter your selection: 1

*Starting local ...                            [ok]

```

dmesg

```

[   28.089890] eth0: link down

[   28.090653] ADDRCONF(NETDEV_UP): eth0: link is not ready

[   29.959071] b43 ssb0:0: firmware: requesting b43/ucode5.fw

[   30.010806] b43 ssb0:0: firmware: requesting b43/pcm5.fw

[   30.014099] b43 ssb0:0: firmware: requesting b43/b0g0initvals5.fw

[   30.023368] b43 ssb0:0: firmware: requesting b43/b0g0bsinitvals5.fw

[   30.144054] b43-phy0: Loading firmware version 478.104 (2008-07-01 00:50:23)

[   30.172814] ADDRCONF(NETDEV_UP): wlan0: link is not ready

[   31.949270] wlan0: authenticate with 00:26:f2:fd:e6:d9 (try 1)

[   31.950667] wlan0: authenticated

[   31.950678] wlan0: associate with 00:26:f2:fd:e6:d9 (try 1)

[   31.953456] wlan0: RX AssocResp from 00:26:f2:fd:e6:d9 (capab=0x431 status=0 aid=2)

[   31.953459] wlan0: associated

[   31.954645] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

[   42.058429] nmbd used greatest stack depth: 4144 bytes left

[   42.406031] wlan0: no IPv6 routers present

```

log.nmbd

```

[2010/11/13 22:24:15,  0] nmbd/nmbd.c:854(main)

  nmbd version 3.4.9 started.

  Copyright Andrew Tridgell and the Samba Team 1992-2009

[2010/11/13 22:24:15,  0] nmbd/asyncdns.c:155(start_async_dns)

  started asyncdns process 4539

```

log.smbd

```

[2010/11/13 22:24:15,  0] smbd/server.c:1065(main)

  smbd version 3.4.9 started.

  Copyright Andrew Tridgell and the Samba Team 1992-2009

[2010/11/13 22:24:15,  0] smbd/server.c:457(smbd_open_one_socket)

  smbd_open_once_socket: open_socket_in: Address already in use

[2010/11/13 22:24:15,  0] smbd/server.c:457(smbd_open_one_socket)

  smbd_open_once_socket: open_socket_in: Address already in use

```

Cut the line of hashes in half as it was causing layout problems. -- desultory

----------

## darkphader

Try removing and adding the service:

```
rc-update del samba default

rc-update add samba default
```

Works here but my system starts ntp before it attempts to start samba.

----------

## TJNII

It is probably trying to start samba before your interfaces are up.  Samba not working automatically but working manually points to a possible timing issue.  You should set your net init scripts to block (not background) until the interfaces are up and configured, and see if that makes a difference.

I've never set up my net init scripts to background, so I don't know how you did it or how to turn it off.

----------

## hitemp

 *darkphader wrote:*   

> Try removing and adding the service:
> 
> ```
> rc-update del samba default
> 
> ...

 

No such luck.

 *TJNII wrote:*   

> You should set your net init scripts to block (not background) until the interfaces are up and configured, and see if that makes a difference. 

 

I will have to check into that. I am using ifplugd, maybe that changed something.

 *TJNII wrote:*   

> I don't know how you did it or how to turn it off.

 

Me too  :Confused: 

----------

## darkphader

Do you have 

```
rc_parallel="NO"
```

 in /etc/rc.conf ?

----------

## hitemp

 *darkphader wrote:*   

> Do you have 
> 
> ```
> rc_parallel="NO"
> ```
> ...

 

No luck with that either but I did add

```
associate_timeout_wlan0=10
```

to /etc/conf.d/net and that fixed the problem.I am not sure if this is the correct procedure but it took care of the backgrounding, it seems to allow wlan0 time to be configured before samba starts. If anyone has a better solution I will be glad to give it a shot.

----------

## darkphader

Seems to be a fine solution. Nmbd will not start if the network is not up.

----------

