dbwrap: wait for tdb2 change notifies in smbd, nmbd and winbindd
authorStefan Metzmacher <metze@samba.org>
Tue, 1 Apr 2008 12:01:28 +0000 (14:01 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 12 Apr 2008 07:14:10 +0000 (09:14 +0200)
metze
(This used to be commit 64450cc1e441355aa8925b7183e90872eeab20b1)

source3/Makefile.in
source3/nmbd/nmbd.c
source3/smbd/server.c
source3/winbindd/winbindd.c

index 08883d8da423fb0892661ee926596796e346b9bc..59eeecf1288605caebb60dac2c490b817b1b7b21 100644 (file)
@@ -711,7 +711,7 @@ NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \
             nmbd/nmbd_processlogon.o nmbd/nmbd_responserecordsdb.o \
             nmbd/nmbd_sendannounce.o nmbd/nmbd_serverlistdb.o \
             nmbd/nmbd_subnetdb.o nmbd/nmbd_winsproxy.o nmbd/nmbd_winsserver.o \
-            nmbd/nmbd_workgroupdb.o nmbd/nmbd_synclists.o
+            nmbd/nmbd_workgroupdb.o nmbd/nmbd_synclists.o smbd/connection.o
 
 NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
            $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ)
@@ -1032,7 +1032,8 @@ WINBINDD_OBJ1 = \
                winbindd/winbindd_idmap.o \
                winbindd/winbindd_locator.o \
                winbindd/winbindd_ndr.o \
-               auth/token_util.o
+               auth/token_util.o \
+               smbd/connection.o
 
 WINBINDD_OBJ = \
                $(WINBINDD_OBJ1) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(GROUPDB_OBJ) \
index 034944531797f77fdfceb97cef7e41185dbbbfe0..01fdbbc5a46ad3f60d4295819d706d7a5d8046d9 100644 (file)
@@ -847,6 +847,8 @@ static bool open_sockets(bool isdaemon, int port)
        DEBUG(0,("nmbd version %s started.\n", SAMBA_VERSION_STRING));
        DEBUGADD(0,("%s\n", COPYRIGHT_STARTUP_MESSAGE));
 
+       db_tdb2_setup_messaging(NULL, false);
+
        if ( !reload_nmbd_services(False) )
                return(-1);
 
@@ -898,6 +900,10 @@ static bool open_sockets(bool isdaemon, int port)
        }
 
        pidfile_create("nmbd");
+
+       /* get broadcast messages */
+       claim_connection(NULL,"",FLAG_MSG_GENERAL|FLAG_MSG_DBWRAP);
+
        messaging_register(nmbd_messaging_context(), NULL,
                           MSG_FORCE_ELECTION, nmbd_message_election);
 #if 0
@@ -912,6 +918,8 @@ static bool open_sockets(bool isdaemon, int port)
        messaging_register(nmbd_messaging_context(), NULL,
                           MSG_SEND_PACKET, msg_nmbd_send_packet);
 
+       db_tdb2_setup_messaging(nmbd_messaging_context(), true);
+
        TimeInit();
 
        DEBUG( 3, ( "Opening sockets %d\n", global_nmb_port ) );
index 7a6e17135fe0ccdbae245d99e0faef0c8d64d378..bc0d4b70a3d0d60339b170eb4aea4928dfad7740 100644 (file)
@@ -553,7 +553,8 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
           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);
+       claim_connection(NULL,"",
+                        FLAG_MSG_GENERAL|FLAG_MSG_SMBD|FLAG_MSG_DBWRAP);
 
         /* Listen to messages */
 
@@ -574,6 +575,8 @@ 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"));
@@ -1226,6 +1229,7 @@ extern void build_options(bool screen);
        /*
         * Do this before reload_services.
         */
+       db_tdb2_setup_messaging(NULL, false);
 
        if (!reload_services(False))
                return(-1);     
index dbfd397f8bc2d77df31b72e6eae5dbb3189d5613..ff9bbf1c24ad5c16ba81b95a6356ee0c612fdb11 100644 (file)
@@ -1102,6 +1102,8 @@ int main(int argc, char **argv, char **envp)
        DEBUG(0,("winbindd version %s started.\n", SAMBA_VERSION_STRING));
        DEBUGADD(0,("%s\n", COPYRIGHT_STARTUP_MESSAGE));
 
+       db_tdb2_setup_messaging(NULL, false);
+
        if (!reload_services_file()) {
                DEBUG(0, ("error opening config file\n"));
                exit(1);
@@ -1188,6 +1190,9 @@ int main(int argc, char **argv, char **envp)
                exit(1);
        }
 
+       /* get broadcast messages */
+       claim_connection(NULL,"",FLAG_MSG_GENERAL|FLAG_MSG_DBWRAP);
+
        /* React on 'smbcontrol winbindd reload-config' in the same way
           as to SIGHUP signal */
        messaging_register(winbind_messaging_context(), NULL,
@@ -1214,6 +1219,8 @@ int main(int argc, char **argv, char **envp)
                           MSG_WINBIND_DUMP_DOMAIN_LIST,
                           winbind_msg_dump_domain_list);
 
+       db_tdb2_setup_messaging(winbind_messaging_context(), true);
+
        netsamlogon_cache_init(); /* Non-critical */
        
        /* clear the cached list of trusted domains */