summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-04-15 10:57:45 +0200
committerStefan Metzmacher <metze@samba.org>2008-04-18 15:00:19 +0200
commit2df0ade13afc1690c2e6d80e087aa281c815e678 (patch)
tree34f794ed64ae3e977208d600c57146ad43aceec0 /source3
parentf2067658df3c272c2e8c6f2d00bcc5687050ee1d (diff)
downloadsamba-2df0ade13afc1690c2e6d80e087aa281c815e678.tar.gz
samba-2df0ade13afc1690c2e6d80e087aa281c815e678.tar.bz2
samba-2df0ade13afc1690c2e6d80e087aa281c815e678.zip
smbd: create the messaging conntext earlier
metze (This used to be commit 658d8475336c4397e0dad341f216baf9e1eb6aaf)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/server.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 337026a8ca..59bbfdbc17 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -575,8 +575,6 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
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"));
@@ -1095,6 +1093,8 @@ extern void build_options(bool screen);
TimeInit();
+ db_tdb2_setup_messaging(NULL, false);
+
#ifdef HAVE_SET_AUTH_PARAMETERS
set_auth_parameters(argc,argv);
#endif
@@ -1218,10 +1218,18 @@ extern void build_options(bool screen);
exit(1);
}
+ if (!lp_load_initial_only(get_dyn_CONFIGFILE())) {
+ DEBUG(0, ("error opening config file\n"));
+ exit(1);
+ }
+
+ if (smbd_messaging_context() == NULL)
+ exit(1);
+
/*
* Do this before reload_services.
*/
- db_tdb2_setup_messaging(NULL, false);
+ db_tdb2_setup_messaging(smbd_messaging_context(), true);
if (!reload_services(False))
return(-1);
@@ -1277,10 +1285,12 @@ extern void build_options(bool screen);
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())) {
+ 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);
@@ -1376,11 +1386,6 @@ extern void build_options(bool screen);
/* 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);