1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-04 09:18:36 +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 string termination in duplicate uuid warning message.
Fix pvcreate on a partition (2.02.51). Fix pvcreate on a partition (2.02.51).
Fix vgcfgrestore error paths when locking fails (2.02.49). 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. Make lvchange --refresh only take a read lock on volume group.
Fix bug where non-blocking file locks could be granted in error. 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. 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 COPTIMISE_FLAG
CONFDIR CONFDIR
CMDLIB CMDLIB
CLOGD
CLVMD CLVMD
CLUSTER CLUSTER
CLDWHOLEARCHIVE CLDWHOLEARCHIVE
CLDNOWHOLEARCHIVE CLDNOWHOLEARCHIVE
CLDFLAGS CLDFLAGS
BUILD_DMEVENTD BUILD_DMEVENTD
BUILD_CMIRRORD
APPLIB APPLIB
MODPROBE_CMD MODPROBE_CMD
MSGFMT MSGFMT
@ -814,7 +814,8 @@ with_mirrors
enable_readline enable_readline
enable_realtime enable_realtime
with_clvmd with_clvmd
enable_clogd enable_cmirrord
with_cmirrord_pidfile
enable_debug enable_debug
with_optimisation with_optimisation
enable_profiling enable_profiling
@ -1502,7 +1503,7 @@ Optional Features:
device-mapper is missing from the kernel device-mapper is missing from the kernel
--disable-readline Disable readline support --disable-readline Disable readline support
--disable-realtime Disable realtime clock 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-debug Enable debugging
--enable-profiling Gather gcov profiling data --enable-profiling Gather gcov profiling data
--disable-devmapper Disable LVM2 device-mapper interaction --disable-devmapper Disable LVM2 device-mapper interaction
@ -1545,6 +1546,7 @@ Optional Packages:
* all (autodetect) * all (autodetect)
* none (disable build) * none (disable build)
TYPE=none TYPE=none
--with-cmirrord-pidfile=PATH cmirrord pidfile [/var/run/cmirrord.pid]
--with-optimisation=OPT C optimisation flag [OPT=-O2] --with-optimisation=OPT C optimisation flag [OPT=-O2]
--with-localedir=DIR Translation files in DIR [PREFIX/share/locale] --with-localedir=DIR Translation files in DIR [PREFIX/share/locale]
--with-confdir=DIR Configuration files in DIR [/etc] --with-confdir=DIR Configuration files in DIR [/etc]
@ -11653,19 +11655,45 @@ $as_echo "Enabling clvmd openais backend" >&6; }
fi fi
################################################################################ ################################################################################
{ $as_echo "$as_me:$LINENO: checking whether to build cluster log daemon" >&5 { $as_echo "$as_me:$LINENO: checking whether to build cluster mirror log daemon" >&5
$as_echo_n "checking whether to build cluster log daemon... " >&6; } $as_echo_n "checking whether to build cluster mirror log daemon... " >&6; }
# Check whether --enable-clogd was given. # Check whether --enable-cmirrord was given.
if test "${enable_clogd+set}" = set; then if test "${enable_cmirrord+set}" = set; then
enableval=$enable_clogd; CLOGD=$enableval enableval=$enable_cmirrord; CMIRRORD=$enableval
else
CMIRRORD=no
fi fi
{ $as_echo "$as_me:$LINENO: result: $CLOGD" >&5 { $as_echo "$as_me:$LINENO: result: $CMIRRORD" >&5
$as_echo "$CLOGD" >&6; } $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: ALSO NEED TO CHECK FOR CHECKPOINT MODULE
# FIXME: Merge this with the new clvmd logic
# #
pkg_failed=no pkg_failed=no

View File

@ -550,16 +550,30 @@ if test x$CLVMD = xall; then
fi fi
################################################################################ ################################################################################
dnl -- Build cluster log daemon dnl -- Build cluster mirror log daemon
AC_MSG_CHECKING(whether to build cluster log daemon) AC_MSG_CHECKING(whether to build cluster mirror log daemon)
AC_ARG_ENABLE(clogd, [ --enable-clogd Enable the cluster log daemon], AC_ARG_ENABLE(cmirrord, [ --enable-cmirrord Enable the cluster mirror log daemon],
CLOGD=$enableval) CMIRRORD=$enableval, CMIRRORD=no)
AC_MSG_RESULT($CLOGD) 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. 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: ALSO NEED TO CHECK FOR CHECKPOINT MODULE
# FIXME: Merge this with the new clvmd logic
# #
PKG_CHECK_MODULES(CPG, libcpg, [], PKG_CHECK_MODULES(CPG, libcpg, [],
[AC_MSG_RESULT([no pkg for libcpg library, using -lcpg]); [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(APPLIB)
AC_SUBST(BUILD_CMIRRORD)
AC_SUBST(BUILD_DMEVENTD) AC_SUBST(BUILD_DMEVENTD)
AC_SUBST(CCS_CFLAGS) AC_SUBST(CCS_CFLAGS)
AC_SUBST(CCS_LIBS) AC_SUBST(CCS_LIBS)
@ -1017,7 +1032,6 @@ AC_SUBST(CLDNOWHOLEARCHIVE)
AC_SUBST(CLDWHOLEARCHIVE) AC_SUBST(CLDWHOLEARCHIVE)
AC_SUBST(CLUSTER) AC_SUBST(CLUSTER)
AC_SUBST(CLVMD) AC_SUBST(CLVMD)
AC_SUBST(CLOGD)
AC_SUBST(CMAN_CFLAGS) AC_SUBST(CMAN_CFLAGS)
AC_SUBST(CMAN_LIBS) AC_SUBST(CMAN_LIBS)
AC_SUBST(CMDLIB) AC_SUBST(CMDLIB)

View File

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

View File

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

View File

@ -52,7 +52,7 @@ int main(int argc, char *argv[])
/* Parent can now exit, we're ready to handle requests */ /* Parent can now exit, we're ready to handle requests */
kill(getppid(), SIGTERM); kill(getppid(), SIGTERM);
LOG_PRINT("Starting clogd:"); LOG_PRINT("Starting cmirrord:");
LOG_PRINT(" Built: "__DATE__" "__TIME__"\n"); LOG_PRINT(" Built: "__DATE__" "__TIME__"\n");
LOG_DBG(" Compiled with debugging."); 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 stdout */
open("/dev/null", O_WRONLY); /* reopen stderr */ 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); exit(EXIT_LOCKFILE);
signal(SIGINT, &sig_handler); signal(SIGINT, &sig_handler);

View File

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