Merge commit 'ctdb-ronnie/master'
authorMichael Adam <obnox@samba.org>
Mon, 9 Feb 2009 23:28:08 +0000 (00:28 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 9 Feb 2009 23:28:08 +0000 (00:28 +0100)
Makefile.in
config/events.d/41.httpd
configure.ac
doc/ctdbd.1
server/ctdbd.c
utils/smnotify/smnotify.c

index 0002da5f1447733107ed7ed63792fa0b028bdafc..176e2bfc234d091ecd1d77bfe857ae5291625ad3 100755 (executable)
@@ -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@
@@ -74,6 +76,17 @@ showflags:
        @echo '  CFLAGS = $(CFLAGS)'
        @echo '  LIBS = $(LIBS)'
 
+showlayout::
+       @echo "ctdb will be installed into:"
+       @echo "  prefix:      $(prefix)"
+       @echo "  bindir:      $(bindir)"
+       @echo "  sbindir:     $(sbindir)"
+       @echo "  libdir:      $(libdir)"
+       @echo "  vardir:      $(localstatedir)"
+       @echo "  logdir:      $(logdir)"
+       @echo "  mandir:      $(mandir)"
+       @echo "  etcdir:      $(etcdir)"
+
 .c.o:
        @echo Compiling $*.c
        @mkdir -p `dirname $@`
index 038392f71eac43fd86b6b9f9340e443e8afda0c9..fae9f47f55e159a21f3a84d0adff226e436233c0 100755 (executable)
@@ -1,9 +1,33 @@
 #!/bin/sh
-# event sript to manage httpd in a cluster environment
+# event script to manage httpd in a cluster environment
 
 . $CTDB_BASE/functions
 loadconfig ctdb
-loadconfig http
+
+detect_init_style
+
+case $CTDB_INIT_STYLE in
+       redhat)
+               CTDB_SERVICE_HTTP="httpd"
+               CTDB_CONFIG_HTTP="http"
+               ;;
+       suse)
+               CTDB_SERVICE_HTTP="apache2"
+               CTDB_CONFIG_HTTP="apache2"
+               ;;
+       ubuntu)
+               CTDB_SERVICE_HTTP="apache2"
+               CTDB_CONFIG_HTTP="apache2"
+               ;;
+       *)
+               # should not happen.
+               # for now use red hat style as default
+               CTDB_SERVICE_HTTP="httpd"
+               CTDB_CONFIG_HTTP="http"
+               ;;
+esac
+
+loadconfig "${CTDB_CONFIG_HTTP}"
 
 [ "$CTDB_MANAGES_HTTPD" = "yes" ] || exit 0
 
@@ -12,12 +36,12 @@ shift
 
 case $cmd in 
      startup)
-        service httpd stop > /dev/null 2>&1
-        service httpd start
+        service "${CTDB_SERVICE_HTTP}" stop > /dev/null 2>&1
+        service "${CTDB_SERVICE_HTTP}" start
         ;;
 
      shutdown)
-        service httpd stop
+        service "${CTDB_SERVICE_HTTP}" stop
         ;;
 
      monitor)
index d552eed00b44bf1f02edbcb6608ba21f61f0f79a..8b6102da3a7e692a08979da06ac74dbb20951a96 100644 (file)
@@ -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='${localstatedir}/log'
+AC_ARG_WITH([logdir],
+       [  --with-logdir=DIR       path to log directory [[LOCALSTATEDIR/log]]],
+       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=""
index 356818fdda03d1acf4b812644b1fc6dc408ffff0..38ba41a51767a823d767965be960031265e02f48 100644 (file)
@@ -48,7 +48,7 @@
 .it 1 an-trap
 .nr an-no-space-flag 1
 .nr an-break-flag 1
-\." make the size of the head bigger
+.\" make the size of the head bigger
 .ps +3
 .ft B
 .ne (2v + 1u)
@@ -82,7 +82,7 @@
 .nr an-no-space-flag 1
 .nr an-break-flag 1
 .ps \\n[PS-SS]u
-\." make the size of the head bigger
+.\" make the size of the head bigger
 .ps +2
 .ft B
 .ne (2v + 1u)
index ee433da2eb6342bd8353c70d80df4b99eda2c6dc..1d3b22aff78f9a71ffab583061213e56a93a3b16 100644 (file)
@@ -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,
index 3f0058c6187bb2e70302cfa7ad99676944d7c65c..d7fd54626e24c63214a4945c8e6894fabd717126 100644 (file)
@@ -24,7 +24,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include "smnotify.h"
-#include "../../lib/popt/popt.h"
+#include "popt.h"
 
 static char *client       = NULL;
 static const char *ip     = NULL;