nmbd/smbd default behavior.

Andrew Tridgell tridge at samba.anu.edu.au
Thu Aug 13 02:09:22 GMT 1998

> I'm looking for some background and history on an oddity...

that's my department. Maybe I should open a Samba museum? I could call
it "castle of horrors by the C".

> Nmbd defaults to overwriting existing log files while smbd defaults to 
> appending to existing log (debug) files.  Jeremy wrote that he thought 
> that this was by design, so I haven't changed it.  Also, the -a option 
> turns append *on* for nmbd and *off* for smbd.

yep, this was by design. Not necessarily a good design tho :)

Originally smbd overwrote log files. It was changed to not overwrite
when people actually wanted to keep logs of who connected to shares
and when. The simplest method was to make it append. nmbd didn't do
this because I didn't imagine anyone would want to keep records of who
did a query when. nmbd output was purely for debugging purposes
(ie. read by us developers!) and it was more convenient for us
to have it overwrite so when we re-run nmbd we get a fresh debug file
and don't have to wade through old stuff.

So the "append by default" for smbd was logical because that was what
most users wanted. The "overwrite by default" for nmbd was logical
because that was what developers wanted and users didn't care.

I'm open to suggstions as to the best way to change this. 

> My gut reaction would be to change smbd so that it defaults to
> overwriting the logs and its -a option means append.

I'd go for the opposite. Change nmbd to append by default. Otherwise
you will break existing peoples setups. Some people have scripts that
collate login/logout info from smbd. 

More information about the samba-technical mailing list