{
static struct messaging_context *ctx;
- if (!ctx && !(ctx = messaging_init(NULL, server_id_self(),
- smbd_event_context()))) {
- smb_panic("Could not init smbd messaging context");
+ if (ctx == NULL) {
+ ctx = messaging_init(NULL, server_id_self(),
+ smbd_event_context());
+ }
+ if (ctx == NULL) {
+ DEBUG(0, ("Could not init smbd messaging context.\n"));
}
return ctx;
}
MSG_SMB_INJECT_FAULT, msg_inject_fault);
#endif
- db_tdb2_setup_messaging(smbd_messaging_context(), true);
-
/* now accept incoming connections - forking a new process
for each incoming connection */
DEBUG(2,("waiting for a connection\n"));
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");
}
exit(1);
}
- /*
- * Do this before reload_services.
- */
- db_tdb2_setup_messaging(NULL, false);
+ if (!lp_load_initial_only(get_dyn_CONFIGFILE())) {
+ DEBUG(0, ("error opening config file\n"));
+ exit(1);
+ }
+
+ if (smbd_messaging_context() == NULL)
+ exit(1);
if (!reload_services(False))
return(-1);
if (is_daemon)
pidfile_create("smbd");
- /* Setup all the TDB's - including CLEAR_IF_FIRST tdb's. */
-
- if (smbd_messaging_context() == NULL)
+ if (!reinit_after_fork(smbd_messaging_context(), false)) {
+ DEBUG(0,("reinit_after_fork() failed\n"));
exit(1);
+ }
+
+ /* Setup all the TDB's - including CLEAR_IF_FIRST tdb's. */
if (smbd_memcache() == NULL) {
exit(1);
/* Setup aio signal handler. */
initialize_async_io_handler();
- if (!reinit_after_fork(smbd_messaging_context())) {
- DEBUG(0,("reinit_after_fork() failed\n"));
- exit(1);
- }
-
/* register our message handlers */
messaging_register(smbd_messaging_context(), NULL,
MSG_SMB_FORCE_TDIS, msg_force_tdis);
messaging_register(smbd_messaging_context(), NULL,
MSG_SMB_RELEASE_IP, msg_release_ip);
+ messaging_register(smbd_messaging_context(), NULL,
+ MSG_SMB_CLOSE_FILE, msg_close_file);
if ((lp_keepalive() != 0)
&& !(event_add_idle(smbd_event_context(), NULL,