[Samba] Smbd hanging

Martin Zielinski mz at seh.de
Wed Mar 29 13:56:47 GMT 2006

Bruno Gomes Pessanha wrote:
> I'm having the same problem... but with a 520 print queues samba server and
> 20.000 AD users.
> I'm getting desperate! I did a lot of tuning changes..... but nothing helps!
> Bruno

If i remember correctly, the original description of the problem has 
been, that the number of smbd proccess is growing until this breaks the 
whole system (correct me, if I'm  wrong).

In your case the reason might be that clients leave *one* spoolss-pipe 
open, after they have opened (and closed) a connection to a printer. The 
deadtime parameter is not working, because of this one open connection.
BTW, this is diffrent to connections with admin rights.

To fix this, I add the following lines to smbd/conn.c:
---- start code
	for (conn=Connections;conn;conn=next) {
		/* close dirptrs on connections that are idle */
		if ((t-conn->lastused) > DPTR_IDLE_TIMEOUT)
+	/* force the closure, even if one spoolss is open */
+		if (conn->num_files_open == 1 && (t-conn->lastused)>=deadtime) {
+			for (plist = get_first_internal_pipe(); plist; 	
+                            plist = get_next_internal_pipe(plist)) {
+				if (plist->name && !strcmp (plist->name, "spoolss")) {
+					DEBUG(2,("Client holds one spoolss connection. Deadtime reached. 
Closing last pipe\n"));
+					pipe_close_conn (conn);
+					break;
+				}
+			}
+		}
		if (conn->num_files_open > 0 ||
			allidle = False;
---- end code

If the description meets your existing problem, this might help.
(There was an earlier discussion with Gerald Carter about this topic - 
this might be his code or merged with mine - I don't remember excactly)


> --
> ---
> Bruno Gomes Pessanha
> LPI Brasil

Martin Zielinski             mz at seh.de
Software Development
SEH Computertechnik GmbH     www.seh.de

More information about the samba mailing list