summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-02-05 09:16:57 +0100
committerStefan Metzmacher <metze@samba.org>2008-02-06 14:44:20 +0100
commit3a0cfad2238ce5701102587c6b50ef088c7c55ba (patch)
tree2beae46c3af1eb569992610bb43ac6ad1bedcead
parent07c8cdec4767731a278d5c73a4ebaceeaced5288 (diff)
downloadsamba-3a0cfad2238ce5701102587c6b50ef088c7c55ba.tar.gz
samba-3a0cfad2238ce5701102587c6b50ef088c7c55ba.tar.bz2
samba-3a0cfad2238ce5701102587c6b50ef088c7c55ba.zip
prefork: also reload stuff in the client processes
metze (This used to be commit 36012c386b30af98f10ada1b77ca3e43dbd7b144)
-rw-r--r--source4/smbd/process_prefork.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/source4/smbd/process_prefork.c b/source4/smbd/process_prefork.c
index ab4a89bd26..839c7209d2 100644
--- a/source4/smbd/process_prefork.c
+++ b/source4/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 */