summaryrefslogtreecommitdiff
path: root/source3/smbd/server.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-02-19 01:55:24 +0000
committerJeremy Allison <jra@samba.org>2004-02-19 01:55:24 +0000
commit8eec62ebfb238133d95d7247b7126292f47c7093 (patch)
tree5d3894f97ced64d8e2753603a2ea25897d831c51 /source3/smbd/server.c
parent5e39e9f3130e48917db9d9802623befa536df399 (diff)
downloadsamba-8eec62ebfb238133d95d7247b7126292f47c7093.tar.gz
samba-8eec62ebfb238133d95d7247b7126292f47c7093.tar.bz2
samba-8eec62ebfb238133d95d7247b7126292f47c7093.zip
Fix the "too many fcntl locks" scalability problem raised by tridge.
I've now tested this in daemon mode and also on xinetd and I'm pretty sure it's working. Jeremy. (This used to be commit 14dee038019b11300466b148c53515fc76e5e870)
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r--source3/smbd/server.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index be59e92cd7..1de33739b2 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -405,10 +405,10 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_
done correctly in the process. */
reset_globals_after_fork();
- /* tdb needs special fork handling */
+ /* tdb needs special fork handling - remove CLEAR_IF_FIRST flags */
if (tdb_reopen_all() == -1) {
DEBUG(0,("tdb_reopen_all failed.\n"));
- return False;
+ smb_panic("tdb_reopen_all failed.");
}
return True;
@@ -809,9 +809,27 @@ void build_options(BOOL screen);
if (is_daemon)
pidfile_create("smbd");
+ /* Setup all the TDB's - including CLEAR_IF_FIRST tdb's. */
if (!message_init())
exit(1);
+ if (!session_init())
+ exit(1);
+
+ if (conn_tdb_ctx() == NULL)
+ exit(1);
+
+ if (!locking_init(0))
+ exit(1);
+
+ if (!share_info_db_init())
+ exit(1);
+
+ namecache_enable();
+
+ if (!init_registry())
+ exit(1);
+
if (!print_backend_init())
exit(1);
@@ -832,17 +850,6 @@ void build_options(BOOL screen);
* everything after this point is run after the fork()
*/
- namecache_enable();
-
- if (!locking_init(0))
- exit(1);
-
- if (!share_info_db_init())
- exit(1);
-
- if (!init_registry())
- exit(1);
-
/* Initialise the password backed before the global_sam_sid
to ensure that we fetch from ldap before we make a domain sid up */
@@ -891,4 +898,3 @@ void build_options(BOOL screen);
exit_server("normal exit");
return(0);
}
-