summaryrefslogtreecommitdiff
path: root/ctdb/common/cmdline.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-04-29 22:42:23 +0200
committerAndrew Tridgell <tridge@samba.org>2007-04-29 22:42:23 +0200
commitf455d3f44bd9f9a3e734947636a4be0af69dba23 (patch)
treee12ae5bdbdbb6e9461c0da775a9c5ac4fdb47ff7 /ctdb/common/cmdline.c
parente21f69107f423f24f5407adb9323fb0bc8aa3f64 (diff)
downloadsamba-f455d3f44bd9f9a3e734947636a4be0af69dba23.tar.gz
saner logfile code
testing of ctdbd (This used to be ctdb commit 05789da5818f8b20f04779b0df5125914d9047f6)
Diffstat (limited to 'ctdb/common/cmdline.c')
-rw-r--r--ctdb/common/cmdline.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ctdb/common/cmdline.c b/ctdb/common/cmdline.c
index 988fee81e84..4ffb032ed1e 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);
}