diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2008-05-06 10:41:22 +1000 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2008-05-06 10:41:22 +1000 |
commit | d86e48d5ff96d03ff2f8b8e162881c41b8397d02 (patch) | |
tree | 86655c0405ece301d68136f43766cf0976178c54 /ctdb/server | |
parent | a9c45f9513a59d56a5acf695f05238778da0b414 (diff) | |
download | samba-d86e48d5ff96d03ff2f8b8e162881c41b8397d02.tar.gz samba-d86e48d5ff96d03ff2f8b8e162881c41b8397d02.tar.xz samba-d86e48d5ff96d03ff2f8b8e162881c41b8397d02.zip |
Add ability to disable recmaster and lmaster roles through sysconfig file and
command line arguments
(This used to be ctdb commit 34b952e4adc53ee82345275a0e28231fa1b2533e)
Diffstat (limited to 'ctdb/server')
-rw-r--r-- | ctdb/server/ctdbd.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c index bf441abb19..c21d4349e9 100644 --- a/ctdb/server/ctdbd.c +++ b/ctdb/server/ctdbd.c @@ -43,6 +43,8 @@ static struct { int no_setsched; int use_syslog; int start_as_disabled; + int no_lmaster; + int no_recmaster; } options = { .nlist = ETCDIR "/ctdb/nodes", .transport = "tcp", @@ -120,6 +122,8 @@ int main(int argc, const char *argv[]) { "nosetsched", 0, POPT_ARG_NONE, &options.no_setsched, 0, "disable setscheduler SCHED_FIFO call", NULL }, { "syslog", 0, POPT_ARG_NONE, &options.use_syslog, 0, "log messages to syslog", NULL }, { "start-as-disabled", 0, POPT_ARG_NONE, &options.start_as_disabled, 0, "Node starts in disabled state", NULL }, + { "no-lmaster", 0, POPT_ARG_NONE, &options.no_lmaster, 0, "disable lmaster role on this node", NULL }, + { "no-recmaster", 0, POPT_ARG_NONE, &options.no_recmaster, 0, "disable recmaster role on this node", NULL }, POPT_TABLEEND }; int opt, ret; @@ -201,8 +205,13 @@ int main(int argc, const char *argv[]) } /* set ctdbd capabilities */ - /* We can be an lmaster, we can also be a recmaster */ - ctdb->capabilities = CTDB_CAP_LMASTER | CTDB_CAP_RECMASTER; + ctdb->capabilities = 0; + if (options.no_lmaster == 0) { + ctdb->capabilities |= CTDB_CAP_LMASTER; + } + if (options.no_recmaster == 0) { + ctdb->capabilities |= CTDB_CAP_RECMASTER; + } /* tell ctdb what nodes are available */ ctdb_load_nodes_file(ctdb); |