r24029: merge from http://samba.org/~tridge/samba_3_2_ctdb/:
authorStefan Metzmacher <metze@samba.org>
Tue, 24 Jul 2007 10:35:10 +0000 (10:35 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:28:57 +0000 (12:28 -0500)
the claim_connection() must come after the sockets are open

metze

source/smbd/server.c

index c09a0d7b98cd94f3be0f22e61b30b6ed11fbfaa0..491482eea62134b3fcd232d0952883f572835270 100644 (file)
@@ -349,6 +349,14 @@ static BOOL open_sockets_smbd(enum smb_server_mode server_mode, const char *smb_
                maxfd = MAX(maxfd, fd_listenset[i]);
        }
 
+
+       /* Setup the main smbd so that we can get messages. Note that
+          do this after starting listening. This is needed as when in
+          clustered mode, ctdb won't allow us to start doing database
+          operations until it has gone thru a full startup, which
+          includes checking to see that smbd is listening. */
+       claim_connection(NULL,"",FLAG_MSG_GENERAL|FLAG_MSG_SMBD);
+
         /* Listen to messages */
 
        messaging_register(smbd_messaging_context(), NULL,
@@ -1040,11 +1048,6 @@ extern void build_options(BOOL screen);
                return -1;
        }
 
-       /* Setup the main smbd so that we can get messages. */
-       /* don't worry about general printing messages here */
-
-       claim_connection(NULL,"",FLAG_MSG_GENERAL|FLAG_MSG_SMBD);
-
        /* only start the background queue daemon if we are 
           running as a daemon -- bad things will happen if
           smbd is launched via inetd and we fork a copy of