[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha2-634-g36012c3

Stefan Metzmacher metze at samba.org
Wed Feb 6 14:15:07 GMT 2008


The branch, v4-0-test has been updated
       via  36012c386b30af98f10ada1b77ca3e43dbd7b144 (commit)
      from  594ff923295c7420167aa899ec6030de07038625 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 36012c386b30af98f10ada1b77ca3e43dbd7b144
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 5 09:16:57 2008 +0100

    prefork: also reload stuff in the client processes
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source/smbd/process_prefork.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/process_prefork.c b/source/smbd/process_prefork.c
index ab4a89b..839c720 100644
--- a/source/smbd/process_prefork.c
+++ b/source/smbd/process_prefork.c
@@ -54,6 +54,17 @@ static void prefork_model_init(struct event_context *ev)
 	signal(SIGCHLD, SIG_IGN);
 }
 
+static void prefork_reload_after_fork(void)
+{
+	/* tdb needs special fork handling */
+	if (tdb_reopen_all(1) == -1) {
+		DEBUG(0,("prefork_reload_after_fork: tdb_reopen_all failed.\n"));
+	}
+
+	/* Ensure that the forked children do not expose identical random streams */
+	set_need_random_reseed();
+}
+
 /*
   called when a listening socket becomes readable. 
 */
@@ -115,16 +126,10 @@ static void prefork_new_task(struct event_context *ev,
 	   is not associated with this new connection */
 	talloc_free(ev);
 
-	/* tdb needs special fork handling */
-	if (tdb_reopen_all(1) == -1) {
-		DEBUG(0,("prefork_accept_connection: tdb_reopen_all failed.\n"));
-	}
-
-	/* Ensure that the forked children do not expose identical random streams */
-	set_need_random_reseed();
-
 	setproctitle("task %s server_id[%d]", service_name, pid);
 
+	prefork_reload_after_fork();
+
 	/* setup this new connection: process will bind to it's sockets etc */
 	new_task_fn(ev2, lp_ctx, cluster_id(pid, 0), private);
 
@@ -151,6 +156,9 @@ static void prefork_new_task(struct event_context *ev,
 		} else {
 			pid = getpid();
 			setproctitle("task %s server_id[%d]", service_name, pid);
+
+			prefork_reload_after_fork();
+
 			/* we can't return to the top level here, as that event context is gone,
 			   so we now process events in the new event context until there are no
 			   more to process */	   


-- 
Samba Shared Repository


More information about the samba-cvs mailing list