[Bug 1210270] [NEW] nmbd needs restarted on server reboot

kyle frank kfrank at mix.wvu.edu
Thu Aug 8 19:45:29 UTC 2013

Public bug reported:

Ubuntu version = 12.04
samba version = 2:3.6.3-2ubuntu2.6 0

I set up a samba server as a Domain Member Server with AD authentication.  It works fine except that when you restart the server samba services do not work and sudo commands hang for ~5min.  A little debugging revealed that nmbd needed to be restarted before samba would work and to stop sudo commands from hanging:

kfrank at tserver007:~$ time sudo su -
root at tserver007:~# smbclient \\\\tserver007\\base -U kfrank
Enter kfrank's password: 
did you forget to run kinit?
root at tserver007:~# exit

real	5m29.158s
user	0m0.220s
sys	0m0.292s
kfrank at tserver007:~$ 

I'm not even sure why it is asking me to run a kerberos command.  I
don't use kerberos in my build.

Attached are my smb.conf and level 10 smbd and nmbd log files.

I did a little more debugging and if I comment out the "wins server"
line in smb.conf sudo commands don't hang anymore.  Unfortunately I need
that config to connect to the AD server.

This issue kind of relates with


which points out that there is a race condition between smbd and nmbd at
startup.  More specifically that the creation of /var/run/samba wasn't
being created before nmbd starts.  There's a lot of suggestions and
fixes that worked for other people so I spent the better part of today
messing around with /etc/init/nmbd.conf in hopes that nmbd would wait
for smbd to finish starting up before starting.  I've tried changing the
start on parameter to

start on (started smbd)

which didn't result in anything different after a reboot.  Also tried
adding a

mkdir -p /var/run/samba

at the very beginning of the pre-start script.  This worked in testing
and even had it on the production server for a couple of days but after
a while the same problem occurred on reboot.  Tried it without the -p
flag and got the same results.  The only thing that has gotten
consistent results so far is to add a

sleep 1

before the pre-start script begins.  Now samba works on reboot and sudo
commands don't hang!  Only problem is that the sleep command prevents
the pid file for nmbd to not be generated.  So if I feel like doing
anything with the nmbd service I'm SOL.

root at tserver007:/etc/init.d# service nmbd stop
stop: Unknown job: nmbd
root at tserver007:/etc/init.d# service nmbd status
status: Unknown job: nmbd
root at tserver007:/etc/init.d# service nmbd start
start: Unknown job: nmbd
root at tserver007:/etc/init.d# service nmbd restart
stop: Unknown job: nmbd
start: Unknown job: nmbd
root at tserver007:/etc/init.d# 

So I decided to get rid of the sleep command.  Currently I just have nmbd restart in rc.local which I know is a bad solution.  Please advise on a better one.

** Affects: samba (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "smb.conf.rtf"

You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to samba in Ubuntu.

  nmbd needs restarted on server reboot

To manage notifications about this bug go to:

More information about the Ubuntu-server-bugs mailing list