Deadtime paramter does not work with samba 3.0.23c. Idle connections are not detected correctly. There is a change in 3.0.23 that leads to this bug. For 3.0.23 the new lastused_count variable appears. The code in conn.c is : for (conn=Connections;conn;conn=next) { next=conn->next; /* Update if connection wasn't idle. */ if (conn->lastused != conn->lastused_count) { conn->lastused = t; /****** Problem is HERE **********/ } /* close dirptrs on connections that are idle */ if ((t-conn->lastused) > DPTR_IDLE_TIMEOUT) { dptr_idlecnum(conn); } if (conn->num_files_open > 0 || (t-conn->lastused)<deadtime) { allidle = False; } } As conn->lastused_count is different a few increments above conn->lastused that has been done by service.c ), the conn->lastused is then set to actual time. If there is no activity for this connection, each time we run this code, each time conn->lastused is set to new actual time. Then t-conn->lastused is always 0. So, deadtime is not a condition to go in "Idle" state. Modifying the code: /* Update if connection wasn't idle. */ if (conn->lastused != conn->lastused_count) { conn->lastused = t; /****** Problem is HERE **********/ } With: /* Update if connection wasn't idle. */ if (conn->lastused != conn->lastused_count) { conn->lastused = t; conn->lastused_count = t; /* FIX is HERE */ } Then it works (we have compiled and tested this fix) In version 3.0.22 the conn.c, there is no use of lastused_count then deadtime works : 3.0.22 conn.c : for (conn=Connections;conn;conn=next) { next=conn->next; /* close dirptrs on connections that are idle */ if ((t-conn->lastused) > DPTR_IDLE_TIMEOUT) dptr_idlecnum(conn); if (conn->num_files_open > 0 || (t-conn->lastused)<deadtime) allidle = False; } Do you agree ? Thanks,
Yes - completely correct ! Thanks for the fix. Fixed in SVN (Jerry this probably needs to be in 3.0.23d). Jeremy.