Page MenuHomeClusterLabs Projects

No OneTemporary

diff --git a/configure.ac b/configure.ac
index 5b9971f0..a432dbe6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,678 +1,680 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# bootstrap / init
AC_PREREQ([2.61])
AC_INIT([corosync],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[discuss@lists.corosync.org])
AM_INIT_AUTOMAKE([-Wno-portability])
LT_PREREQ([2.2.6])
LT_INIT
AM_SILENT_RULES([yes])
AC_CONFIG_SRCDIR([lib/cpg.c])
AC_CONFIG_HEADER([include/corosync/config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AC_LANG([C])
dnl Fix default variables - "prefix" variable if not specified
if test "$prefix" = "NONE"; then
prefix="/usr"
dnl Fix "localstatedir" variable if not specified
if test "$localstatedir" = "\${prefix}/var"; then
localstatedir="/var"
fi
dnl Fix "sysconfdir" variable if not specified
if test "$sysconfdir" = "\${prefix}/etc"; then
sysconfdir="/etc"
fi
dnl Fix "libdir" variable if not specified
if test "$libdir" = "\${exec_prefix}/lib"; then
if test -e /usr/lib64; then
libdir="/usr/lib64"
else
libdir="/usr/lib"
fi
fi
fi
if test "$srcdir" = "."; then
AC_MSG_NOTICE([building in place srcdir:$srcdir])
AC_DEFINE([BUILDING_IN_PLACE], 1, [building in place])
else
AC_MSG_NOTICE([building out of tree srcdir:$srcdir])
fi
# Checks for programs.
# check stolen from gnulib/m4/gnu-make.m4
if ! ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
AC_MSG_ERROR([you don't seem to have GNU make; it is required])
fi
sinclude(coroysync-default.m4)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_SED
AC_PROG_LIBTOOL
AC_CHECK_PROGS([GROFF], [groff])
AC_CHECK_PROGS([PKGCONFIG], [pkg-config])
AC_CHECK_PROGS([AUGTOOL], [augtool])
AC_CHECK_PROGS([DOT], [dot])
AC_CHECK_PROGS([DOXYGEN], [doxygen])
AC_CHECK_PROGS([AWK], [awk])
AC_CHECK_PROGS([SED], [sed])
+AC_PATH_PROG([BASHPATH], [bash])
# Checks for compiler characteristics.
AC_PROG_GCC_TRADITIONAL
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdint.h \
stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h \
sys/time.h syslog.h unistd.h sys/types.h getopt.h malloc.h \
sys/sockio.h utmpx.h ifaddrs.h stddef.h sys/file.h])
# Checks for typedefs.
AC_TYPE_UID_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_SIGNAL
# Checks for libraries.
PKG_CHECK_MODULES([nss],[nss])
PKG_CHECK_MODULES([LIBQB], [libqb])
AC_CHECK_LIB([qb], [qb_log_thread_priority_set], \
have_qb_log_thread_priority_set="yes", \
have_qb_log_thread_priority_set="no")
if test "x${have_qb_log_thread_priority_set}" = xyes; then
AC_DEFINE_UNQUOTED([HAVE_QB_LOG_THREAD_PRIORITY_SET], 1, [have qb_log_thread_priority_set])
fi
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([socket], [socket])
AC_CHECK_LIB([nsl], [t_open])
AC_CHECK_LIB([rt], [sched_getscheduler])
# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([alarm alphasort atexit bzero dup2 endgrent endpwent fcntl \
getcwd getpeerucred getpeereid gettimeofday inet_ntoa memmove \
memset mkdir scandir select socket strcasecmp strchr strdup \
strerror strrchr strspn strstr pthread_setschedparam \
sched_get_priority_max sched_setscheduler getifaddrs \
clock_gettime ftruncate gethostname localtime_r munmap strtol])
AC_CONFIG_FILES([Makefile
exec/Makefile
include/Makefile
init/Makefile
lib/Makefile
common_lib/Makefile
man/Makefile
pkgconfig/Makefile
test/Makefile
cts/Makefile
cts/agents/Makefile
cts/CTSvars.py
tools/Makefile
conf/Makefile
qdevices/Makefile
Doxyfile])
### Local business
dnl ===============================================
dnl Functions / global M4 variables
dnl ===============================================
dnl Global list of LIB names
m4_define([local_soname_list], [])dnl
dnl Upcase parameter
m4_define([local_upcase], [translit([$*], [a-z], [A-Z])])dnl
dnl M4 macro for include lib/lib$1.soname and subst that
m4_define([LIB_SONAME_IMPORT],[dnl
m4_define([local_libname], local_upcase($1)[_SONAME])dnl
m4_define([local_soname], translit(m4_sinclude(lib/lib$1.verso), [
], []))dnl
local_libname="local_soname"dnl
m4_define([local_soname_list], m4_defn([local_soname_list])[,]local_libname[,]local_upcase($1))dnl
AC_SUBST(local_libname)dnl
])dnl
dnl M4 macro for print padspaces (used in LIB_MSG_RESULT). It takes 2 arguments, length of string to pad and desired
dnl (padded) length
m4_define([m4_printpadspace],[ifelse(m4_eval([$2 - $1 < 1]),[1],,[ ][m4_printpadspace([$1],m4_eval([$2 - 1]))])])dnl
dnl Show AC_MSG_RESULT for specific libraries
m4_define([LIB_MSG_RESULT], [ifelse([$#], [1], ,[dnl
AC_MSG_RESULT([ $2 Library SONAME m4_printpadspace(len($2),8) = ${$1}])
LIB_MSG_RESULT(m4_shift(m4_shift($@)))dnl
])])dnl
# ===============================================
# Helpers
# ===============================================
## helper for CC stuff
cc_supports_flag() {
local CPPFLAGS="$CPPFLAGS $@"
AC_MSG_CHECKING([whether $CC supports "$@"])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
[RC=0; AC_MSG_RESULT([yes])],
[RC=1; AC_MSG_RESULT([no])])
return $RC
}
## cleanup
AC_MSG_NOTICE(Sanitizing prefix: ${prefix})
case $prefix in
NONE) prefix=/usr/local;;
esac
AC_MSG_NOTICE(Sanitizing exec_prefix: ${exec_prefix})
case $exec_prefix in
dnl For consistency with Corosync, map NONE->$prefix
NONE) exec_prefix=$prefix;;
prefix) exec_prefix=$prefix;;
esac
## local defines
PACKAGE_FEATURES=""
LINT_FLAGS="-weak -unrecog +posixlib +ignoresigns -fcnuse \
-badflag -D__gnuc_va_list=va_list -D__attribute\(x\)="
# default libraries SONAME
SOMAJOR="5"
SOMINOR="0"
SOMICRO="0"
SONAME="${SOMAJOR}.${SOMINOR}.${SOMICRO}"
# specific libraries SONAME
LIB_SONAME_IMPORT([cfg])
LIB_SONAME_IMPORT([cpg])
LIB_SONAME_IMPORT([quorum])
LIB_SONAME_IMPORT([sam])
LIB_SONAME_IMPORT([votequorum])
LIB_SONAME_IMPORT([cmap])
# local options
AC_ARG_ENABLE([ansi],
[ --enable-ansi : force to build with ANSI standards. ],
[ default="no" ])
AC_ARG_ENABLE([fatal-warnings],
[ --enable-fatal-warnings : enable fatal warnings. ],
[ default="no" ])
AC_ARG_ENABLE([debug],
[ --enable-debug : enable debug build. ],
[ default="no" ])
AC_ARG_ENABLE([user-flags],
[ --enable-user-flags : rely on user environment. ],
[ default="no" ])
AC_ARG_ENABLE([coverage],
[ --enable-coverage : coverage analysis of the codebase. ],
[ default="no" ])
AC_ARG_ENABLE([small-memory-footprint],
[ --enable-small-memory-footprint : Use small message queues and small messages sizes. ],
[ default="no" ])
AC_ARG_ENABLE([dbus],
[ --enable-dbus : dbus events. ],,
[ enable_dbus="no" ])
AC_ARG_ENABLE([testagents],
[ --enable-testagents : Install Test Agents. ],,
[ default="no" ])
AC_ARG_ENABLE([rdma],
[ --enable-rdma : Infiniband RDMA transport support ],,
[ enable_rdma="no" ])
AM_CONDITIONAL(BUILD_RDMA, test x$enable_rdma = xyes)
AC_ARG_ENABLE([monitoring],
[ --enable-monitoring : resource monitoring ],,
[ default="no" ])
AM_CONDITIONAL(BUILD_MONITORING, test x$enable_monitoring = xyes)
AC_ARG_ENABLE([watchdog],
[ --enable-watchdog : Watchdog support ],,
[ default="no" ])
AM_CONDITIONAL(BUILD_WATCHDOG, test x$enable_watchdog = xyes)
AC_ARG_ENABLE([augeas],
[ --enable-augeas : Install the augeas lens for corosync.conf ],,
[ enable_augeas="no" ])
AM_CONDITIONAL(INSTALL_AUGEAS, test x$enable_augeas = xyes)
AC_ARG_ENABLE([systemd],
[ --enable-systemd : Install systemd service files],,
[ enable_systemd="no" ])
AM_CONDITIONAL(INSTALL_SYSTEMD, test x$enable_systemd = xyes)
AC_ARG_WITH([initddir],
[ --with-initddir=DIR : path to init script directory. ],
[ INITDDIR="$withval" ],
[ INITDDIR="$sysconfdir/init.d" ])
AC_ARG_WITH([systemddir],
[ --with-systemddir=DIR : path to systemd unit files directory. ],
[ SYSTEMDDIR="$withval" ],
[ SYSTEMDDIR="/lib/systemd/system" ])
AC_ARG_WITH([initwrappersdir],
[ --with-initwrappersdir=DIR : path to init wrappers files directory. ],
[ INITWRAPPERSDIR="$withval" ],
[ INITWRAPPERSDIR="$datarootdir/corosync" ])
AC_ARG_ENABLE([snmp],
[ --enable-snmp : SNMP protocol support ],
[ default="no" ])
AC_ARG_ENABLE([xmlconf],
[ --enable-xmlconf : XML configuration support ],,
[ enable_xmlconf="no" ])
AM_CONDITIONAL(INSTALL_XMLCONF, test x$enable_xmlconf = xyes)
AC_ARG_ENABLE([qdevices],
[ --enable-qdevices : Quorum devices support ],,
[ enable_qdevices="no" ])
AM_CONDITIONAL(BUILD_QDEVICES, test x$enable_qdevices = xyes)
# OS detection
# THIS SECTION MUST DIE!
OS_LDL="-ldl"
have_linux="no"
case "$host_os" in
*linux*)
AC_DEFINE_UNQUOTED([COROSYNC_LINUX], [1],
[Compiling for Linux platform])
OS_CPPFLAGS="-D_GNU_SOURCE"
OS_LDFLAGS=""
OS_DYFLAGS="-rdynamic"
DARWIN_OPTS=""
have_linux="yes"
;;
darwin*)
AC_DEFINE_UNQUOTED([COROSYNC_DARWIN], [1],
[Compiling for Darwin platform])
OS_CPPFLAGS=""
OS_LDFLAGS=""
OS_DYFLAGS=""
DARWIN_OPTS="-dynamiclib -bind_at_load \
-current_version ${SONAME} \
-compatibility_version ${SONAME} -install_name \$(libdir)/\$(@)"
AC_DEFINE_UNQUOTED([MAP_ANONYMOUS], [MAP_ANON],
[Shared memory define for Darwin platform])
AC_DEFINE_UNQUOTED([PATH_MAX], [4096],
[Number of chars in a path name including nul])
AC_DEFINE_UNQUOTED([NAME_MAX], [255],
[Number of chars in a file name])
;;
*bsd*)
AC_DEFINE_UNQUOTED([COROSYNC_BSD], [1],
[Compiling for BSD platform])
AC_DEFINE_UNQUOTED([MAP_ANONYMOUS], [MAP_ANON],
[Shared memory define for Darwin platform])
OS_CPPFLAGS="-I/usr/local/include"
OS_LDFLAGS="-L/usr/local/lib"
OS_DYFLAGS="-export-dynamic"
DARWIN_OPTS=""
OS_LDL=""
case "$host_os" in
*freebsd[[234567]]*)
;;
*freebsd*)
AC_DEFINE_UNQUOTED([COROSYNC_FREEBSD_GE_8], [1],
[Compiling for FreeBSD >= 8 platform])
;;
esac
;;
*solaris*)
AC_DEFINE_UNQUOTED([COROSYNC_SOLARIS], [1],
[Compiling for Solaris platform])
AC_DEFINE_UNQUOTED([TS_CLASS], [1],
[Prevent being scheduled RR])
AC_DEFINE_UNQUOTED([_SEM_SEMUN_UNDEFINED], [1],
[The semun structure is undefined])
OS_CPPFLAGS="-D_REENTRANT"
OS_LDFLAGS=""
OS_DYFLAGS="-Wl,-z,lazyload"
DARWIN_OPTS=""
SOLARIS_OPTS=" "
;;
*)
AC_MSG_ERROR([Unsupported OS? hmmmm])
;;
esac
# *FLAGS handling goes here
ENV_CFLAGS="$CFLAGS"
ENV_CPPFLAGS="$CPPFLAGS"
ENV_LDFLAGS="$LDFLAGS"
# debug build stuff
if test "x${enable_debug}" = xyes; then
AC_DEFINE_UNQUOTED([DEBUG], [1], [Compiling Debugging code])
OPT_CFLAGS="-O0"
PACKAGE_FEATURES="$PACKAGE_FEATURES debug"
else
OPT_CFLAGS="-O3"
fi
# gdb flags
if test "x${GCC}" = xyes; then
GDB_FLAGS="-ggdb3"
else
GDB_FLAGS="-g"
fi
# Look for dbus-1
if test "x${enable_dbus}" = xyes; then
PKG_CHECK_MODULES([DBUS],[dbus-1])
AC_DEFINE_UNQUOTED([HAVE_DBUS], 1, [have dbus])
PACKAGE_FEATURES="$PACKAGE_FEATURES dbus"
fi
if test "x${enable_testagents}" = xyes; then
AC_DEFINE_UNQUOTED([HAVE_TESTAGENTS], 1, [have testagents])
PACKAGE_FEATURES="$PACKAGE_FEATURES testagents"
fi
if test "x${enable_rdma}" = xyes; then
PKG_CHECK_MODULES([rdmacm],[rdmacm])
PKG_CHECK_MODULES([ibverbs],[ibverbs])
AC_DEFINE_UNQUOTED([HAVE_RDMA], 1, [have rdmacm])
PACKAGE_FEATURES="$PACKAGE_FEATURES rdma"
fi
if test "x${enable_monitoring}" = xyes; then
AC_CHECK_LIB([statgrab], [sg_get_mem_stats], have_libstatgrab="yes", have_libstatgrab="no")
if test "x${have_libstatgrab}" = xyes; then
AC_DEFINE_UNQUOTED([HAVE_LIBSTATGRAB], 1, [have libstatgrab])
statgrab_LIBS="-lstatgrab"
else
if test "x${have_linux}" = xno; then
AC_MSG_ERROR(monitoring requires libstatgrab on non-linux systems)
fi
fi
AC_SUBST([statgrab_LIBS])
AC_DEFINE_UNQUOTED([HAVE_MONITORING], 1, [have resource monitoring])
PACKAGE_FEATURES="$PACKAGE_FEATURES monitoring"
fi
if test "x${enable_watchdog}" = xyes; then
AC_CHECK_HEADER(linux/watchdog.h,,AC_MSG_ERROR(watchdog requires linux/watchdog.h))
AC_CHECK_HEADER(linux/reboot.h,,AC_MSG_ERROR(watchdog requires linux/reboot.h))
AC_DEFINE_UNQUOTED([HAVE_WATCHDOG], 1, [have watchdog])
PACKAGE_FEATURES="$PACKAGE_FEATURES watchdog"
fi
if test "x${enable_augeas}" = xyes; then
PACKAGE_FEATURES="$PACKAGE_FEATURES augeas"
fi
if test "x${enable_systemd}" = xyes; then
PACKAGE_FEATURES="$PACKAGE_FEATURES systemd"
fi
if test "x${enable_xmlconf}" = xyes; then
PACKAGE_FEATURES="$PACKAGE_FEATURES xmlconf"
fi
if test "x${enable_qdevices}" = xyes; then
PACKAGE_FEATURES="$PACKAGE_FEATURES qdevices"
fi
if test "x${enable_snmp}" = xyes; then
SNMPCONFIG=""
AC_CHECK_HEADERS(net-snmp/net-snmp-config.h)
if test "x${ac_cv_header_net_snmp_net_snmp_config_h}" != "xyes"; then
enable_snmp=no
fi
if test $enable_snmp != no; then
AC_PATH_PROGS(SNMPCONFIG, net-snmp-config)
if test "X${SNMPCONFIG}" = "X"; then
AC_MSG_RESULT(You need the net_snmp development package to continue.)
enable_snmp=no
fi
fi
if test $enable_snmp != no; then
AC_MSG_CHECKING(for special snmp libraries)
SNMPLIBS=`$SNMPCONFIG --libs`
AC_MSG_RESULT($SNMPLIBS)
fi
if test $enable_snmp != no; then
savedLibs=$LIBS
LIBS="$LIBS $SNMPLIBS"
AC_CHECK_FUNCS(netsnmp_transport_open_client)
if test $ac_cv_func_netsnmp_transport_open_client != yes; then
AC_CHECK_FUNCS(netsnmp_tdomain_transport)
if test $ac_cv_func_netsnmp_tdomain_transport != yes; then
enable_snmp=no
fi
else
AC_DEFINE_UNQUOTED([NETSNMPV54], $NETSNMP_NEW_SUPPORT, [have net-snmp5.4 over])
fi
LIBS=$savedLibs
fi
AC_MSG_CHECKING(for snmp)
AC_MSG_RESULT($enable_snmp)
if test $enable_snmp = no; then
enable_snmp=0
AC_MSG_ERROR(Unable to support SNMP)
else
enable_snmp=1
PACKAGE_FEATURES="$PACKAGE_FEATURES snmp"
AC_DEFINE_UNQUOTED([ENABLE_SNMP], $enable_snmp, [Build in support for sending SNMP traps])
fi
else
enable_snmp=0
fi
AC_SUBST([SNMPLIBS])
AM_CONDITIONAL(BUILD_SNMP, test "${enable_snmp}" = "1")
# extra warnings
EXTRA_WARNINGS=""
WARNLIST="
all
shadow
missing-prototypes
missing-declarations
strict-prototypes
declaration-after-statement
pointer-arith
write-strings
cast-align
bad-function-cast
missing-format-attribute
format=2
format-security
format-nonliteral
no-long-long
unsigned-char
gnu89-inline
no-strict-aliasing
"
for j in $WARNLIST; do
if cc_supports_flag -W$j; then
EXTRA_WARNINGS="$EXTRA_WARNINGS -W$j";
fi
done
if test "x${enable_coverage}" = xyes && \
cc_supports_flag -ftest-coverage && \
cc_supports_flag -fprofile-arcs ; then
AC_MSG_NOTICE([Enabling Coverage (enable -O0 by default)])
OPT_CFLAGS="-O0"
COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
PACKAGE_FEATURES="$PACKAGE_FEATURES coverage"
else
COVERAGE_CFLAGS=""
COVERAGE_LDFLAGS=""
fi
if test "x${enable_small_memory_footprint}" = xyes ; then
AC_DEFINE_UNQUOTED([HAVE_SMALL_MEMORY_FOOTPRINT], 1, [have small_memory_footprint])
PACKAGE_FEATURES="$PACKAGE_FEATURES small-memory-footprint"
fi
if test "x${enable_ansi}" = xyes && \
cc_supports_flag -std=iso9899:199409 ; then
AC_MSG_NOTICE([Enabling ANSI Compatibility])
ANSI_CPPFLAGS="-ansi -D_GNU_SOURCE -DANSI_ONLY"
PACKAGE_FEATURES="$PACKAGE_FEATURES ansi"
else
ANSI_CPPFLAGS=""
fi
if test "x${enable_fatal_warnings}" = xyes && \
cc_supports_flag -Werror ; then
AC_MSG_NOTICE([Enabling Fatal Warnings (-Werror)])
WERROR_CFLAGS="-Werror"
PACKAGE_FEATURES="$PACKAGE_FEATURES fatal-warnings"
else
WERROR_CFLAGS=""
fi
# don't add addtional cflags
if test "x${enable_user_flags}" = xyes; then
OPT_CFLAGS=""
GDB_FLAGS=""
EXTRA_WARNINGS=""
fi
# final build of *FLAGS
CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS \
$COVERAGE_CFLAGS $EXTRA_WARNINGS $WERROR_CFLAGS $NSS_CFLAGS"
CPPFLAGS="$ENV_CPPFLAGS $ANSI_CPPFLAGS $OS_CPPFLAGS"
LDFLAGS="$ENV_LDFLAGS $COVERAGE_LDFLAGS $OS_LDFLAGS"
# substitute what we need:
+AC_SUBST([BASHPATH])
AC_SUBST([INITDDIR])
AC_SUBST([SYSTEMDDIR])
INITWRAPPERSDIR=$(eval echo ${INITWRAPPERSDIR})
AC_SUBST([INITWRAPPERSDIR])
AC_SUBST([SOMAJOR])
AC_SUBST([SOMINOR])
AC_SUBST([SOMICRO])
AC_SUBST([SONAME])
AC_SUBST([OS_DYFLAGS])
AC_SUBST([OS_LDL])
AM_CONDITIONAL(INSTALL_TESTAGENTS, test -n "${enable_testagents}")
AM_CONDITIONAL(INSTALL_MIB, test "${enable_snmp}" = "1")
AM_CONDITIONAL(INSTALL_DBUSCONF, test "${enable_dbus}" = "1")
AM_CONDITIONAL(AUGTOOL, test -n "${AUGTOOL}")
AC_SUBST([NSS_LDFLAGS])
AM_CONDITIONAL(BUILD_DARWIN, test -n "${DARWIN_OPTS}")
AM_CONDITIONAL(BUILD_SOLARIS, test -n "${SOLARIS_OPTS}")
AC_SUBST([DARWIN_OPTS])
AC_SUBST([SOLARIS_OPTS])
AM_CONDITIONAL(BUILD_HTML_DOCS, test -n "${GROFF}")
AC_SUBST([LINT_FLAGS])
AC_DEFINE_UNQUOTED([LOCALSTATEDIR], "$(eval echo ${localstatedir})", [localstate directory])
COROSYSCONFDIR=${sysconfdir}/corosync
AC_SUBST([COROSYSCONFDIR])
AC_DEFINE_UNQUOTED([COROSYSCONFDIR], "$(eval echo ${COROSYSCONFDIR})", [corosync config directory])
AC_DEFINE_UNQUOTED([PACKAGE_FEATURES], "${PACKAGE_FEATURES}", [corosync built-in features])
AC_OUTPUT
AC_MSG_RESULT([])
AC_MSG_RESULT([$PACKAGE configuration:])
AC_MSG_RESULT([ Version = ${VERSION}])
AC_MSG_RESULT([ Prefix = ${prefix}])
AC_MSG_RESULT([ Executables = ${sbindir}])
AC_MSG_RESULT([ Man pages = ${mandir}])
AC_MSG_RESULT([ Doc dir = ${docdir}])
AC_MSG_RESULT([ Libraries = ${libdir}])
AC_MSG_RESULT([ Header files = ${includedir}])
AC_MSG_RESULT([ Arch-independent files = ${datadir}])
AC_MSG_RESULT([ State information = ${localstatedir}])
AC_MSG_RESULT([ System configuration = ${sysconfdir}])
AC_MSG_RESULT([ System init.d directory = ${INITDDIR}])
AC_MSG_RESULT([ System systemd directory = ${SYSTEMDDIR}])
AC_MSG_RESULT([ System init wraps dir = ${INITWRAPPERSDIR}])
AC_MSG_RESULT([ corosync config dir = ${COROSYSCONFDIR}])
AC_MSG_RESULT([ Features =${PACKAGE_FEATURES}])
AC_MSG_RESULT([])
AC_MSG_RESULT([$PACKAGE build info:])
AC_MSG_RESULT([ Library SONAME = ${SONAME}])
LIB_MSG_RESULT(m4_shift(local_soname_list))dnl
AC_MSG_RESULT([ Default optimization = ${OPT_CFLAGS}])
AC_MSG_RESULT([ Default debug options = ${GDB_CFLAGS}])
AC_MSG_RESULT([ Extra compiler warnings = ${EXTRA_WARNING}])
AC_MSG_RESULT([ Env. defined CFLAG = ${ENV_CFLAGS}])
AC_MSG_RESULT([ Env. defined CPPFLAGS = ${ENV_CPPFLAGS}])
AC_MSG_RESULT([ Env. defined LDFLAGS = ${ENV_LDFLAGS}])
AC_MSG_RESULT([ OS defined CPPFLAGS = ${OS_CPPFLAGS}])
AC_MSG_RESULT([ OS defined LDFLAGS = ${OS_LDFLAGS}])
AC_MSG_RESULT([ OS defined LDL = ${OS_LDL}])
AC_MSG_RESULT([ OS defined DYFLAGS = ${OS_DYFLAGS}])
AC_MSG_RESULT([ ANSI defined CPPFLAGS = ${ANSI_CPPFLAGS}])
AC_MSG_RESULT([ Coverage CFLAGS = ${COVERAGE_CFLAGS}])
AC_MSG_RESULT([ Coverage LDFLAGS = ${COVERAGE_LDFLAGS}])
AC_MSG_RESULT([ Fatal War. CFLAGS = ${WERROR_CFLAGS}])
AC_MSG_RESULT([ Final CFLAGS = ${CFLAGS}])
AC_MSG_RESULT([ Final CPPFLAGS = ${CPPFLAGS}])
AC_MSG_RESULT([ Final LDFLAGS = ${LDFLAGS}])
diff --git a/cts/agents/Makefile.am b/cts/agents/Makefile.am
index 0edc4788..66038900 100644
--- a/cts/agents/Makefile.am
+++ b/cts/agents/Makefile.am
@@ -1,82 +1,96 @@
#
# Copyright (c) 2010 Red Hat, Inc.
#
# Authors: Angus Salkeld (asalkeld@redhat.com)
#
# This software licensed under BSD license, the text of which follows:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# - Neither the name of the MontaVista Software, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
MAINTAINERCLEANFILES = Makefile.in
+EXTRA_DIST = cmap-dispatch-deadlock.sh.in \
+ shm_leak_audit.sh.in
+
TEST_AGENTS = cpg_test_agent \
sam_test_agent \
votequorum_test_agent
SHELL_TESTS = mem_leak_test.sh \
net_breaker.sh \
cmap-dispatch-deadlock.sh \
shm_leak_audit.sh
noinst_HEADERS = common_test_agent.h
if INSTALL_TESTAGENTS
agentdir = $(datadir)/$(PACKAGE)/tests
bin_PROGRAMS = $(TEST_AGENTS)
dist_agent_SCRIPTS = $(SHELL_TESTS)
else
noinst_PROGRAMS = $(TEST_AGENTS)
noinst_SCRIPTS = $(SHELL_TESTS)
endif
+cmap-dispatch-deadlock.sh: cmap-dispatch-deadlock.sh.in
+ sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@
+ chmod 755 $@
+
+shm_leak_audit.sh: shm_leak_audit.sh.in
+ sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@
+ chmod 755 $@
+
AM_CPPFLAGS = -I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_builddir)/include/corosync
AM_CFLAGS = -fPIC
cpg_test_agent_SOURCES = cpg_test_agent.c common_test_agent.c
cpg_test_agent_CFLAGS = $(nss_CFLAGS)
cpg_test_agent_LDADD = $(LIBQB_LIBS) $(nss_LIBS) \
$(top_builddir)/lib/libcfg.la \
$(top_builddir)/lib/libcpg.la \
$(top_builddir)/common_lib/libcorosync_common.la
sam_test_agent_SOURCES = sam_test_agent.c common_test_agent.c
sam_test_agent_LDADD = $(LIBQB_LIBS) \
$(top_builddir)/lib/libsam.la \
$(top_builddir)/lib/libcmap.la \
$(top_builddir)/lib/libquorum.la \
$(top_builddir)/common_lib/libcorosync_common.la
votequorum_test_agent_SOURCES = votequorum_test_agent.c common_test_agent.c
votequorum_test_agent_LDADD = $(LIBQB_LIBS) \
$(top_builddir)/lib/libquorum.la \
$(top_builddir)/lib/libvotequorum.la \
$(top_builddir)/common_lib/libcorosync_common.la
+clean-local:
+ rm -f shm_leak_audit.sh cmap-dispatch-deadlock.sh
+
lint:
-splint $(LINT_FLAGS) $(CFLAGS) *.c
diff --git a/cts/agents/cmap-dispatch-deadlock.sh b/cts/agents/cmap-dispatch-deadlock.sh.in
similarity index 98%
rename from cts/agents/cmap-dispatch-deadlock.sh
rename to cts/agents/cmap-dispatch-deadlock.sh.in
index 1ccc5bd6..e5e45677 100644
--- a/cts/agents/cmap-dispatch-deadlock.sh
+++ b/cts/agents/cmap-dispatch-deadlock.sh.in
@@ -1,57 +1,57 @@
-#!/bin/bash
+#!@BASHPATH@
export TIMEOUT=600
export PID=$$
up_to=200
rec_plist() {
if [ "$2" == "" ];then
pl="`ps ax -o pid= -o ppid= -o comm=`"
else
pl=$2
fi
list=`echo "$pl" | egrep "^ *[0-9]+ +$1" | awk '{ print $1 }'`
tmplist=$list
for i in $tmplist;do
[ "$i" != "$1" ] && [ "$i" != "$$" ] && list="$list "`rec_plist $i "$pl"`
done
echo $list
}
rec_pkill() {
kill -9 `rec_plist "$1"` 2> /dev/null
}
exit_timeout() {
echo "ERR: Timeout. Test failed $PID"
rec_pkill "$$"
exit 1
}
corosync-cmapctl -s test.abd "str" "test" || exit 2
trap exit_timeout SIGUSR1
(sleep $TIMEOUT ; kill -SIGUSR1 $PID) &
wait_list=""
for e in {1..40};do
(for a in `seq 1 $up_to`;do corosync-cmapctl -s test.abd "str" $a ; done) &
wait_list="$wait_list $!"
done
notify_list=""
for i in {1..2};do
sleep 600000 | corosync-cmapctl -t test > /dev/null &
notify_list="$notify_list $!"
done
wait $wait_list
rec_pkill "$$"
echo "OK"
exit 0
diff --git a/cts/agents/shm_leak_audit.sh b/cts/agents/shm_leak_audit.sh.in
old mode 100755
new mode 100644
similarity index 98%
rename from cts/agents/shm_leak_audit.sh
rename to cts/agents/shm_leak_audit.sh.in
index ad6dc847..0272705e
--- a/cts/agents/shm_leak_audit.sh
+++ b/cts/agents/shm_leak_audit.sh.in
@@ -1,55 +1,55 @@
-#!/bin/bash
+#!@BASHPATH@
service corosync status >/dev/null
CS_STATUS=$?
if [ $CS_STATUS -eq 0 ]
then
# corosync running
active=$(corosync-cmapctl runtime.connections.active | cut -d= -f2)
if [ $active -lt 2 ]
then
FILES=$(ls /dev/shm/qb-*)
for f in $FILES
do
if [[ "$f" =~ "blackbox" ]]
then
true
else
echo $f
fi
done
else
pids=$(corosync-cmapctl runtime.connections. | grep client_pid | cut -d= -f2)
FILES=$(ls /dev/shm/qb-*)
for f in $FILES
do
found=0
for p in $pids
do
if [[ "$f" =~ "$p" ]]
then
found=1
elif [[ "$f" =~ "blackbox" ]]
then
found=1
fi
done
if [ $found -eq 0 ]
then
echo $f
fi
done
fi
else
FILES=$(ls /dev/shm/qb-*)
for f in $FILES
do
echo $f
done
fi
exit 0
diff --git a/init/Makefile.am b/init/Makefile.am
index 21d1e22b..804ad7cf 100644
--- a/init/Makefile.am
+++ b/init/Makefile.am
@@ -1,62 +1,63 @@
# Copyright (c) 2004 MontaVista Software, Inc.
# Copyright (c) 2009 Red Hat, Inc.
#
# Authors: Steven Dake (sdake@redhat.com)
# Fabio M. Di Nitto (fdinitto@redhat.com)
#
# All rights reserved.
#
# This software licensed under BSD license, the text of which follows:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# - Neither the name of the MontaVista Software, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = corosync.in corosync-notifyd.in corosync.service.in corosync-notifyd.service.in
if INSTALL_SYSTEMD
systemdconfdir = $(SYSTEMDDIR)
systemdconf_DATA = corosync.service corosync-notifyd.service
initscriptdir = $(INITWRAPPERSDIR)
else
initscriptdir = $(INITDDIR)
endif
initscript_SCRIPTS = corosync corosync-notifyd
%: %.in Makefile
rm -f $@-t $@
cat $< | sed \
-e 's#@''SBINDIR@#$(sbindir)#g' \
-e 's#@''SYSCONFDIR@#$(sysconfdir)#g' \
-e 's#@''INITDDIR@#$(INITDDIR)#g' \
-e 's#@''INITWRAPPERSDIR@#$(INITWRAPPERSDIR)#g' \
-e 's#@''LOCALSTATEDIR@#$(localstatedir)#g' \
+ -e 's#@''BASHPATH@#${BASHPATH}#g' \
> $@-t
mv $@-t $@
all-local: $(initscript_SCRIPTS) $(systemdconf_DATA)
clean-local:
rm -rf $(initscript_SCRIPTS) $(systemdconf_DATA)
diff --git a/init/corosync-notifyd.in b/init/corosync-notifyd.in
index 84de9aea..37118216 100755
--- a/init/corosync-notifyd.in
+++ b/init/corosync-notifyd.in
@@ -1,153 +1,153 @@
-#!/bin/bash
+#!@BASHPATH@
# Authors:
# Angus Salkeld <asalkeld@redhat.com>
#
# License: Revised BSD
# chkconfig: - 23 77
# description: Corosync Dbus and snmp notifier
# processname: corosync-notifyd
#
### BEGIN INIT INFO
# Provides: corosync-notifyd
# Required-Start: $corosync $cman
# Required-Stop: $corosync $cman
# Default-Start:
# Default-Stop:
# Short-Description: Starts and stops Corosync Notifier.
# Description: Starts and stops Corosync Notifier.
### END INIT INFO
desc="Corosync Notifier"
prog="corosync-notifyd"
# set secure PATH
PATH="/sbin:/bin:/usr/sbin:/usr/bin:@SBINDIR@"
success()
{
echo -ne "[ OK ]\r"
}
failure()
{
echo -ne "[FAILED]\r"
}
status()
{
pid=$(pidof $1 2>/dev/null)
rtrn=$?
if [ $rtrn -ne 0 ]; then
echo "$1 is stopped"
else
echo "$1 (pid $pid) is running..."
fi
return $rtrn
}
# rpm based distros
if [ -d @SYSCONFDIR@/sysconfig ]; then
[ -f @INITDDIR@/functions ] && . @INITDDIR@/functions
[ -f @SYSCONFDIR@/sysconfig/$prog ] && . @SYSCONFDIR@/sysconfig/$prog
[ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/subsys/$prog"
fi
# deb based distros
if [ -d @SYSCONFDIR@/default ]; then
[ -f @SYSCONFDIR@/default/$prog ] && . @SYSCONFDIR@/default/$prog
[ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/$prog"
fi
# The version of __pids_pidof in /etc/init.d/functions calls pidof with -x
# This means it matches scripts, including this one.
# Redefine it here so that status (from the same file) works.
# Otherwise simultaneous calls to stop() will loop forever
__pids_pidof() {
pidof -c -o $$ -o $PPID -o %PPID "$1" || \
pidof -c -o $$ -o $PPID -o %PPID "${1##*/}"
}
start()
{
echo -n "Starting $desc ($prog): "
# most recent distributions use tmpfs for @LOCALSTATEDIR@/run
# to avoid to clean it up on every boot.
# they also assume that init scripts will create
# required subdirectories for proper operations
mkdir -p @LOCALSTATEDIR@/run
if status $prog > /dev/null 2>&1; then
success
else
$prog $OPTIONS > /dev/null 2>&1
# give it time to fail
sleep 2
if status $prog > /dev/null 2>&1; then
touch $LOCK_FILE
success
else
failure
rtrn=1
fi
fi
echo
}
stop()
{
! status $prog > /dev/null 2>&1 && return
echo -n "Signaling $desc ($prog) to terminate: "
kill -TERM $(pidof $prog) > /dev/null 2>&1
success
echo
echo -n "Waiting for $prog services to unload:"
while status $prog > /dev/null 2>&1; do
sleep 1
echo -n "."
done
rm -f $LOCK_FILE
success
echo
}
restart()
{
stop
start
}
rtrn=0
case "$1" in
start)
start
;;
restart|reload|force-reload)
restart
;;
condrestart|try-restart)
if status $prog > /dev/null 2>&1; then
restart
fi
;;
status)
status $prog
rtrn=$?
;;
stop)
stop
;;
*)
echo "usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
rtrn=2
;;
esac
exit $rtrn
diff --git a/init/corosync.in b/init/corosync.in
index a9840bd9..cfd51f2b 100755
--- a/init/corosync.in
+++ b/init/corosync.in
@@ -1,178 +1,178 @@
-#!/bin/bash
+#!@BASHPATH@
# Authors:
# Andrew Beekhof <abeekhof@redhat.com>
# Fabio M. Di Nitto <fdinitto@redhat.com>
#
# License: Revised BSD
# chkconfig: - 20 80
# description: Corosync Cluster Engine
# processname: corosync
#
### BEGIN INIT INFO
# Provides: corosync
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start:
# Default-Stop:
# Short-Description: Starts and stops Corosync Cluster Engine.
# Description: Starts and stops Corosync Cluster Engine.
### END INIT INFO
desc="Corosync Cluster Engine"
prog="corosync"
# set secure PATH
PATH="/sbin:/bin:/usr/sbin:/usr/bin:@SBINDIR@"
success()
{
echo -ne "[ OK ]\r"
}
failure()
{
echo -ne "[FAILED]\r"
}
status()
{
pid=$(pidof $1 2>/dev/null)
rtrn=$?
if [ $rtrn -ne 0 ]; then
echo "$1 is stopped"
else
echo "$1 (pid $pid) is running..."
fi
return $rtrn
}
# rpm based distros
if [ -d @SYSCONFDIR@/sysconfig ]; then
[ -f @INITDDIR@/functions ] && . @INITDDIR@/functions
[ -f @SYSCONFDIR@/sysconfig/$prog ] && . @SYSCONFDIR@/sysconfig/$prog
[ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/subsys/$prog"
fi
# deb based distros
if [ -d @SYSCONFDIR@/default ]; then
[ -f @SYSCONFDIR@/default/$prog ] && . @SYSCONFDIR@/default/$prog
[ -z "$LOCK_FILE" ] && LOCK_FILE="@LOCALSTATEDIR@/lock/$prog"
fi
# The version of __pids_pidof in /etc/init.d/functions calls pidof with -x
# This means it matches scripts, including this one.
# Redefine it here so that status (from the same file) works.
# Otherwise simultaneous calls to stop() will loop forever
__pids_pidof() {
pidof -c -o $$ -o $PPID -o %PPID "$1" || \
pidof -c -o $$ -o $PPID -o %PPID "${1##*/}"
}
cluster_disabled_at_boot()
{
if grep -q nocluster /proc/cmdline && \
[ "$(tty)" = "/dev/console" ]; then
echo -e "not configured to run at boot"
failure
return 1
fi
return 0
}
wait_for_ipc()
{
try=0
while [ "$try" -le "20" ]; do
if corosync-cfgtool -s > /dev/null 2>&1; then
return 0
fi
sleep 0.5
try=$((try + 1))
done
return 1
}
start()
{
echo -n "Starting $desc ($prog): "
! cluster_disabled_at_boot && return
# most recent distributions use tmpfs for @LOCALSTATEDIR@/run
# to avoid to clean it up on every boot.
# they also assume that init scripts will create
# required subdirectories for proper operations
mkdir -p @LOCALSTATEDIR@/run
if status $prog > /dev/null 2>&1; then
success
else
$prog > /dev/null 2>&1
if ! wait_for_ipc; then
failure
rtrn=1
fi
touch $LOCK_FILE
success
fi
echo
}
stop()
{
! status $prog > /dev/null 2>&1 && return
echo -n "Signaling $desc ($prog) to terminate: "
kill -TERM $(pidof $prog) > /dev/null 2>&1
success
echo
echo -n "Waiting for $prog services to unload:"
while status $prog > /dev/null 2>&1; do
sleep 1
echo -n "."
done
rm -f $LOCK_FILE
success
echo
}
restart()
{
stop
start
}
rtrn=0
case "$1" in
start)
start
;;
restart|reload|force-reload)
restart
;;
condrestart|try-restart)
if status $prog > /dev/null 2>&1; then
restart
fi
;;
status)
status $prog
rtrn=$?
;;
stop)
stop
;;
*)
echo "usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
rtrn=2
;;
esac
exit $rtrn
diff --git a/test/Makefile.am b/test/Makefile.am
index a7c3c63e..777a1f0e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,77 +1,77 @@
#
# Copyright (c) 2009 Red Hat, Inc.
#
# Authors: Andrew Beekhof
# Steven Dake (sdake@redhat.com)
#
# This software licensed under BSD license, the text of which follows:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# - Neither the name of the MontaVista Software, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = ploadstart.sh
noinst_PROGRAMS = cpgverify testcpg testcpg2 cpgbench \
testquorum testvotequorum1 testvotequorum2 \
stress_cpgfdget stress_cpgcontext cpgbound testsam \
testcpgzc cpgbenchzc testzcgc stress_cpgzc
noinst_SCRIPTS = ploadstart
AM_CPPFLAGS = -I$(top_builddir)/include/corosync \
-I$(top_srcdir)/include \
$(nss_CFLAGS)
AM_CFLAGS = -fPIC
testcpg_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
testcpg2_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
testcpgzc_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
testzcgc_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
stress_cpgzc_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
stress_cpgfdget_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
stress_cpgcontext_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
testquorum_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libquorum.la
testvotequorum1_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libvotequorum.la
testvotequorum2_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libvotequorum.la
cpgverify_LDADD = $(LIBQB_LIBS) $(nss_LIBS) $(top_builddir)/lib/libcpg.la
cpgbound_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
cpgbench_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
cpgbenchzc_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
testsam_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libsam.la
ploadstart: ploadstart.sh
- cp $^ $@
+ sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@
chmod 755 $@
LINT_FILES1:=$(filter-out sa_error.c, $(wildcard *.c))
LINT_FILES:=$(filter-out testparse.c, $(LINT_FILES1))
lint:
-for f in $(LINT_FILES) ; do echo Splint $$f ; splint $(AM_CPPFLAGS) $(LINT_FLAGS) $(CFLAGS) $$f ; done
clean-local:
rm -f ploadstart
diff --git a/test/ploadstart.sh b/test/ploadstart.sh
index 7bd7c9d9..bea065b8 100644
--- a/test/ploadstart.sh
+++ b/test/ploadstart.sh
@@ -1,60 +1,60 @@
-#!/bin/bash
+#!@BASHPATH@
set -e
msg_count=""
msg_size=""
usage() {
echo "ploadstart [options]"
echo ""
echo "Options:"
echo " -c msg_count Number of messages to send (max UINT32_T default 1500000)"
echo " -s msg_size Size of messages in bytes (max 1000000 default 300)"
echo " -h display this help"
}
while getopts "hs:c:" optflag; do
case "$optflag" in
h)
usage
exit 0
;;
c)
msg_count="$OPTARG"
;;
s)
msg_size="$OPTARG"
;;
\?|:)
usage
exit 1
;;
esac
done
[ -n "$msg_count" ] && corosync-cmapctl -s pload.count u32 $msg_count
[ -n "$msg_size" ] && corosync-cmapctl -s pload.size u32 $msg_size
echo "***** WARNING *****"
echo ""
echo "Running pload test will kill your cluster and all corosync daemons will exit"
echo "at the end of the load test"
echo ""
echo "***** END OF WARNING *****"
echo ""
echo "YOU HAVE BEEN WARNED"
echo ""
echo "If you agree, and want to proceed, please type:"
echo "Yes, I fully understand the risks of what I am doing"
echo ""
read -p "type here: " ans
[ "$ans" = "Yes, I fully understand the risks of what I am doing" ] || {
echo "Wise choice.. or you simply didn't type it right"
exit 0
}
corosync-cmapctl -s pload.start str i_totally_understand_pload_will_crash_my_cluster_and_kill_corosync_on_exit
echo "PLOAD started, please see corosync.log for final results"
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 6abc972b..e9945167 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,82 +1,84 @@
# Copyright (c) 2009 Red Hat, Inc.
#
# Authors: Andrew Beekhof
# Steven Dake (sdake@redhat.com)
#
# This software licensed under BSD license, the text of which follows:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# - Neither the name of the MontaVista Software, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
MAINTAINERCLEANFILES = Makefile.in
sbin_PROGRAMS = corosync-cfgtool \
corosync-keygen \
corosync-cpgtool corosync-quorumtool \
corosync-notifyd corosync-cmapctl
bin_SCRIPTS = corosync-blackbox
if INSTALL_XMLCONF
bin_SCRIPTS += corosync-xmlproc
endif
EXTRA_DIST = $(bin_SCRIPTS) corosync-xmlproc.sh \
corosync-notifyd.sysconfig.example \
corosync-blackbox.sh
corosync-xmlproc: corosync-xmlproc.sh
- sed -e 's#@''DATADIR@#${datadir}#g' $< > $@
+ sed -e 's#@''DATADIR@#${datadir}#g' \
+ -e 's#@''BASHPATH@#${BASHPATH}#g' \
+ $< > $@
corosync-blackbox: corosync-blackbox.sh
sed -e 's#@''LOCALSTATEDIR@#${localstatedir}#g' $< > $@
AM_CPPFLAGS = -I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_builddir)/include/corosync \
$(DBUS_CFLAGS)
corosync_cmapctl_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcmap.la
corosync_cfgtool_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcfg.la
corosync_cpgtool_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcfg.la \
$(top_builddir)/lib/libcpg.la
corosync_quorumtool_LDADD = $(LIBQB_LIBS) \
$(top_builddir)/lib/libcmap.la \
$(top_builddir)/lib/libcfg.la \
$(top_builddir)/lib/libquorum.la \
$(top_builddir)/lib/libvotequorum.la
corosync_notifyd_LDADD = $(LIBQB_LIBS) $(DBUS_LIBS) $(SNMPLIBS) \
$(top_builddir)/lib/libcmap.la \
$(top_builddir)/lib/libcfg.la \
$(top_builddir)/lib/libquorum.la
lint:
-splint $(LINT_FLAGS) $(DBUS_CFLAGS) $(AM_CPPFLAGS) $(CFLAGS) *.c
clean-local:
rm -f corosync-xmlproc corosync-blackbox
diff --git a/tools/corosync-xmlproc.sh b/tools/corosync-xmlproc.sh
index d6b24aa6..c098958f 100644
--- a/tools/corosync-xmlproc.sh
+++ b/tools/corosync-xmlproc.sh
@@ -1,57 +1,57 @@
-#!/bin/bash
+#!@BASHPATH@
# Copyright (c) 2011 Red Hat, Inc.
#
# All rights reserved.
#
# Author: Jan Friesse (jfriesse@redhat.com)
#
# This software licensed under BSD license, the text of which follows:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# - Neither the name of the Red Hat, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
XSLT_PROC=xsltproc
usage() {
echo "$0 input_config [output]"
echo " where input_config is valid XML configuration file"
exit 1
}
[ "$1" == "" ] && usage
$XSLT_PROC -V >/dev/null 2>&1
if [ "$?" != 0 ];then
echo "Can't find xslt processor $XSLT_PROC"
exit 2
fi
# TODO:
# Validation should occur before actual processing
[ "$2" != "" ] && out_param="-o $2"
$XSLT_PROC --stringparam inputfile "$1" $out_param @DATADIR@/corosync/xml2conf.xsl "$1"

File Metadata

Mime Type
text/x-diff
Expires
Wed, Feb 26, 11:09 PM (8 h, 51 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1465864
Default Alt Text
(47 KB)

Event Timeline