The Samba-Bugzilla – Bug 5150
smbd and nmbd fail to start
Last modified: 2007-12-22 11:24:27 UTC
Built binaries using checked out code (Samba3 ctdb version), but fails with command: service smb start
No log file generated. Just ends with the [FAILED] message for both smbd and nmbd
linux version 2.6.18-1.2798.fc6
This is a bit too little information I'm afraid. Do you also have ctdb running? You should not run the smb service in the clustering version without it. And, if you configure ctdb you will see that normally ctdb starts and stops smbd according to cluster node state, there is no need to separately start the smb service. Can you please also upload your smb.conf and the output of "smbd -d 10 -i"?
Created attachment 3049 [details]
output of command--> smbd -d 10 -i -s /etc/samba/smb.conf
as requested, here is the output of the command:
smbd -d 10 -i -s /etc/samba/smb.conf
Created attachment 3050 [details]
smb.conf configuration file
as requested, here is the smb.conf file. Notice that clustering is commented out for the time being.
The reason I ran smb service without ctdb running was just to make sure nothing bad jumped out like this, where the service would not even start.
Also, I was able to get normal samba to work fine (the old smbd and nmbd executables) using these testing commands:
service smb start
mount -t cifs -v -o username=sambauser //127.0.0.1/share02 /mikev/samba/share02
Regarding starting ctdb, I was able to start it, but when I stopped it, it disabled my localhost! I could no longer ping 127.0.0.1.
To me it seems that your smbd looks for its data in the wrong place:
tdb(unnamed): tdb_open_ex: could not open file /usr/local/samba/private/secrets.tdb: No such file or directory
Could not open tdb: No such file or directory
Failed to open /usr/local/samba/private/secrets.tdb
is found in smbd -i. Can you make sure that your compile matches what you have on your system?
Yes, I noticed that it is looking for stuff in hard-coded places based on the compile-time settings.
Do I make changes in the makefile to force it to the right directories?
Or are there environment variables that I can set that will set the root for paths used by smb?
Can't you try to recompile using Tridge's makerpms.sh in packaging/RHEL4-CTDB? There you should find all the settings and config switches to make it run as a normal system service. You might also take a look at your system-supplied Samba RPM package to see the switches that this gives to the configure script.
Yes, at some point, I need to set it up to run as a normal system service.
I now have the smbd/nmbd binaries now pointing to the right stuff in the right target directories by doing some mods to target locations in configure script. Thanks for the help.
I am attaching script output for running samba and samba utilities. Right now it fails with a weird error for "smbcontrol smbd ping"
tdb(unnamed): tdb_open_ex: failed to truncate /usr/samba-ctdb/samba/var/locks/connections.tdb: Invalid argument
Could not open tdb: Invalid argument
It also fails on an ensuing smbclient connect:
Domain=[MICHAELV3] OS=[Unix] Server=[Samba 3.0.26pre1-SVN-build-UNKNOWN]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
And of course, fails later with an actual mount attempt:
/usr/samba-ctdb/bin/mount.cifs //127.0.0.1/share02 /usr/samba-ctdb/samba/share/testing/share02 --verbose -o user=sambauser
mount.cifs kernel mount options unc=//127.0.0.1\share02,ip=127.0.0.1,pass=aaa,ver=1,user=sambauser,domain=MYGROUP
retrying with upper case share name
mount.cifs kernel mount options unc=//127.0.0.1\SHARE02,ip=127.0.0.1,pass=aaa,ver=1,user=sambauser,domain=MYGROUP
mount error 6 = No such device or address
Created attachment 3057 [details]
starting smbd and nmbd directly and running utilities with verbose output
this attachment is related to my last message
Does /usr/samba-ctdb/samba/var/locks/connections.tdb exist? If yes, can you please post an strace of the smbcontrol command?
Yes, connections.tdb does exist. Previously I was getting connections.tdb does not exist errors, so I just copied the one from my old samba to the new target location and that make the errors go away. How is this conections.tdb first created?
Also, I did the stack trace like you asked, but it is not supported.
I run Fedora: linux version 2.6.18-1.2798.fc6
Here is the command I used:
/usr/samba-ctdb/bin/smbcontrol smbd stacktrace
Here is the result:
Daemon stack tracing is not supported on this platform
I don't know how the this bug got marked as resolved or fixed, but it should not be.
Please respond to my last comment, comment#12.
Thanks in advance.
Well, copying connections.tdb is not supported. Thus the invalid argument. connections.tdb is recreated once smbd is restarted.
What happens if you restart smbd?
I removed the connections.tdb file and restarted. Looks like both smbd and nmbd started ok, but smbd bombed when I called:
usr/samba-ctdb/bin/smbclient -L //127.0.0.1 -N
See attachments: smbd01.out, nmbd01.out, samba-calls01.txt
In the smbd.out file, I put my comments right after "waiting for connection"
At that point in the file the output is generated because of the smbclient call mentioned above.
Created attachment 3067 [details]
see comment 16
Created attachment 3068 [details]
see comment 16
Created attachment 3069 [details]
see comment 16
Everything looks absolutely smooth here. I don't know what you expect, but I don't see a bug here but some basic misunderstanding of smbd or a pure configuration problem.
Please reopen this! Look at how the command, smbcontrol blows up smbd!
the command --> smbclient -L //127.0.0.1 -N
causes smbd to crash!!!!!!!!!!
look at the smbd.out file
The last thing the server says is
Server exit (normal exit)
This is not a crash, you seem to have started it with -i. A crash would have at least the word "panic" somewhere in the log file. Read the manpage for smbd about the meaning of -i. Sorry, but re-opening this does not make it a bug where there is none.
Thanks as usual for your fast response!
Before we leave this as a resolved invalid problem, please note that SMBD stops running as a process immediately after I execute the following command:
/usr/samba-ctdb/bin/smbclient -L //127.0.0.1 -N
Yes, I started smbd with "-i" but does that have anything to do with smbd crashing after I execute the smbclient command? If this is normal for SMBD process to terminate if started with "-i" and a smbclient request comes along, I agree we should close this, but if not, then certainly not close it.
True I see server exit (normal exit) in the log file, but look at all the debug junk between the "waiting for connection" and server normal exit.
(In reply to comment #23)
> Thanks as usual for your fast response!
> Before we leave this as a resolved invalid problem, please note that SMBD stops
> running as a process immediately after I execute the following command:
> /usr/samba-ctdb/bin/smbclient -L //127.0.0.1 -N
> Yes, I started smbd with "-i" but does that have anything to do with smbd
> crashing after I execute the smbclient command? If this is normal for SMBD
> process to terminate if started with "-i" and a smbclient request comes along,
> I agree we should close this, but if not, then certainly not close it.
smbd is not crashing!
Proving "-i" exactly means that smbd does only serve one request and exits afterwards (it does not fork and does not go into daemon mode).
This is intended. Pleas read up on man smbd as vl suggested... :-)
> True I see server exit (normal exit) in the log file, but look at
> all the debug junk between the "waiting for connection" and
> server normal exit.
That is not junk but potentially useful debug output produced by setting a high log level.
Thanks, Michael for the update:
-i means it will quit after it serves one request!
So I do have it working fine now. Great!
You guys are a quick response help team! Thanks alot!
IT Developer, Exponential Storage