]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-server: use the new "nodes list" configuration option
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 6 Jun 2024 14:00:10 +0000 (10:00 -0400)
committerMartin Schwenke <martins@samba.org>
Tue, 6 Aug 2024 00:43:36 +0000 (00:43 +0000)
Use the new "nodes list" configuration option. Executing the given path
if the path is prefixed by a `!`. The use case is to decouple the nodes
file from the shared storage, especially in the case where the shared
storage is provided by a vfs module.

For an example, imagine a script that runs `curl` on a URL for a
highly-available web server where the URL provides the content
of the nodes file.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/server/ctdbd.c

index 67311c6a5da8274ccb9c0685943d3818f389eb08..42695fff444b4367e71e96f352c7bbe6dab5d49e 100644 (file)
@@ -42,6 +42,7 @@
 #include "common/logging.h"
 
 #include "conf/logging_conf.h"
+#include "conf/cluster_conf.h"
 #include "conf/ctdb_config.h"
 
 int script_log_level;
@@ -303,7 +304,7 @@ int main(int argc, const char *argv[])
        }
 
        /* tell ctdb what nodes are available */
-       ctdb->nodes_file = talloc_asprintf(ctdb, "%s/nodes", ctdb_base);
+       ctdb->nodes_file = cluster_conf_nodes_list(ctdb, conf);
        if (ctdb->nodes_file == NULL) {
                DBG_ERR(" Out of memory\n");
                goto fail;