From 7a5790de22e8370b2812414aa1adef8201e8b269 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 14 Sep 2010 14:49:42 +0200 Subject: [PATCH] tools/ctdb: add 'persistent' flag to "ctdb attach" metze --- tools/ctdb.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/ctdb.c b/tools/ctdb.c index d8f8ea02..61a6c97c 100644 --- a/tools/ctdb.c +++ b/tools/ctdb.c @@ -3761,13 +3761,23 @@ static int control_attach(struct ctdb_context *ctdb, int argc, const char **argv { const char *db_name; struct ctdb_db_context *ctdb_db; + bool persistent = false; if (argc < 1) { usage(); } db_name = argv[0]; + if (argc > 2) { + usage(); + } + if (argc == 2) { + if (strcmp(argv[1], "persistent") != 0) { + usage(); + } + persistent = true; + } - ctdb_db = ctdb_attach(ctdb, db_name, false, 0); + ctdb_db = ctdb_attach(ctdb, db_name, persistent, 0); if (ctdb_db == NULL) { DEBUG(DEBUG_ERR,("Unable to attach to database '%s'\n", db_name)); return -1; @@ -4756,7 +4766,7 @@ static const struct { { "getdebug", control_getdebug, true, false, "get debug level" }, { "getlog", control_getlog, true, false, "get the log data from the in memory ringbuffer", "" }, { "clearlog", control_clearlog, true, false, "clear the log data from the in memory ringbuffer" }, - { "attach", control_attach, true, false, "attach to a database", "" }, + { "attach", control_attach, true, false, "attach to a database", " [persistent]" }, { "dumpmemory", control_dumpmemory, true, false, "dump memory map to stdout" }, { "rddumpmemory", control_rddumpmemory, true, false, "dump memory map from the recovery daemon to stdout" }, { "getpid", control_getpid, true, false, "get ctdbd process ID" }, -- 2.34.1