diff options
Diffstat (limited to 'ctdb/common/cmdline.c')
-rw-r--r-- | ctdb/common/cmdline.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ctdb/common/cmdline.c b/ctdb/common/cmdline.c index 988fee81e8..4ffb032ed1 100644 --- a/ctdb/common/cmdline.c +++ b/ctdb/common/cmdline.c @@ -36,6 +36,7 @@ static struct { int self_connect; const char *db_dir; int torture; + const char *logfile; } ctdb_cmdline = { .nlist = NULL, .transport = "tcp", @@ -43,7 +44,8 @@ static struct { .socketname = CTDB_PATH, .self_connect = 0, .db_dir = NULL, - .torture = 0 + .torture = 0, + .logfile = NULL }; @@ -56,6 +58,7 @@ struct poptOption popt_ctdb_cmdline[] = { { "debug", 'd', POPT_ARG_INT, &LogLevel, 0, "debug level"}, { "dbdir", 0, POPT_ARG_STRING, &ctdb_cmdline.db_dir, 0, "directory for the tdb files", NULL }, { "torture", 0, POPT_ARG_NONE, &ctdb_cmdline.torture, 0, "enable nastiness in library", NULL }, + { "logfile", 0, POPT_ARG_STRING, &ctdb_cmdline.logfile, 0, "log file location", "filename" }, { NULL } }; @@ -80,6 +83,12 @@ struct ctdb_context *ctdb_cmdline_init(struct event_context *ev) exit(1); } + ret = ctdb_set_logfile(ctdb, ctdb_cmdline.logfile); + if (ret == -1) { + printf("ctdb_set_logfile failed - %s\n", ctdb_errstr(ctdb)); + exit(1); + } + if (ctdb_cmdline.self_connect) { ctdb_set_flags(ctdb, CTDB_FLAG_SELF_CONNECT); } |