diff --git a/Makefile.in b/Makefile.in index f7b4fb9..609d872 100755 --- a/Makefile.in +++ b/Makefile.in @@ -12,6 +12,7 @@ bindir = @bindir@ sbindir = @sbindir@ mandir = @mandir@ localstatedir = @localstatedir@ +LOGDIR = @LOGDIR@ VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@ srcdir = @srcdir@ etcdir = @sysconfdir@ @@ -30,6 +31,7 @@ IPQ_LIBS = @IPQ_LIBS@ CFLAGS=-g -I$(srcdir)/include -Iinclude -Ilib -Ilib/util -I$(srcdir) \ -I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \ -DVARDIR=\"$(localstatedir)\" -DETCDIR=\"$(etcdir)\" \ + -DLOGDIR=\"$(logdir)\" \ -DUSE_MMAP=1 @CFLAGS@ $(POPT_CFLAGS) LIB_FLAGS=@LDFLAGS@ -Llib @LIBS@ $(POPT_LIBS) @INFINIBAND_LIBS@ @CTDB_PCAP_LDFLAGS@ diff --git a/configure.ac b/configure.ac index d552eed..1a5f013 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,17 @@ if test "$ac_cv_prog_gcc" = yes; then CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings" fi +LOGDIR='${prefix}/var/log' +AC_ARG_WITH([logdir], + [ --with-logdir=DIR path to log directory], + LOGDIR=$withval) +if test ! -z "$LOGDIR"; then + if test "$LOGDIR" = "yes" -o "$LOGDIR" = "no"; then + AC_MSG_ERROR([--with-logdir must specify a path]) + fi +fi +AC_SUBST(LOGDIR) + AC_CONFIG_HEADER(config.h) EXTRA_OBJ="" diff --git a/server/ctdbd.c b/server/ctdbd.c index 351948c..32410c5 100644 --- a/server/ctdbd.c +++ b/server/ctdbd.c @@ -52,7 +52,7 @@ static struct { .nlist = ETCDIR "/ctdb/nodes", .transport = "tcp", .event_script_dir = ETCDIR "/ctdb/events.d", - .logfile = VARDIR "/log/log.ctdb", + .logfile = LOGDIR "/log.ctdb", .db_dir = VARDIR "/ctdb", .db_dir_persistent = VARDIR "/ctdb/persistent", .script_log_level = DEBUG_ERR, -- 1.5.6.5