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;
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;
}
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");
}
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);
}
/* 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");
}
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");
}
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);
}
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);
}
/* 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);
}
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);
}