NetBIOS keepalives.

Neil Hoggarth neil.hoggarth at
Thu Aug 31 11:26:32 GMT 2000

Hi folks,

I have a couple of observations about NetBIOS keepalive handling in
Samba, in case anyone is interested. I came across a few oddities when
investigating why some of our Samba servers were logging:

   write_socket_data: write failure. Error = Broken pipe

type errors on a very frequent and regular basis.

We have a number of Solaris 2.6 machines, all using Samba 2.0.7. One
machine runs at user level security and the others run with server level
security, using the first server as their password server. The errors
are being logged by the server level security machines.

I established that the write_socket_data() errors always seemed to
correspond time-wise with an NBT keepalive sent by a server-level server
to a connected Windows client, with the keepalive apparently correctly
acknowledged by the client.

First issue:

The smb.conf man page states that the "keepalive=" parameter defaults to
zero, and that keepalives should, in general, only be required if you
are having problems. Keepalives actually default to 300 seconds (in both
2.0.7 and CVS HEAD), and the spacing between keepalives is actually
typically 360 seconds (presumably smbd/process.c:timeout_processing()
gets called once per minute?).

Second issue:

Following a successfully keepalive exchange with a client when in server
level security, smbd/process.c:timeout_processing() sends a keepalive to
its authentication connection to the password server. I believe that my
error messages are caused by the fact that this connection to the
password server has lapsed. The server-level server does not appear to
do anything with the result of the keepalive attempt on the password
connection, and (at least when the password server is running Samba
2.0.7) the keepalives don't seem to prevent the password server from
idling out the authentication connection. The question arises: why
bother? :-)

(Note that, apart from the unwanted messages cluttering the log.smb
file, this probably a good thing - I'm not sure that I want/need the
authentication connection to hang around for the entire lifetime of the
primary connection, once authentication is complete.)

For now, I intend to quell the noise in the log files by setting
keepalives=0 in my server-level smb.conf files, unless anyone has any
other thoughts?

Neil Hoggarth                                 Departmental Computer Officer
<neil.hoggarth at>                   Laboratory of Physiology                  University of Oxford, UK

More information about the samba mailing list