nmbd needs restarted on server reboot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
samba (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
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@
root@tserver007:~# smbclient \\\\tserver007\
Enter kfrank's password:
session setup failed: NT_STATUS_
did you forget to run kinit?
root@tserver007:~# exit
logout
real 5m29.158s
user 0m0.220s
sys 0m0.292s
kfrank@
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
https:/
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@tserver007
stop: Unknown job: nmbd
root@tserver007
status: Unknown job: nmbd
root@tserver007
start: Unknown job: nmbd
root@tserver007
stop: Unknown job: nmbd
start: Unknown job: nmbd
root@tserver007
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.
tags: | added: samba |
tags: | added: precise |
Status changed to 'Confirmed' because the bug affects multiple users.