dbwrap: when clustering = yes, don't fall back to db_open_tdb in db_open
authorMichael Adam <obnox@samba.org>
Mon, 14 Jul 2008 08:43:28 +0000 (10:43 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 15 Jul 2008 11:55:26 +0000 (13:55 +0200)
Michael
(This used to be commit 33188a991f7e2f8dc1b5beed1dde1b7f77403e1a)

source3/lib/dbwrap.c

index 7fe1631bff040595e8b5d4b7b31d555742fcf62c..a686ba6b7c4e56dd657eeb55da7e75d563fa148f 100644 (file)
@@ -60,8 +60,15 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
                sockname = CTDB_PATH;
        }
 
-       if (lp_clustering() && socket_exist(sockname)) {
+       if (lp_clustering()) {
                const char *partname;
+
+               if (!socket_exist(sockname)) {
+                       DEBUG(1, ("ctdb socket does not exist - is ctdb not "
+                                 "running?\n"));
+                       return NULL;
+               }
+
                /* ctdb only wants the file part of the name */
                partname = strrchr(name, '/');
                if (partname) {