diff options
-rw-r--r-- | source3/lib/util.c | 5 | ||||
-rw-r--r-- | source3/nmbd/asyncdns.c | 2 | ||||
-rw-r--r-- | source3/nmbd/nmbd.c | 2 | ||||
-rw-r--r-- | source3/printing/printing.c | 2 | ||||
-rw-r--r-- | source3/smbd/server.c | 5 | ||||
-rw-r--r-- | source3/winbindd/winbindd.c | 2 | ||||
-rw-r--r-- | source3/winbindd/winbindd_cm.c | 2 | ||||
-rw-r--r-- | source3/winbindd/winbindd_dual.c | 2 |
8 files changed, 12 insertions, 10 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index db0da541f9..953981e82a 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -990,7 +990,8 @@ void become_daemon(bool Fork, bool no_process_group) attach it to the logfile */ } -bool reinit_after_fork(struct messaging_context *msg_ctx) +bool reinit_after_fork(struct messaging_context *msg_ctx, + bool parent_longlived) { NTSTATUS status; @@ -1001,7 +1002,7 @@ bool reinit_after_fork(struct messaging_context *msg_ctx) set_need_random_reseed(); /* tdb needs special fork handling */ - if (tdb_reopen_all(1) == -1) { + if (tdb_reopen_all(parent_longlived ? 1 : 0) == -1) { DEBUG(0,("tdb_reopen_all failed.\n")); return false; } diff --git a/source3/nmbd/asyncdns.c b/source3/nmbd/asyncdns.c index 0329491c4a..ab9b1ed740 100644 --- a/source3/nmbd/asyncdns.c +++ b/source3/nmbd/asyncdns.c @@ -164,7 +164,7 @@ void start_async_dns(void) CatchSignal(SIGHUP, SIG_IGN); CatchSignal(SIGTERM, SIGNAL_CAST sig_term ); - if (!reinit_after_fork(nmbd_messaging_context())) { + if (!reinit_after_fork(nmbd_messaging_context(), true)) { DEBUG(0,("reinit_after_fork() failed\n")); smb_panic("reinit_after_fork() failed"); } diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 9396219ea7..af4acc84d0 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -912,7 +912,7 @@ static bool open_sockets(bool isdaemon, int port) pidfile_create("nmbd"); - if (!reinit_after_fork(nmbd_messaging_context())) { + if (!reinit_after_fork(nmbd_messaging_context(), false)) { DEBUG(0,("reinit_after_fork() failed\n")); exit(1); } diff --git a/source3/printing/printing.c b/source3/printing/printing.c index fdf5e6cc22..c5fe53f042 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -1406,7 +1406,7 @@ void start_background_queue(void) /* Child. */ DEBUG(5,("start_background_queue: background LPQ thread started\n")); - if (!reinit_after_fork(smbd_messaging_context())) { + if (!reinit_after_fork(smbd_messaging_context(), true)) { DEBUG(0,("reinit_after_fork() failed\n")); smb_panic("reinit_after_fork() failed"); } diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 59bbfdbc17..cf02589864 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -739,7 +739,8 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_ sizeof(remaddr)), false); - if (!reinit_after_fork(smbd_messaging_context())) { + if (!reinit_after_fork( + smbd_messaging_context(), true)) { DEBUG(0,("reinit_after_fork() failed\n")); smb_panic("reinit_after_fork() failed"); } @@ -1285,7 +1286,7 @@ extern void build_options(bool screen); if (is_daemon) pidfile_create("smbd"); - if (!reinit_after_fork(smbd_messaging_context())) { + if (!reinit_after_fork(smbd_messaging_context(), false)) { DEBUG(0,("reinit_after_fork() failed\n")); exit(1); } diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 64674b8ace..1072f8e762 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -1189,7 +1189,7 @@ int main(int argc, char **argv, char **envp) TimeInit(); - if (!reinit_after_fork(winbind_messaging_context())) { + if (!reinit_after_fork(winbind_messaging_context(), false)) { DEBUG(0,("reinit_after_fork() failed\n")); exit(1); } diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index c62476e5eb..822f946e1a 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -199,7 +199,7 @@ static bool fork_child_dc_connect(struct winbindd_domain *domain) /* Leave messages blocked - we will never process one. */ - if (!reinit_after_fork(winbind_messaging_context())) { + if (!reinit_after_fork(winbind_messaging_context(), true)) { DEBUG(0,("reinit_after_fork() failed\n")); _exit(0); } diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index 77fbe3c0ed..14ba38cef3 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -1005,7 +1005,7 @@ static bool fork_domain_child(struct winbindd_child *child) state.sock = fdpair[0]; close(fdpair[1]); - if (!reinit_after_fork(winbind_messaging_context())) { + if (!reinit_after_fork(winbind_messaging_context(), true)) { DEBUG(0,("reinit_after_fork() failed\n")); _exit(0); } |