1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

change clogd to cmirrord

make pidfile locn configurable
This commit is contained in:
Alasdair Kergon 2009-08-28 20:51:40 +00:00
parent a946372e50
commit 66fd45290c
7 changed files with 76 additions and 36 deletions

View File

@ -5,7 +5,7 @@ Version 2.02.52 -
Fix pvcreate string termination in duplicate uuid warning message.
Fix pvcreate on a partition (2.02.51).
Fix vgcfgrestore error paths when locking fails (2.02.49).
Added configure --enable-clogd to conditionally build the cluster log daemon.
Added configure --enable-cmirrord to build the cluster mirror log daemon.
Make lvchange --refresh only take a read lock on volume group.
Fix bug where non-blocking file locks could be granted in error.
Make lvm2app pv_t, lv_t, vg_t handle definitions consistent with lvm_t.

50
configure vendored
View File

@ -688,13 +688,13 @@ DEBUG
COPTIMISE_FLAG
CONFDIR
CMDLIB
CLOGD
CLVMD
CLUSTER
CLDWHOLEARCHIVE
CLDNOWHOLEARCHIVE
CLDFLAGS
BUILD_DMEVENTD
BUILD_CMIRRORD
APPLIB
MODPROBE_CMD
MSGFMT
@ -814,7 +814,8 @@ with_mirrors
enable_readline
enable_realtime
with_clvmd
enable_clogd
enable_cmirrord
with_cmirrord_pidfile
enable_debug
with_optimisation
enable_profiling
@ -1502,7 +1503,7 @@ Optional Features:
device-mapper is missing from the kernel
--disable-readline Disable readline support
--disable-realtime Disable realtime clock support
--enable-clogd Enable the cluster log daemon
--enable-cmirrord Enable the cluster mirror log daemon
--enable-debug Enable debugging
--enable-profiling Gather gcov profiling data
--disable-devmapper Disable LVM2 device-mapper interaction
@ -1545,6 +1546,7 @@ Optional Packages:
* all (autodetect)
* none (disable build)
TYPE=none
--with-cmirrord-pidfile=PATH cmirrord pidfile [/var/run/cmirrord.pid]
--with-optimisation=OPT C optimisation flag [OPT=-O2]
--with-localedir=DIR Translation files in DIR [PREFIX/share/locale]
--with-confdir=DIR Configuration files in DIR [/etc]
@ -11653,19 +11655,45 @@ $as_echo "Enabling clvmd openais backend" >&6; }
fi
################################################################################
{ $as_echo "$as_me:$LINENO: checking whether to build cluster log daemon" >&5
$as_echo_n "checking whether to build cluster log daemon... " >&6; }
# Check whether --enable-clogd was given.
if test "${enable_clogd+set}" = set; then
enableval=$enable_clogd; CLOGD=$enableval
{ $as_echo "$as_me:$LINENO: checking whether to build cluster mirror log daemon" >&5
$as_echo_n "checking whether to build cluster mirror log daemon... " >&6; }
# Check whether --enable-cmirrord was given.
if test "${enable_cmirrord+set}" = set; then
enableval=$enable_cmirrord; CMIRRORD=$enableval
else
CMIRRORD=no
fi
{ $as_echo "$as_me:$LINENO: result: $CLOGD" >&5
$as_echo "$CLOGD" >&6; }
{ $as_echo "$as_me:$LINENO: result: $CMIRRORD" >&5
$as_echo "$CMIRRORD" >&6; }
if [ "x$CLOGD" = xall -o `expr x"$CLOGD" : '.*corosync.*'` != 0 ]; then
BUILD_CMIRRORD=$CMIRRORD
################################################################################
if test "x$BUILD_CMIRRORD" = xyes; then
# Check whether --with-cmirrord-pidfile was given.
if test "${with_cmirrord_pidfile+set}" = set; then
withval=$with_cmirrord_pidfile; cat >>confdefs.h <<_ACEOF
#define CMIRRORD_PIDFILE "$withval"
_ACEOF
else
cat >>confdefs.h <<_ACEOF
#define CMIRRORD_PIDFILE "/var/run/cmirrord.pid"
_ACEOF
fi
fi
################################################################################
if [ "x$BUILD_CMIRRORD" = xyes ]; then
#
# FIXME: ALSO NEED TO CHECK FOR CHECKPOINT MODULE
# FIXME: Merge this with the new clvmd logic
#
pkg_failed=no

View File

@ -550,16 +550,30 @@ if test x$CLVMD = xall; then
fi
################################################################################
dnl -- Build cluster log daemon
AC_MSG_CHECKING(whether to build cluster log daemon)
AC_ARG_ENABLE(clogd, [ --enable-clogd Enable the cluster log daemon],
CLOGD=$enableval)
AC_MSG_RESULT($CLOGD)
dnl -- Build cluster mirror log daemon
AC_MSG_CHECKING(whether to build cluster mirror log daemon)
AC_ARG_ENABLE(cmirrord, [ --enable-cmirrord Enable the cluster mirror log daemon],
CMIRRORD=$enableval, CMIRRORD=no)
AC_MSG_RESULT($CMIRRORD)
BUILD_CMIRRORD=$CMIRRORD
################################################################################
dnl -- cmirrord pidfile
AH_TEMPLATE(CMIRRORD_PIDFILE, [Path to cmirrord pidfile.])
if test "x$BUILD_CMIRRORD" = xyes; then
AC_ARG_WITH(cmirrord-pidfile,
[ --with-cmirrord-pidfile=PATH cmirrord pidfile [[/var/run/cmirrord.pid]] ],
[ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"$withval") ],
[ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"/var/run/cmirrord.pid") ])
fi
################################################################################
dnl -- Look for corosync libraries if required.
if [[ "x$CLOGD" = xall -o `expr x"$CLOGD" : '.*corosync.*'` != 0 ]]; then
if [[ "x$BUILD_CMIRRORD" = xyes ]]; then
#
# FIXME: ALSO NEED TO CHECK FOR CHECKPOINT MODULE
# FIXME: Merge this with the new clvmd logic
#
PKG_CHECK_MODULES(CPG, libcpg, [],
[AC_MSG_RESULT([no pkg for libcpg library, using -lcpg]);
@ -1007,6 +1021,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
################################################################################
AC_SUBST(APPLIB)
AC_SUBST(BUILD_CMIRRORD)
AC_SUBST(BUILD_DMEVENTD)
AC_SUBST(CCS_CFLAGS)
AC_SUBST(CCS_LIBS)
@ -1017,7 +1032,6 @@ AC_SUBST(CLDNOWHOLEARCHIVE)
AC_SUBST(CLDWHOLEARCHIVE)
AC_SUBST(CLUSTER)
AC_SUBST(CLVMD)
AC_SUBST(CLOGD)
AC_SUBST(CMAN_CFLAGS)
AC_SUBST(CMAN_LIBS)
AC_SUBST(CMDLIB)

View File

@ -21,16 +21,16 @@ ifneq ("@CLVMD@", "none")
SUBDIRS = clvmd
endif
ifeq ("@CLOGD@", "yes")
SUBDIRS += clogd
ifeq ("@BUILD_CMIRRORD@", "yes")
SUBDIRS += cmirrord
endif
ifeq ("@DMEVENTD@", "yes")
ifeq ("@BUILD_DMEVENTD@", "yes")
SUBDIRS += dmeventd
endif
include $(top_srcdir)/make.tmpl
ifeq ("@DMEVENTD@", "yes")
ifeq ("@BUILD_DMEVENTD@", "yes")
device-mapper: dmeventd.device-mapper
endif

View File

@ -17,22 +17,17 @@ VPATH = @srcdir@
SOURCES = clogd.c cluster.c functions.c link_mon.c local.c logging.c
ifeq ("@DEBUG@", "yes")
DEFS += -DDEBUG
endif
TARGETS = clogd
TARGETS = cmirrord
include $(top_srcdir)/make.tmpl
LDFLAGS += -L$(usrlibdir)/openais
LIBS += -lcpg -lSaCkpt -ldevmapper
clogd: $(OBJECTS) $(top_srcdir)/lib/liblvm-internal.a
echo $(LIBS)
$(CC) -o clogd $(OBJECTS) $(CFLAGS) $(LDFLAGS) \
cmirrord: $(OBJECTS) $(top_srcdir)/lib/liblvm-internal.a
$(CC) -o cmirrord $(OBJECTS) $(CFLAGS) $(LDFLAGS) \
$(LVMLIBS) $(LMLIBS) $(LIBS)
install: $(TARGETS)
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) clogd \
$(usrsbindir)/clogd
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) cmirrord \
$(usrsbindir)/cmirrord

View File

@ -52,7 +52,7 @@ int main(int argc, char *argv[])
/* Parent can now exit, we're ready to handle requests */
kill(getppid(), SIGTERM);
LOG_PRINT("Starting clogd:");
LOG_PRINT("Starting cmirrord:");
LOG_PRINT(" Built: "__DATE__" "__TIME__"\n");
LOG_DBG(" Compiled with debugging.");
@ -233,9 +233,9 @@ static void daemonize(void)
open("/dev/null", O_WRONLY); /* reopen stdout */
open("/dev/null", O_WRONLY); /* reopen stderr */
LOG_OPEN("clogd", LOG_PID, LOG_DAEMON);
LOG_OPEN("cmirrord", LOG_PID, LOG_DAEMON);
if (create_lockfile("/var/run/clogd.pid"))
if (create_lockfile(CMIRRORD_PIDFILE))
exit(EXIT_LOCKFILE);
signal(SIGINT, &sig_handler);

View File

@ -6,6 +6,9 @@
/* Define to 1 to include built-in support for clustered LVM locking. */
#undef CLUSTER_LOCKING_INTERNAL
/* Path to cmirrord pidfile. */
#undef CMIRRORD_PIDFILE
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/