diff --git a/configure.ac b/configure.ac index 2bbd79eac9..32b7c78ebc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,1496 +1,1497 @@ dnl dnl autoconf for Pacemaker dnl dnl License: GNU General Public License (GPL) dnl =============================================== dnl Bootstrap dnl =============================================== AC_PREREQ(2.53) dnl Suggested structure: dnl information on the package dnl checks for programs dnl checks for libraries dnl checks for header files dnl checks for types dnl checks for structures dnl checks for compiler characteristics dnl checks for library functions dnl checks for system services AC_INIT(pacemaker, 1.1.1, pacemaker@oss.clusterlabs.org) CRM_DTD_VERSION="1.2" PKG_FEATURES="" HB_PKG=heartbeat AC_CONFIG_AUX_DIR(.) AC_CANONICAL_HOST dnl Where #defines go (e.g. `AC_CHECK_HEADERS' below) dnl dnl Internal header: include/config.h dnl - Contains ALL defines dnl - include/config.h.in is generated automatically by autoheader dnl - NOT to be included in any header files except lha_internal.h dnl (which is also not to be included in any other header files) dnl dnl External header: include/crm_config.h dnl - Contains a subset of defines checked here dnl - Manually edit include/crm_config.h.in to have configure include dnl new defines dnl - Should not include HAVE_* defines dnl - Safe to include anywhere AM_CONFIG_HEADER(include/config.h include/crm_config.h) ALL_LINGUAS="en fr" AC_ARG_WITH(version, [ --with-version=version Override package version (if you're a packager needing to pretend) ], [ PACKAGE_VERSION="$withval" ]) AC_ARG_WITH(pkg-name, [ --with-pkg-name=name Override package name (if you're a packager needing to pretend) ], [ PACKAGE_NAME="$withval" ]) AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION) AC_DEFINE_UNQUOTED(PACEMAKER_VERSION, "$PACKAGE_VERSION", Current pacemaker version) dnl automake >= 1.11 offers --enable-silent-rules for suppressing the output from dnl normal compilation. When a failure occurs, it will then display the full dnl command line dnl Wrap in m4_ifdef to avoid breaking on older platforms m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) CC_IN_CONFIGURE=yes export CC_IN_CONFIGURE LDD=ldd dnl ======================================================================== dnl Compiler characteristics dnl ======================================================================== AC_PROG_CC dnl Can force other with environment variable "CC". AM_PROG_CC_C_O AC_PROG_CC_STDC AC_LIBTOOL_DLOPEN dnl Enable dlopen support... AC_LIBLTDL_CONVENIENCE dnl make libltdl a convenience lib AC_PROG_LIBTOOL AC_C_STRINGIZE AC_TYPE_SIZE_T AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) AC_STRUCT_TIMEZONE dnl =============================================== dnl Helpers dnl =============================================== cc_supports_flag() { local CFLAGS="$@" AC_MSG_CHECKING(whether $CC supports "$@") AC_COMPILE_IFELSE([int main(){return 0;}] ,[RC=0; AC_MSG_RESULT(yes)],[RC=1; AC_MSG_RESULT(no)]) return $RC } extract_header_define() { AC_MSG_CHECKING(for $2 in $1) Cfile=/tmp/extract_define.$2.${$} printf "#include \n" > ${Cfile}.c printf "#include <%s>\n" $1 >> ${Cfile}.c printf "int main(int argc, char **argv) { printf(\"%%s\", %s); return 0; }\n" $2 >> ${Cfile}.c $CC $CFLAGS ${Cfile}.c -o ${Cfile} value=`${Cfile}` AC_MSG_RESULT($value) printf $value rm -f ${Cfile}.c ${Cfile} } dnl =============================================== dnl Configure Options dnl =============================================== dnl Some systems, like Solaris require a custom package name AC_ARG_WITH(pkgname, [ --with-pkgname=name name for pkg (typically for Solaris) ], [ PKGNAME="$withval" ], [ PKGNAME="LXHAhb" ], ) AC_SUBST(PKGNAME) AC_ARG_ENABLE([ansi], [ --enable-ansi force GCC to compile to ANSI/ANSI standard for older compilers. [default=yes]]) AC_ARG_ENABLE([fatal-warnings], [ --enable-fatal-warnings very pedantic and fatal warnings for gcc [default=yes]]) AC_ARG_ENABLE([pretty], [ --enable-pretty Pretty-print compiler output unless there is an error [default=no]]) AC_ARG_ENABLE([quiet], [ --enable-quiet Supress make output unless there is an error [default=no]]) AC_ARG_ENABLE([thread-safe], [ --enable-thread-safe Enable some client libraries to be thread safe. [default=no]]) AC_ARG_ENABLE([bundled-ltdl], [ --enable-bundled-ltdl Configure, build and install the standalone ltdl library bundled with ${PACKAGE} [default=no]]) LTDL_LIBS="" AC_ARG_WITH(ais, [ --with-ais Support the OpenAIS messaging and membership layer ], [ SUPPORT_AIS=$withval ], [ SUPPORT_AIS=try ], ) AC_ARG_WITH(heartbeat, [ --with-heartbeat Support the Heartbeat messaging and membership layer ], [ SUPPORT_HEARTBEAT=$withval ], [ SUPPORT_HEARTBEAT=try ], ) AC_ARG_WITH(snmp, [ --with-snmp Support the SNMP protocol ], [ SUPPORT_SNMP=$withval ], [ SUPPORT_SNMP=try ], ) AC_ARG_WITH(esmtp, [ --with-esmtp Support the sending mail notifications with the esmtp library ], [ SUPPORT_ESMTP=$withval ], [ SUPPORT_ESMTP=try ], ) AISPREFIX="" AC_ARG_WITH(ais-prefix, [ --with-ais-prefix=DIR Prefix used when OpenAIS was installed [$prefix]], [ AISPREFIX=$withval ], [ AISPREFIX=$prefix ]) LCRSODIR="" AC_ARG_WITH(lcrso-dir, [ --with-lcrso-dir=DIR OpenAIS lcrso files. ], [ LCRSODIR="$withval" ]) INITDIR="" AC_ARG_WITH(initdir, [ --with-initdir=DIR directory for init (rc) scripts [${INITDIR}]], [ INITDIR="$withval" ]) dnl =============================================== dnl General Processing dnl =============================================== AC_SUBST(HB_PKG) INIT_EXT="" echo Our Host OS: $host_os/$host AC_MSG_NOTICE(Sanitizing prefix: ${prefix}) case $prefix in NONE) prefix=/usr;; esac AC_MSG_NOTICE(Sanitizing exec_prefix: ${exec_prefix}) case $exec_prefix in dnl For consistency with Heartbeat, map NONE->$prefix NONE) exec_prefix=$prefix;; prefix) exec_prefix=$prefix;; esac AC_MSG_NOTICE(Sanitizing ais_prefix: ${AISPREFIX}) case $AISPREFIX in dnl For consistency with Heartbeat, map NONE->$prefix NONE) AISPREFIX=$prefix;; prefix) AISPREFIX=$prefix;; esac AC_MSG_NOTICE(Sanitizing INITDIR: ${INITDIR}) case $INITDIR in prefix) INITDIR=$prefix;; "") AC_MSG_CHECKING(which init (rc) directory to use) for initdir in /etc/init.d /etc/rc.d/init.d /sbin/init.d \ /usr/local/etc/rc.d /etc/rc.d do if test -d $initdir then INITDIR=$initdir break fi done AC_MSG_RESULT($INITDIR);; esac AC_SUBST(INITDIR) AC_MSG_NOTICE(Sanitizing libdir: ${libdir}) case $libdir in dnl For consistency with Heartbeat, map NONE->$prefix *prefix*|NONE) AC_MSG_CHECKING(which lib directory to use) for aDir in lib64 lib do trydir="${exec_prefix}/${aDir}" if test -d ${trydir} then libdir=${trydir} break fi done AC_MSG_RESULT($libdir); ;; esac dnl Expand autoconf variables so that we dont end up with '${prefix}' dnl in #defines and python scripts dnl NOTE: Autoconf deliberately leaves them unexpanded to allow dnl make exec_prefix=/foo install dnl No longer being able to do this seems like no great loss to me... eval prefix="`eval echo ${prefix}`" eval exec_prefix="`eval echo ${exec_prefix}`" eval bindir="`eval echo ${bindir}`" eval sbindir="`eval echo ${sbindir}`" eval libexecdir="`eval echo ${libexecdir}`" eval datadir="`eval echo ${datadir}`" eval sysconfdir="`eval echo ${sysconfdir}`" eval sharedstatedir="`eval echo ${sharedstatedir}`" eval localstatedir="`eval echo ${localstatedir}`" eval libdir="`eval echo ${libdir}`" eval includedir="`eval echo ${includedir}`" eval oldincludedir="`eval echo ${oldincludedir}`" eval infodir="`eval echo ${infodir}`" eval mandir="`eval echo ${mandir}`" dnl Home-grown variables eval INITDIR="${INITDIR}" eval docdir="`eval echo ${docdir}`" if test x"${docdir}" = x""; then docdir=${datadir}/doc/${PACKAGE}-${VERSION} #docdir=${datadir}/doc/packages/${PACKAGE} fi AC_SUBST(docdir) for j in prefix exec_prefix bindir sbindir libexecdir datadir sysconfdir \ sharedstatedir localstatedir libdir includedir oldincludedir infodir \ mandir INITDIR docdir do dirname=`eval echo '${'${j}'}'` if test ! -d "$dirname" then AC_MSG_WARN([$j directory ($dirname) does not exist!]) fi done dnl This OS-based decision-making is poor autotools practice; dnl feature-based mechanisms are strongly preferred. dnl dnl So keep this section to a bare minimum; regard as a "necessary evil". case "$host_os" in *bsd*) LIBS="-L/usr/local/lib" CPPFLAGS="$CPPFLAGS -I/usr/local/include" INIT_EXT=".sh" ;; *solaris*) ;; *linux*) AC_DEFINE_UNQUOTED(ON_LINUX, 1, Compiling for Linux platform) CFLAGS="$CFLAGS -I${prefix}/include" ;; darwin*) AC_DEFINE_UNQUOTED(ON_DARWIN, 1, Compiling for Darwin platform) LIBS="$LIBS -L${prefix}/lib" CFLAGS="$CFLAGS -I${prefix}/include" ;; esac dnl Eventually remove this CFLAGS="$CFLAGS -I${prefix}/include/heartbeat" AC_SUBST(INIT_EXT) AC_DEFINE_UNQUOTED(HA_LOG_FACILITY, LOG_DAEMON, Default logging facility) AC_MSG_NOTICE(Host CPU: $host_cpu) case "$host_cpu" in ppc64|powerpc64) case $CFLAGS in *powerpc64*) ;; *) if test "$GCC" = yes; then CFLAGS="$CFLAGS -m64" fi ;; esac esac AC_MSG_CHECKING(which format is needed to print uint64_t) ac_save_CFLAGS=$CFLAGS CFLAGS="-Wall -Werror" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [ #include #include #include ], [ int max = 512; uint64_t bignum = 42; char *buffer = malloc(max); const char *random = "random"; snprintf(buffer, max-1, "", bignum, random); fprintf(stderr, "Result: %s\n", buffer); ] )], [U64T="%lu"], [U64T="%llu"] ) CFLAGS=$ac_save_CFLAGS AC_MSG_RESULT($U64T) AC_DEFINE_UNQUOTED(U64T, "$U64T", Correct printf format for logging uint64_t) AC_CHECK_HEADERS(hb_config.h) AC_CHECK_HEADERS(glue_config.h) GLUE_HEADER=none if test "$ac_cv_header_glue_config_h" = "yes"; then GLUE_HEADER=glue_config.h elif test "$ac_cv_header_hb_config_h" = "yes"; then GLUE_HEADER=hb_config.h else AC_MSG_FAILURE(Core development headers were not found) fi dnl Variables needed for substitution CRM_DTD_DIRECTORY="${datadir}/pacemaker" AC_DEFINE_UNQUOTED(CRM_DTD_DIRECTORY,"$CRM_DTD_DIRECTORY", Location for the Pacemaker Relax-NG Schema) AC_SUBST(CRM_DTD_DIRECTORY) AC_DEFINE_UNQUOTED(CRM_DTD_VERSION,"$CRM_DTD_VERSION", Current version of the Pacemaker Relax-NG Schema) AC_SUBST(CRM_DTD_VERSION) CRM_DAEMON_USER=`extract_header_define $GLUE_HEADER HA_CCMUSER` AC_DEFINE_UNQUOTED(CRM_DAEMON_USER,"$CRM_DAEMON_USER", User to run Pacemaker daemons as) AC_SUBST(CRM_DAEMON_USER) CRM_DAEMON_GROUP=`extract_header_define $GLUE_HEADER HA_APIGROUP` AC_DEFINE_UNQUOTED(CRM_DAEMON_GROUP,"$CRM_DAEMON_GROUP", Group to run Pacemaker daemons as) AC_SUBST(CRM_DAEMON_GROUP) CRM_STATE_DIR=${localstatedir}/run/crm AC_DEFINE_UNQUOTED(CRM_STATE_DIR,"$CRM_STATE_DIR", Where to keep state files and sockets) AC_SUBST(CRM_STATE_DIR) PE_STATE_DIR="${localstatedir}/lib/pengine" AC_DEFINE_UNQUOTED(PE_STATE_DIR,"$PE_STATE_DIR", Where to keep PEngine outputs) AC_SUBST(PE_STATE_DIR) dnl Eventually move out of the heartbeat dir tree and create compatability code CRM_CONFIG_DIR="${localstatedir}/lib/heartbeat/crm" AC_DEFINE_UNQUOTED(CRM_CONFIG_DIR,"$CRM_CONFIG_DIR", Where to keep CIB configuration files) AC_SUBST(CRM_CONFIG_DIR) dnl Eventually move out of the heartbeat dir tree and create symlinks when needed CRM_DAEMON_DIR=`extract_header_define $GLUE_HEADER HA_LIBHBDIR` AC_DEFINE_UNQUOTED(CRM_DAEMON_DIR,"$CRM_DAEMON_DIR", Location for Pacemaker daemons) AC_SUBST(CRM_DAEMON_DIR) dnl Needed so that the AIS plugin can clear out the directory as Heartbeat does HA_STATE_DIR=`extract_header_define $GLUE_HEADER HA_VARRUNDIR` AC_DEFINE_UNQUOTED(HA_STATE_DIR,"$HA_STATE_DIR", Where Heartbeat keeps state files and sockets) AC_SUBST(HA_STATE_DIR) dnl Needed for the location of hostcache in CTS.py HA_VARLIBHBDIR=`extract_header_define $GLUE_HEADER HA_VARLIBHBDIR` AC_SUBST(HA_VARLIBHBDIR) AC_DEFINE_UNQUOTED(UUID_FILE,"$localstatedir/lib/heartbeat/hb_uuid", Location of Heartbeat's UUID file) OCF_ROOT_DIR=`extract_header_define $GLUE_HEADER OCF_ROOT_DIR` if test "X$OCF_ROOT_DIR" = X; then AC_MSG_ERROR(Could not locate OCF directory) fi AC_SUBST(OCF_ROOT_DIR) OCF_RA_DIR=`extract_header_define $GLUE_HEADER OCF_RA_DIR` AC_DEFINE_UNQUOTED(OCF_RA_DIR,"$OCF_RA_DIR", Location for OCF RAs) AC_SUBST(OCF_RA_DIR) dnl Extract this value from glue_config.h once we no longer support anything else STONITH_PLUGIN_DIR="$libdir/stonith/plugins/stonith/" AC_DEFINE_UNQUOTED(STONITH_PLUGIN_DIR,"$STONITH_PLUGIN_DIR", Location for Stonith plugins) AC_SUBST(STONITH_PLUGIN_DIR) RH_STONITH_DIR="$sbindir" AC_DEFINE_UNQUOTED(RH_STONITH_DIR,"$RH_STONITH_DIR", Location for Red Hat Stonith agents) RH_STONITH_PREFIX="fence_" AC_DEFINE_UNQUOTED(RH_STONITH_PREFIX,"$RH_STONITH_PREFIX", Prefix for Red Hat Stonith agents) AC_PATH_PROGS(HG, hg false) AC_MSG_CHECKING(build version) BUILD_VERSION=unknown if test -f $srcdir/.hg_archival.txt; then BUILD_VERSION=`cat $srcdir/.hg_archival.txt | awk '/node:/ { print $2 }'` elif test -x $HG -a -d .hg; then BUILD_VERSION=`$HG id -itb` if test $? != 0; then BUILD_VERSION=unknown fi fi AC_DEFINE_UNQUOTED(BUILD_VERSION, "$BUILD_VERSION", Build version) AC_MSG_RESULT($BUILD_VERSION) AC_SUBST(BUILD_VERSION) dnl =============================================== dnl Program Paths dnl =============================================== PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin" export PATH dnl Replacing AC_PROG_LIBTOOL with AC_CHECK_PROG because LIBTOOL dnl was NOT being expanded all the time thus causing things to fail. AC_CHECK_PROGS(LIBTOOL, glibtool libtool libtool15 libtool13) AM_PATH_PYTHON AC_CHECK_PROGS(MAKE, gmake make) AC_PATH_PROGS(HTML2TXT, lynx w3m) AC_PATH_PROGS(HELP2MAN, help2man) AC_PATH_PROGS(POD2MAN, pod2man, pod2man) AC_PATH_PROGS(ASCIIDOC, asciidoc) AC_PATH_PROGS(PUBLICAN, publican) AC_PATH_PROGS(FOP, fop) AC_PATH_PROGS(SSH, ssh, /usr/bin/ssh) AC_PATH_PROGS(SCP, scp, /usr/bin/scp) AC_PATH_PROGS(HG, hg, /bin/false) AC_PATH_PROGS(TAR, tar) AC_PATH_PROGS(MD5, md5) AC_PATH_PROGS(TEST, test) AC_PATH_PROGS(PKGCONFIG, pkg-config) AC_PATH_PROGS(XML2CONFIG, xml2-config) AC_PATH_PROGS(VALGRIND_BIN, valgrind, /usr/bin/valgrind) AC_DEFINE_UNQUOTED(VALGRIND_BIN, "$VALGRIND_BIN", Valgrind command) if test x"${LIBTOOL}" = x""; then AC_MSG_ERROR(You need (g)libtool installed in order to build ${PACKAGE}) fi if test x"${MAKE}" = x""; then AC_MSG_ERROR(You need (g)make installed in order to build ${PACKAGE}) fi AM_CONDITIONAL(BUILD_HELP, test x"${HELP2MAN}" != x"") if test x"${HELP2MAN}" != x""; then PKG_FEATURES="$PKG_FEATURES manpages" fi AM_CONDITIONAL(BUILD_ASCIIDOC, test x"${ASCIIDOC}" != x"") if test x"${ASCIIDOC}" != x""; then PKG_FEATURES="$PKG_FEATURES asciidoc" fi AM_CONDITIONAL(BUILD_DOCBOOK, test ${PUBLICAN} != x"") if test ${PUBLICAN} != x""; then PKG_FEATURES="$PKG_FEATURES publican" fi dnl =============================================== dnl Libraries dnl =============================================== AC_CHECK_LIB(socket, socket) dnl -lsocket AC_CHECK_LIB(c, dlopen) dnl if dlopen is in libc... AC_CHECK_LIB(dl, dlopen) dnl -ldl (for Linux) AC_CHECK_LIB(rt, sched_getscheduler) dnl -lrt (for Tru64) AC_CHECK_LIB(gnugetopt, getopt_long) dnl -lgnugetopt ( if available ) AC_CHECK_LIB(pam, pam_start) dnl -lpam (if available) AC_CHECK_LIB(uuid, uuid_parse) dnl e2fsprogs AC_CHECK_LIB(uuid, uuid_create) dnl ossp if test x"${PKGCONFIG}" = x""; then AC_MSG_ERROR(You need pkgconfig installed in order to build ${PACKAGE}) fi dnl dnl On many systems libcrypto is needed when linking against libsnmp. dnl Check to see if it exists, and if so use it. dnl AC_CHECK_LIB(crypto, CRYPTO_free, CRYPTOLIB="-lcrypto",) AC_SUBST(CRYPTOLIB) if test "x${enable_thread_safe}" = "xyes"; then GPKGNAME="gthread-2.0" else GPKGNAME="glib-2.0" fi if $PKGCONFIG --exists $GPKGNAME then GLIBCONFIG="$PKGCONFIG $GPKGNAME" else set -x echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH $PKGCONFIG --exists $GPKGNAME; echo $? $PKGCONFIG --cflags $GPKGNAME; echo $? $PKGCONFIG $GPKGNAME; echo $? set +x AC_MSG_ERROR(You need glib2-devel installed in order to build ${PACKAGE}) fi AC_MSG_RESULT(using $GLIBCONFIG) # # Where is dlopen? # if test "$ac_cv_lib_c_dlopen" = yes; then LIBADD_DL="" elif test "$ac_cv_lib_dl_dlopen" = yes; then LIBADD_DL=-ldl else LIBADD_DL=${lt_cv_dlopen_libs} fi dnl dnl Check for location of gettext dnl dnl On at least Solaris 2.x, where it is in libc, specifying lintl causes dnl grief. Ensure minimal result, not the sum of all possibilities. dnl And do libc first. dnl Known examples: dnl c: Linux, Solaris 2.6+ dnl intl: BSD, AIX AC_CHECK_LIB(c, gettext) if test x$ac_cv_lib_c_gettext != xyes; then AC_CHECK_LIB(intl, gettext) fi if test x$ac_cv_lib_c_gettext != xyes -a x$ac_cv_lib_intl_gettext != xyes; then AC_MSG_ERROR(You need gettext installed in order to build ${PACKAGE}) fi if test "X$GLIBCONFIG" != X; then AC_MSG_CHECKING(for special glib includes: ) GLIBHEAD=`$GLIBCONFIG --cflags` AC_MSG_RESULT($GLIBHEAD) CPPFLAGS="$CPPFLAGS $GLIBHEAD" AC_MSG_CHECKING(for glib library flags) GLIBLIB=`$GLIBCONFIG --libs` AC_MSG_RESULT($GLIBLIB) LIBS="$LIBS $GLIBLIB" fi dnl ======================================================================== dnl Headers dnl ======================================================================== AC_HEADER_STDC AC_CHECK_HEADERS(arpa/inet.h) AC_CHECK_HEADERS(asm/types.h) AC_CHECK_HEADERS(assert.h) AC_CHECK_HEADERS(auth-client.h) AC_CHECK_HEADERS(ctype.h) AC_CHECK_HEADERS(dirent.h) AC_CHECK_HEADERS(errno.h) AC_CHECK_HEADERS(fcntl.h) AC_CHECK_HEADERS(getopt.h) AC_CHECK_HEADERS(glib.h) AC_CHECK_HEADERS(grp.h) AC_CHECK_HEADERS(limits.h) AC_CHECK_HEADERS(linux/errqueue.h) AC_CHECK_HEADERS(malloc.h) AC_CHECK_HEADERS(netdb.h) AC_CHECK_HEADERS(netinet/in.h) AC_CHECK_HEADERS(netinet/ip.h) AC_CHECK_HEADERS(pam/pam_appl.h) AC_CHECK_HEADERS(pthread.h) AC_CHECK_HEADERS(pwd.h) AC_CHECK_HEADERS(security/pam_appl.h) AC_CHECK_HEADERS(sgtty.h) AC_CHECK_HEADERS(signal.h) AC_CHECK_HEADERS(stdarg.h) AC_CHECK_HEADERS(stddef.h) AC_CHECK_HEADERS(stdio.h) AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(string.h) AC_CHECK_HEADERS(strings.h) AC_CHECK_HEADERS(sys/dir.h) AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/param.h) AC_CHECK_HEADERS(sys/poll.h) AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/select.h) AC_CHECK_HEADERS(sys/socket.h) AC_CHECK_HEADERS(sys/sockio.h) AC_CHECK_HEADERS(sys/stat.h) AC_CHECK_HEADERS(sys/time.h) AC_CHECK_HEADERS(sys/timeb.h) AC_CHECK_HEADERS(sys/types.h) AC_CHECK_HEADERS(sys/uio.h) AC_CHECK_HEADERS(sys/un.h) AC_CHECK_HEADERS(sys/utsname.h) AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_HEADERS(time.h) AC_CHECK_HEADERS(unistd.h) AC_CHECK_HEADERS(winsock.h) dnl These headers need prerequisits before the tests will pass dnl AC_CHECK_HEADERS(net/if.h) dnl AC_CHECK_HEADERS(netinet/icmp6.h) dnl AC_CHECK_HEADERS(netinet/ip6.h) dnl AC_CHECK_HEADERS(netinet/ip_icmp.h) AC_MSG_CHECKING(for special libxml2 includes) if test "x$XML2CONFIG" = "x"; then AC_MSG_ERROR(libxml2 config not found) else XML2HEAD="`$XML2CONFIG --cflags`" AC_MSG_RESULT($XML2HEAD) AC_CHECK_LIB(xml2, xmlReadMemory) AC_CHECK_LIB(xslt, xsltApplyStylesheet) fi CPPFLAGS="$CPPFLAGS $XML2HEAD" AC_CHECK_HEADERS(libxml/xpath.h) AC_CHECK_HEADERS(libxslt/xslt.h) if test "$ac_cv_header_libxml_xpath_h" != "yes"; then AC_MSG_ERROR(The libxml developement headers were not found) fi if test "$ac_cv_header_libxslt_xslt_h" != "yes"; then AC_MSG_ERROR(The libxslt developement headers were not found) fi dnl ======================================================================== dnl Structures dnl ======================================================================== AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[[#include ]]) dnl ======================================================================== dnl Functions dnl ======================================================================== AC_CHECK_FUNCS(g_log_set_default_handler) AC_CHECK_FUNCS(getopt, AC_DEFINE(HAVE_DECL_GETOPT, 1, [Have getopt function])) dnl ======================================================================== dnl ltdl dnl ======================================================================== AC_CHECK_LIB(ltdl, lt_dlopen, [LTDL_foo=1]) if test "x${enable_bundled_ltdl}" = "xyes"; then if test $ac_cv_lib_ltdl_lt_dlopen = yes; then AC_MSG_NOTICE([Disabling usage of installed ltdl]) fi ac_cv_lib_ltdl_lt_dlopen=no fi LIBLTDL_DIR="" if test $ac_cv_lib_ltdl_lt_dlopen != yes ; then AC_MSG_NOTICE([Installing local ltdl]) LIBLTDL_DIR=libltdl ( cd $srcdir ; $TAR -xvf libltdl.tar ) if test "$?" -ne 0; then AC_MSG_ERROR([$TAR of libltdl.tar in $srcdir failed]) fi AC_CONFIG_SUBDIRS(libltdl) else LIBS="$LIBS -lltdl" AC_MSG_NOTICE([Using installed ltdl]) INCLTDL="" LIBLTDL="" fi AC_SUBST(INCLTDL) AC_SUBST(LIBLTDL) AC_SUBST(LIBLTDL_DIR) dnl ======================================================================== dnl bzip2 dnl ======================================================================== AC_CHECK_HEADERS(bzlib.h) AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffCompress) if test x$ac_cv_lib_bz2_BZ2_bzBuffToBuffCompress != xyes ; then AC_MSG_ERROR(BZ2 libraries not found) fi if test x$ac_cv_header_bzlib_h != xyes; then AC_MSG_ERROR(BZ2 Development headers not found) fi dnl ======================================================================== dnl ncurses dnl ======================================================================== dnl dnl A few OSes (e.g. Linux) deliver a default "ncurses" alongside "curses". dnl Many non-Linux deliver "curses"; sites may add "ncurses". dnl dnl However, the source-code recommendation for both is to #include "curses.h" dnl (i.e. "ncurses" still wants the include to be simple, no-'n', "curses.h"). dnl dnl ncurse takes precedence. dnl AC_CHECK_HEADERS(curses.h) AC_CHECK_HEADERS(curses/curses.h) AC_CHECK_HEADERS(ncurses.h) AC_CHECK_HEADERS(ncurses/ncurses.h) dnl Although n-library is preferred, only look for it if the n-header was found. CURSESLIBS='' if test "$ac_cv_header_ncurses_h" = "yes"; then AC_CHECK_LIB(ncurses, printw, [CURSESLIBS='-lncurses'; AC_DEFINE(HAVE_LIBNCURSES,1, have ncurses library)] ) fi if test "$ac_cv_header_ncurses_ncurses_h" = "yes"; then AC_CHECK_LIB(ncurses, printw, [CURSESLIBS='-lncurses'; AC_DEFINE(HAVE_LIBNCURSES,1, have ncurses library)] ) fi dnl Only look for non-n-library if there was no n-library. if test X"$CURSESLIBS" = X"" -a "$ac_cv_header_curses_h" = "yes"; then AC_CHECK_LIB(curses, printw, [CURSESLIBS='-lcurses'; AC_DEFINE(HAVE_LIBCURSES,1, have curses library)] ) fi dnl Only look for non-n-library if there was no n-library. if test X"$CURSESLIBS" = X"" -a "$ac_cv_header_curses_curses_h" = "yes"; then AC_CHECK_LIB(curses, printw, [CURSESLIBS='-lcurses'; AC_DEFINE(HAVE_LIBCURSES,1, have curses library)] ) fi if test "x$CURSESLIBS" != "x"; then PKG_FEATURES="$PKG_FEATURES ncurses" fi dnl Check for printw() prototype compatibility if test X"$CURSESLIBS" != X"" && cc_supports_flag -Wcast-qual && cc_supports_flag -Werror; then AC_MSG_CHECKING(whether printw() requires argument of "const char *") ac_save_LIBS=$LIBS LIBS="$CURSESLIBS $LIBS" ac_save_CFLAGS=$CFLAGS CFLAGS="-Wcast-qual -Werror" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [ #if defined(HAVE_CURSES_H) # include #elif defined(HAVE_NCURSES_H) # include #endif ], [printw((const char *)"Test");] )], [ac_cv_compatible_printw=yes], [ac_cv_compatible_printw=no] ) LIBS=$ac_save_LIBS CFLAGS=$ac_save_CFLAGS AC_MSG_RESULT([$ac_cv_compatible_printw]) if test "$ac_cv_compatible_printw" = no; then AC_MSG_WARN([The printw() function of your ncurses or curses library is old, we will disable usage of the library. If you want to use this library anyway, please update to newer version of the library, ncurses 5.4 or later is recommended. You can get the library from http://www.gnu.org/software/ncurses/.]) AC_MSG_NOTICE([Disabling curses]) AC_DEFINE(HAVE_INCOMPATIBLE_PRINTW, 1, [Do we have incompatible printw() in curses library?]) fi fi AC_SUBST(CURSESLIBS) dnl ======================================================================== dnl Cluster infrastructure - Heartbeat dnl ======================================================================== dnl On Debian, AC_CHECK_LIBS fail if a library has any unresolved symbols dnl So check for all the depenancies (so they're added to LIBS) before checking for -lplumb AC_CHECK_LIB(pils, PILLoadPlugin) AC_CHECK_LIB(plumb, G_main_add_IPC_Channel) if test x"$ac_cv_lib_plumb_G_main_add_IPC_Channel" != x"yes"; then AC_MSG_FAILURE(Core Heartbeat utility libraries not found: $ac_cv_lib_plumb_G_main_add_IPC_Channel) fi dnl Compatability checks AC_CHECK_FUNCS(msgfromIPC_timeout) AC_CHECK_MEMBERS([struct lrm_ops.fail_rsc],,,[[#include ]]) dnl ======================================================================== dnl Cluster stack - Heartbeat dnl ======================================================================== case $SUPPORT_HEARTBEAT in 1|yes|true) AC_CHECK_LIB(hbclient, ll_cluster_new, [SUPPORT_HEARTBEAT=1], [AC_MSG_FAILURE(Unable to support Heartbeat: client libraries not found)]);; try) AC_CHECK_LIB(hbclient, ll_cluster_new, [SUPPORT_HEARTBEAT=1], [SUPPORT_HEARTBEAT=0]);; *) SUPPORT_HEARTBEAT=0;; esac AM_CONDITIONAL(BUILD_HEARTBEAT_SUPPORT, test $SUPPORT_HEARTBEAT = 1) AC_DEFINE_UNQUOTED(SUPPORT_HEARTBEAT, $SUPPORT_HEARTBEAT, Support the Heartbeat messaging and membership layer) dnl ======================================================================== dnl Cluster stack - OpenAIS dnl ======================================================================== AISLIB="" dnl Normalize the values case $SUPPORT_AIS in 1|yes|true) missingisfatal=1;; try) missingisfatal=0;; *) SUPPORT_AIS=no;; esac AC_MSG_CHECKING(for native AIS) AISMSGLIB="" AIS_VERSION="none" COROSYNC_PKG="$PKGCONFIG libcoroipcc" if test $SUPPORT_AIS = no; then AC_MSG_RESULT(no... not requested.) else AC_MSG_RESULT($SUPPORT_AIS, with '$AISPREFIX') AC_CHECK_HEADERS(openais/saAis.h) AC_CHECK_HEADERS(corosync/coroipcc.h) $COROSYNC_PKG --exists if test $? = 0; then AIS_VERSION="corosync" elif test "$ac_cv_header_openais_saAis_h" = "yes"; then AIS_VERSION="whitetank" else aisreason="Whitetank headers not found" fi fi if test $AIS_VERSION != "none"; then AC_MSG_CHECKING(for OpenAIS branch) AC_MSG_RESULT($AIS_VERSION) fi if test $AIS_VERSION = "corosync"; then if test "$ac_cv_header_corosync_coroipcc_h" != "yes"; then AIS_VERSION="none" aisreason="Corosync headers not found" fi saveLIBS="$LIBS" LIBS="$LIBS `$COROSYNC_PKG --libs-only-L`" AC_CHECK_LIB(coroipcc, coroipcc_msg_send_reply_receive, []) LIBS="$saveLIBS" if test $ac_cv_lib_coroipcc_coroipcc_msg_send_reply_receive != yes; then AC_MSG_RESULT(Cannot locate AIS messaging library) aisreason="requred Corosync libraries not found" AIS_VERSION="none" fi fi dnl continue? if test $AIS_VERSION = "whitetank"; then dnl Find it in lib, lib64, or wherever it wants to live... AC_MSG_CHECKING(location of OpenAIS libraries) dnl CoroSync location alib=`ls ${AISPREFIX}/*/libcpg.so | head -n 1` if test -z "$alib"; then dnl Whitetank location alib=`ls ${AISPREFIX}/*/*/libcpg.so | head -n 1` fi AISLIB=`dirname $alib` AC_MSG_RESULT($AISLIB) if test "x$AISLIB" = "x"; then AC_MSG_WARN(Use --with-ais-prefix to specify the prefix OpenAIS was installed with) aisreason="library directory not found" AIS_VERSION="none" elif test ! -d "$AISLIB"; then AC_MSG_WARN(Use --with-ais-prefix to specify the prefix OpenAIS was installed with) aisreason="specified library directory does not exist" AIS_VERSION="none" fi fi dnl continue? if test $AIS_VERSION = "whitetank"; then AC_MSG_CHECKING(location of OpenAIS plugins) if test -z "$LCRSODIR"; then LCRSODIR="$libexecdir/lcrso" alib=`ls ${AISPREFIX}/*/lcrso/objdb.lcrso | head -n 1` LCRSODIR=`dirname $alib` fi AC_MSG_RESULT($LCRSODIR) if test "x$LCRSODIR" = "x"; then AC_MSG_RESULT(Invalid. Please specify the correct location with --with-lcrso-dir) aisreason="plugin directory not found" AIS_VERSION="none" elif test ! -d "$LCRSODIR"; then AC_MSG_RESULT(Invalid. Please specify the correct location with --with-lcrso-dir) aisreason="specified plugin directory does not exist" AIS_VERSION="none" fi fi dnl continue? if test $AIS_VERSION = "whitetank"; then dnl Don't add the messaging library to LIBS since most daemons don't need/use it saveLIBS="$LIBS" LIBS="$LIBS -L${AISLIB} -R${AISLIB}" AC_CHECK_LIB(SaMsg, saSendReceiveReply, []) AC_CHECK_LIB(SaMsg, openais_msg_send_reply_receive, []) if test $ac_cv_lib_SaMsg_openais_msg_send_reply_receive = yes; then : OpenAIS elif test $ac_cv_lib_SaMsg_saSendReceiveReply = yes; then : OpenAIS AC_DEFINE_UNQUOTED(TRADITIONAL_AIS_IPC, 1, "Use the 'old' AIS IPC interface") else AC_MSG_RESULT(Cannot locate AIS messaging library) aisreason="requred libraries not found" AIS_VERSION="none" fi LIBS="$saveLIBS" fi SUPPORT_AIS=1 case $AIS_VERSION in corosync) AC_DEFINE_UNQUOTED(AIS_COROSYNC, 1, "AIS target is the corosync series") LCRSODIR=`$PKGCONFIG corosync --variable=lcrsodir` CFLAGS="$CFLAGS `$COROSYNC_PKG --cflags`" AISMSGLIB=`$COROSYNC_PKG --libs` ;; whitetank) AC_DEFINE_UNQUOTED(AIS_WHITETANK, 1, "AIS target is the whitetank series") CFLAGS="$CFLAGS -I$AISPREFIX/include/openais" AISMSGLIB="-L${AISLIB} -R${AISLIB} -lSaMsg" ;; none) SUPPORT_AIS=0 if test "x$aisreason" != x; then if test $missingisfatal = 0; then AC_MSG_WARN(Unable to support OpenAIS: $aisreason) else AC_MSG_FAILURE(Unable to support OpenAIS: $aisreason) fi fi ;; *) AC_MSG_FAILURE(Unknown OpenAIS branch: $AIS_VERSION);; esac AC_DEFINE_UNQUOTED(SUPPORT_AIS, $SUPPORT_AIS, Support the OpenAIS messaging and membership layer) AM_CONDITIONAL(BUILD_AIS_SUPPORT, test $SUPPORT_AIS = 1) dnl dnl Cluster stack - Sanity dnl STACKS="" CLUSTERLIBS="" if test $SUPPORT_HEARTBEAT = 1; then STACKS="$STACKS heartbeat" CLUSTERLIBS="$CLUSTERLIBS -lhbclient -lccmclient" fi if test $SUPPORT_AIS = 1; then STACKS="$STACKS $AIS_VERSION" CLUSTERLIBS="$CLUSTERLIBS ${AISMSGLIB}" else AISPREFIX="" LCRSODIR="$libdir" fi PKG_FEATURES="$PKG_FEATURES$STACKS" AC_MSG_CHECKING(for supported stacks) if test x"$STACKS" = x; then AC_MSG_FAILURE(You must choose at least one cluster stack to support) fi AC_MSG_RESULT($STACKS) AC_SUBST(CLUSTERLIBS) AC_SUBST(LCRSODIR) dnl ======================================================================== dnl SNMP dnl ======================================================================== case $SUPPORT_SNMP in 1|yes|true) missingisfatal=1;; try) missingisfatal=0;; *) SUPPORT_SNMP=no;; esac SNMPLIBS="" AC_MSG_CHECKING(for snmp support) if test $SUPPORT_SNMP = no; then AC_MSG_RESULT(no... not requested.) SUPPORT_SNMP=0 else SNMPCONFIG="" AC_MSG_RESULT($SUPPORT_SNMP) AC_CHECK_HEADERS(net-snmp/net-snmp-config.h) if test "x${ac_cv_header_net_snmp_net_snmp_config_h}" != "xyes"; then SUPPORT_SNMP="no" fi if test $SUPPORT_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.) SUPPORT_SNMP=no fi fi if test $SUPPORT_SNMP != no; then AC_MSG_CHECKING(for special snmp libraries) SNMPLIBS=`$SNMPCONFIG --agent-libs` AC_MSG_RESULT($SNMPLIBS) fi if test $SUPPORT_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 SUPPORT_SNMP=no fi LIBS=$savedLibs fi if test $SUPPORT_SNMP = no; then SNMPLIBS="" SUPPORT_SNMP=0 if test $missingisfatal = 0; then AC_MSG_WARN(Unable to support SNMP) else AC_MSG_FAILURE(Unable to support SNMP) fi else SUPPORT_SNMP=1 fi fi if test $SUPPORT_SNMP = 1; then PKG_FEATURES="$PKG_FEATURES snmp" fi AC_SUBST(SNMPLIBS) AM_CONDITIONAL(ENABLE_SNMP, test "$SUPPORT_SNMP" = "1") AC_DEFINE_UNQUOTED(ENABLE_SNMP, $SUPPORT_SNMP, Build in support for sending SNMP traps) dnl ======================================================================== dnl ESMTP dnl ======================================================================== case $SUPPORT_ESMTP in 1|yes|true) missingisfatal=1;; try) missingisfatal=0;; *) SUPPORT_ESMTP=no;; esac ESMTPLIB="" AC_MSG_CHECKING(for esmtp support) if test $SUPPORT_ESMTP = no; then AC_MSG_RESULT(no... not requested.) SUPPORT_ESMTP=0 else ESMTPCONFIG="" AC_MSG_RESULT($SUPPORT_ESMTP) AC_CHECK_HEADERS(libesmtp.h) if test "x${ac_cv_header_libesmtp_h}" != "xyes"; then ENABLE_ESMTP="no" fi if test $SUPPORT_ESMTP != no; then AC_PATH_PROGS(ESMTPCONFIG, libesmtp-config) if test "X${ESMTPCONFIG}" = "X"; then AC_MSG_RESULT(You need the libesmtp development package to continue.) SUPPORT_ESMTP=no fi fi if test $SUPPORT_ESMTP != no; then AC_MSG_CHECKING(for special esmtp libraries) ESMTPLIBS=`$ESMTPCONFIG --libs | tr '\n' ' '` AC_MSG_RESULT($ESMTPLIBS) fi if test $SUPPORT_ESMTP = no; then SUPPORT_ESMTP=0 if test $missingisfatal = 0; then AC_MSG_WARN(Unable to support ESMTP) else AC_MSG_FAILURE(Unable to support ESMTP) fi else SUPPORT_ESMTP=1 fi fi if test $SUPPORT_ESMTP = 1; then PKG_FEATURES="$PKG_FEATURES libesmtp" fi AC_SUBST(ESMTPLIBS) AM_CONDITIONAL(ENABLE_ESMTP, test "$SUPPORT_ESMTP" = "1") AC_DEFINE_UNQUOTED(ENABLE_ESMTP, $SUPPORT_ESMTP, Build in support for sending mail notifications with ESMTP) dnl ======================================================================== dnl GnuTLS dnl ======================================================================== AC_CHECK_HEADERS(gnutls/gnutls.h) AC_CHECK_HEADERS(security/pam_appl.h pam/pam_appl.h) dnl GNUTLS library: Attempt to determine by 'libgnutls-config' program. dnl If no 'libgnutls-config', try traditional autoconf means. AC_PATH_PROGS(LIBGNUTLS_CONFIG, libgnutls-config) if test -n "$LIBGNUTLS_CONFIG"; then AC_MSG_CHECKING(for gnutls header flags) GNUTLSHEAD="`$LIBGNUTLS_CONFIG --cflags`"; AC_MSG_RESULT($GNUTLSHEAD) AC_MSG_CHECKING(for gnutls library flags) GNUTLSLIBS="`$LIBGNUTLS_CONFIG --libs`"; AC_MSG_RESULT($GNUTLSLIBS) else AC_CHECK_LIB(gnutls, gnutls_init) fi AC_SUBST(GNUTLSHEAD) AC_SUBST(GNUTLSLIBS) dnl ======================================================================== dnl System Health dnl ======================================================================== dnl Check if servicelog development package is installed SERVICELOG=servicelog-1 SERVICELOG_EXISTS="no" AC_MSG_CHECKING(for $SERVICELOG packages) if $PKGCONFIG --exists $SERVICELOG then SERVICELOG_EXISTS="yes" fi AC_MSG_RESULT($SERVICELOG_EXISTS) AM_CONDITIONAL(BUILD_SERVICELOG, test "$SERVICELOG_EXISTS" = "yes") dnl Check if OpenIMPI packages and servicelog are installed OPENIPMI="OpenIPMI OpenIPMIposix" OPENIPMI_SERVICELOG_EXISTS="no" AC_MSG_CHECKING(for $SERVICELOG $OPENIPMI packages) if $PKGCONFIG --exists $OPENIPMI $SERVICELOG then OPENIPMI_SERICELOG_EXISTS="yes" fi AC_MSG_RESULT($OPENIPMI_SERICELOG_EXISTS) AM_CONDITIONAL(BUILD_OPENIPMI_SERICELOG, test "$OPENIPMI_SERICELOG_EXISTS" = "yes") dnl ======================================================================== dnl checks for library functions to replace them dnl dnl NoSuchFunctionName: dnl is a dummy function which no system supplies. It is here to make dnl the system compile semi-correctly on OpenBSD which doesn't know dnl how to create an empty archive dnl dnl scandir: Only on BSD. dnl System-V systems may have it, but hidden and/or deprecated. dnl A replacement function is supplied for it. dnl dnl setenv: is some bsdish function that should also be avoided (use dnl putenv instead) dnl On the other hand, putenv doesn't provide the right API for the dnl code and has memory leaks designed in (sigh...) Fortunately this dnl A replacement function is supplied for it. dnl dnl strerror: returns a string that corresponds to an errno. dnl A replacement function is supplied for it. dnl dnl unsetenv: is some bsdish function that should also be avoided (No dnl replacement) dnl A replacement function is supplied for it. dnl dnl strnlen: is a gnu function similar to strlen, but safer. dnl We wrote a tolearably-fast replacement function for it. dnl dnl strndup: is a gnu function similar to strdup, but safer. dnl We wrote a tolearably-fast replacement function for it. dnl dnl daemon: is a GNU function. The daemon() function is for programs wishing to dnl detach themselves from the controlling terminal and run in the dnl background as system daemon dnl A replacement function is supplied for it. AC_REPLACE_FUNCS(alphasort inet_pton NoSuchFunctionName scandir setenv strerror unsetenv strnlen strndup daemon strlcpy strlcat) dnl ======================================================================== dnl Compiler flags dnl ======================================================================== dnl Make sure that CFLAGS is not exported. If the user did dnl not have CFLAGS in their environment then this should have dnl no effect. However if CFLAGS was exported from the user's dnl environment, then the new CFLAGS will also be exported dnl to sub processes. CC_ERRORS="" CC_EXTRAS="" if export | fgrep " CFLAGS=" > /dev/null; then export -n CFLAGS || true # We don't want to bomb out if this fails fi if test "$GCC" != yes; then CFLAGS="$CFLAGS -g" enable_fatal_warnings=no else CFLAGS="$CFLAGS -ggdb3 -O0" # We had to eliminate -Wnested-externs because of libtool changes EXTRA_FLAGS="-fgnu89-inline -fstack-protector-all -Wall -Waggregate-return -Wbad-function-cast -Wcast-qual -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Wfloat-equal -Wformat=2 -Wformat-security -Wformat-nonliteral -Winline -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-long-long -Wno-strict-aliasing -Wpointer-arith -Wstrict-prototypes -Wunsigned-char -Wwrite-strings" # Additional warnings it might be nice to enable one day # -Wshadow # -Wunreachable-code for j in $EXTRA_FLAGS do if cc_supports_flag $j then CC_EXTRAS="$CC_EXTRAS $j" fi done dnl In lib/ais/Makefile.am there's a gcc option available as of v4.x GCC_MAJOR=`gcc -v 2>&1 | awk 'END{print $3}' | sed 's/[.].*//'` AM_CONDITIONAL(GCC_4, test "${GCC_MAJOR}" = 4) dnl System specific options case "$host_os" in *linux*|*bsd*) if test "${enable_fatal_warnings}" = "unknown"; then enable_fatal_warnings=yes fi ;; esac if test "x${enable_fatal_warnings}" != xno && cc_supports_flag -Werror ; then enable_fatal_warnings=yes else enable_fatal_warnings=no fi if test "x${enable_ansi}" != xno && cc_supports_flag -std=iso9899:199409 ; then AC_MSG_NOTICE(Enabling ANSI Compatibility) CC_EXTRAS="$CC_EXTRAS -ansi -D_GNU_SOURCE -DANSI_ONLY" fi AC_MSG_NOTICE(Activated additional gcc flags: ${CC_EXTRAS}) fi CFLAGS="$CFLAGS $CC_EXTRAS" NON_FATAL_CFLAGS="$CFLAGS" AC_SUBST(NON_FATAL_CFLAGS) dnl dnl We reset CFLAGS to include our warnings *after* all function dnl checking goes on, so that our warning flags don't keep the dnl AC_*FUNCS() calls above from working. In particular, -Werror will dnl *always* cause us troubles if we set it before here. dnl dnl if test "x${enable_fatal_warnings}" = xyes ; then AC_MSG_NOTICE(Enabling Fatal Warnings) CFLAGS="$CFLAGS -Werror" fi AC_SUBST(CFLAGS) dnl This is useful for use in Makefiles that need to remove one specific flag CFLAGS_COPY="$CFLAGS" AC_SUBST(CFLAGS_COPY) AC_SUBST(LIBADD_DL) dnl extra flags for dynamic linking libraries AC_SUBST(LIBADD_INTL) dnl extra flags for GNU gettext stuff... AC_SUBST(LOCALE) dnl Options for cleaning up the compiler output QUIET_LIBTOOL_OPTS="" QUIET_MAKE_OPTS="" if test "x${enable_quiet}" = "xyes"; then QUIET_LIBTOOL_OPTS="--quiet" QUIET_MAKE_OPTS="--quiet" fi AC_MSG_RESULT(Supress make details: ${enable_quiet}) dnl Put the above variables to use LIBTOOL="${LIBTOOL} --tag=CC \$(QUIET_LIBTOOL_OPTS)" MAKE="${MAKE} \$(QUIET_MAKE_OPTS)" AC_SUBST(CC) AC_SUBST(MAKE) AC_SUBST(LIBTOOL) AC_SUBST(QUIET_MAKE_OPTS) AC_SUBST(QUIET_LIBTOOL_OPTS) AC_DEFINE_UNQUOTED(CRM_FEATURES, "$PKG_FEATURES", Set of enabled features) dnl The Makefiles and shell scripts we output AC_CONFIG_FILES(Makefile \ cts/Makefile \ cts/CTSvars.py \ cts/LSBDummy \ cib/Makefile \ crmd/Makefile \ pengine/Makefile \ pengine/regression.core.sh \ doc/Makefile \ doc/cibadmin.8 \ doc/crm_resource.8 \ include/Makefile \ include/crm/Makefile \ include/crm/common/Makefile \ include/crm/pengine/Makefile \ replace/Makefile \ lib/Makefile \ lib/ais/Makefile \ lib/common/Makefile \ lib/cib/Makefile \ lib/pengine/Makefile \ lib/transition/Makefile \ lib/fencing/Makefile \ lib/plugins/Makefile \ lib/plugins/lrm/Makefile \ fencing/Makefile \ extra/Makefile \ extra/resources/Makefile \ tools/Makefile \ + tools/crm_report \ tools/hb2openais.sh \ tools/crm_primitive.py \ - shell/Makefile \ +shell/Makefile \ shell/templates/Makefile \ shell/regression/Makefile \ shell/regression/regression.sh \ shell/regression/lrmregtest-lsb \ shell/regression/testcases/Makefile \ shell/modules/Makefile \ shell/modules/ui.py \ shell/modules/ra.py \ shell/modules/vars.py \ shell/modules/help.py \ xml/Makefile \ ) dnl Now process the entire list of files added by previous dnl calls to AC_CONFIG_FILES() AC_OUTPUT() dnl ***************** dnl Configure summary dnl ***************** AC_MSG_RESULT([]) AC_MSG_RESULT([$PACKAGE configuration:]) AC_MSG_RESULT([ Version = ${VERSION} (Build: $BUILD_VERSION)]) AC_MSG_RESULT([ Features =${PKG_FEATURES}]) AC_MSG_RESULT([]) AC_MSG_RESULT([ Prefix = ${prefix}]) AC_MSG_RESULT([ Executables = ${sbindir}]) AC_MSG_RESULT([ Man pages = ${mandir}]) 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([ AIS Plugins = ${LCRSODIR}]) AC_MSG_RESULT([]) AC_MSG_RESULT([ Use system LTDL = ${ac_cv_lib_ltdl_lt_dlopen}]) AC_MSG_RESULT([]) AC_MSG_RESULT([ HA group name = ${CRM_DAEMON_GROUP}]) AC_MSG_RESULT([ HA user name = ${CRM_DAEMON_USER}]) AC_MSG_RESULT([]) AC_MSG_RESULT([ CFLAGS = ${CFLAGS}]) AC_MSG_RESULT([ Libraries = ${LIBS}]) AC_MSG_RESULT([ Stack Libraries = ${CLUSTERLIBS}]) diff --git a/pacemaker.spec b/pacemaker.spec index 916f3609f3..e60fbe90a1 100644 --- a/pacemaker.spec +++ b/pacemaker.spec @@ -1,1368 +1,1369 @@ %global gname haclient %global uname hacluster %global pcmk_docdir %{_docdir}/%{name} %global specversion 1 #global upstream_version tip %global upstream_prefix pacemaker # Keep around for when/if required #global alphatag %{upstream_version}.hg %global pcmk_release %{?alphatag:0.}%{specversion}%{?alphatag:.%{alphatag}}%{?dist} # Compatibility macros for distros (fedora) that don't provide Python macros by default # Do this instead of trying to conditionally %include %{_rpmconfigdir}/macros.python %{!?py_ver: %{expand: %%global py_ver %%(echo `python -c "import sys; print sys.version[:3]"`)}} %{!?py_prefix: %{expand: %%global py_prefix %%(echo `python -c "import sys; print sys.prefix"`)}} %{!?py_libdir: %{expand: %%global py_libdir %%{expand:%%%%{py_prefix}/lib/python%%%%{py_ver}}}} %{!?py_sitedir: %{expand: %%global py_sitedir %%{expand:%%%%{py_libdir}/site-packages}}} # Compatibility macro wrappers for legacy RPM versions that do not support conditional builds %{!?bcond_without: %{expand: %%global bcond_without() %%{expand:%%%%{!?_without_%%{1}:%%%%global with_%%{1} 1}}}} %{!?bcond_with: %{expand: %%global bcond_with() %%{expand:%%%%{?_with_%%{1}:%%%%global with_%%{1} 1}}}} %{!?with: %{expand: %%global with() %%{expand:%%%%{?with_%%{1}:1}%%%%{!?with_%%{1}:0}}}} %{!?without: %{expand: %%global without() %%{expand:%%%%{?with_%%{1}:0}%%%%{!?with_%%{1}:1}}}} # Conditionals # Invoke "rpmbuild --without " or "rpmbuild --with " # to disable or enable specific features # Supported cluster stacks, must support at least one %bcond_without ais %bcond_without heartbeat # ESMTP is not available in RHEL, only in EPEL. Allow people to build # the RPM without ESMTP in case they choose not to use EPEL packages %bcond_without esmtp # SNMP trap support only works with Net-SNMP 5.4 and above %bcond_without snmp # We generate some docs using Publican, but its not available everywhere %bcond_without publican Name: pacemaker Summary: Scalable High-Availability cluster resource manager Version: 1.1.1 Release: %{pcmk_release} License: GPLv2+ and LGPLv2+ Url: http://www.clusterlabs.org Group: System Environment/Daemons Source0: pacemaker.tar.bz2 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) AutoReqProv: on Requires(pre): cluster-glue Requires: resource-agents Requires: python >= 2.4 Conflicts: heartbeat < 2.99 %if 0%{?fedora} || 0%{?centos} > 4 || 0%{?rhel} > 4 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) BuildRequires: help2man libtool-ltdl-devel %endif %if 0%{?suse_version} # net-snmp-devel on SLES10 does not suck in tcpd-devel automatically BuildRequires: help2man tcpd-devel %endif # Required for core functionality BuildRequires: automake autoconf libtool pkgconfig python BuildRequires: glib2-devel cluster-glue-libs-devel libxml2-devel libxslt-devel BuildRequires: pkgconfig python-devel gcc-c++ bzip2-devel gnutls-devel pam-devel # Enables optional functionality BuildRequires: ncurses-devel openssl-devel lm_sensors-devel libselinux-devel %if %{with esmtp} BuildRequires: libesmtp-devel Requires: libesmtp %endif %if %{with snmp} BuildRequires: net-snmp-devel >= 5.4 Requires: net-snmp >= 5.4 %endif %if %{with ais} BuildRequires: corosynclib-devel Requires: corosync %endif %if %{with heartbeat} BuildRequires: heartbeat-devel heartbeat-libs Requires: heartbeat >= 3.0.0 %endif %if %{with publican} BuildRequires: publican %endif %description Pacemaker is an advanced, scalable High-Availability cluster resource manager for Linux-HA (Heartbeat) and/or OpenAIS. It supports "n-node" clusters with significant capabilities for managing resources and dependencies. It will run scripts at initialization, when machines go up or down, when related resources fail and can be configured to periodically check resource health. Available rpmbuild rebuild options: --without : heartbeat ais snmp esmtp publican %package -n pacemaker-libs License: GPLv2+ and LGPLv2+ Summary: Libraries used by the Pacemaker cluster resource manager and its clients Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} %description -n pacemaker-libs Pacemaker is an advanced, scalable High-Availability cluster resource manager for Linux-HA (Heartbeat) and/or OpenAIS. It supports "n-node" clusters with significant capabilities for managing resources and dependencies. It will run scripts at initialization, when machines go up or down, when related resources fail and can be configured to periodically check resource health. %package -n pacemaker-libs-devel License: GPLv2+ and LGPLv2+ Summary: Pacemaker development package Group: Development/Libraries Requires: %{name}-libs = %{version}-%{release} Requires: cluster-glue-libs-devel Obsoletes: libpacemaker3 %if %{with ais} Requires: corosynclib-devel %endif %if %{with heartbeat} Requires: heartbeat-devel %endif %description -n pacemaker-libs-devel Headers and shared libraries for developing tools for Pacemaker. Pacemaker is an advanced, scalable High-Availability cluster resource manager for Linux-HA (Heartbeat) and/or OpenAIS. It supports "n-node" clusters with significant capabilities for managing resources and dependencies. It will run scripts at initialization, when machines go up or down, when related resources fail and can be configured to periodically check resource health. %package cts License: GPLv2+ and LGPLv2+ Summary: Test framework for cluster-related technologies like Pacemaker Group: System Environment/Daemons Requires: python %description cts Test framework for cluster-related technologies like Pacemaker %package doc License: GPLv2+ and LGPLv2+ Summary: Documentation for Pacemaker Group: Documentation %description doc Documentation for Pacemaker. Pacemaker is an advanced, scalable High-Availability cluster resource manager for Linux-HA (Heartbeat) and/or OpenAIS. It supports "n-node" clusters with significant capabilities for managing resources and dependencies. It will run scripts at initialization, when machines go up or down, when related resources fail and can be configured to periodically check resource health. %prep %setup -q -n %{upstream_prefix}%{?upstream_version} %build ./autogen.sh # RHEL <= 5 does not support --docdir docdir=%{pcmk_docdir} %{configure} \ %{?_without_heartbeat} \ %{?_without_ais} \ %{?_without_esmtp} \ %{?_without_snmp} \ --localstatedir=%{_var} \ --enable-fatal-warnings=no make %{_smp_mflags} docdir=%{pcmk_docdir} %install rm -rf %{buildroot} make DESTDIR=%{buildroot} docdir=%{pcmk_docdir} install # Scripts that need should be executable chmod a+x %{buildroot}/%{_libdir}/heartbeat/hb2openais-helper.py chmod a+x %{buildroot}/%{_datadir}/pacemaker/tests/cts/CTSlab.py chmod a+x %{buildroot}/%{_datadir}/pacemaker/tests/cts/extracttests.py # These are not actually scripts find %{buildroot} -name '*.xml' -type f -print0 | xargs -0 chmod a-x find %{buildroot} -name '*.xsl' -type f -print0 | xargs -0 chmod a-x find %{buildroot} -name '*.rng' -type f -print0 | xargs -0 chmod a-x find %{buildroot} -name '*.dtd' -type f -print0 | xargs -0 chmod a-x # Dont package static libs find %{buildroot} -name '*.a' -type f -print0 | xargs -0 rm -f find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f # Do not package these either rm -f %{buildroot}/%{_libdir}/heartbeat/crm_primitive.* rm -f %{buildroot}/%{_libdir}/heartbeat/atest rm -f %{buildroot}/%{_libdir}/service_crm.so %clean rm -rf %{buildroot} %post -n pacemaker-libs -p /sbin/ldconfig %postun -n pacemaker-libs -p /sbin/ldconfig %files ########################################################### %defattr(-,root,root) %exclude %{_datadir}/pacemaker/tests %{_datadir}/pacemaker %{_datadir}/snmp/mibs/PCMK-MIB.txt %{_libdir}/heartbeat/* %{_sbindir}/cibadmin %{_sbindir}/crm_attribute %{_sbindir}/crm_diff %{_sbindir}/crm_failcount %{_sbindir}/crm_master %{_sbindir}/crm_mon %{_sbindir}/crm %{_sbindir}/crm_resource %{_sbindir}/crm_standby %{_sbindir}/crm_verify %{_sbindir}/crmadmin %{_sbindir}/iso8601 %{_sbindir}/attrd_updater %{_sbindir}/ptest %{_sbindir}/crm_shadow %{_sbindir}/cibpipe %{_sbindir}/crm_node %{_sbindir}/crm_simulate %{_sbindir}/fence_legacy %{_sbindir}/stonith_admin +%{_sbindir}/crm_report %{py_sitedir}/crm %if %{with heartbeat} %{_sbindir}/crm_uuid %else %exclude %{_sbindir}/crm_uuid %endif # Packaged elsewhere %exclude %{pcmk_docdir}/AUTHORS %exclude %{pcmk_docdir}/COPYING %exclude %{pcmk_docdir}/COPYING.LIB %doc COPYING %doc AUTHORS %dir %attr (750, %{uname}, %{gname}) %{_var}/lib/heartbeat/crm %dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pengine %dir %attr (750, %{uname}, %{gname}) %{_var}/run/crm %dir /usr/lib/ocf %dir /usr/lib/ocf/resource.d /usr/lib/ocf/resource.d/pacemaker %if %{with ais} %{_libexecdir}/lcrso/pacemaker.lcrso %endif %files -n pacemaker-libs %defattr(-,root,root) %{_libdir}/libcib.so.* %{_libdir}/libcrmcommon.so.* %{_libdir}/libcrmcluster.so.* %{_libdir}/libpe_status.so.* %{_libdir}/libpe_rules.so.* %{_libdir}/libpengine.so.* %{_libdir}/libtransitioner.so.* %{_libdir}/libstonithd.so.* %doc COPYING.LIB %doc AUTHORS %files doc %doc %{_mandir}/man8/*.8* %doc %{pcmk_docdir}/crm_cli.txt %doc %{pcmk_docdir}/crm_fencing.txt %doc %{pcmk_docdir}/README.hb2openais %if %{with publican} %doc %{pcmk_docdir}/index.html %doc %{pcmk_docdir}/Pacemaker_Explained %endif %files cts %{py_sitedir}/cts %{_datadir}/pacemaker/tests/cts %doc COPYING.LIB %doc AUTHORS %files -n pacemaker-libs-devel %defattr(-,root,root) %exclude %{_datadir}/pacemaker/tests/cts %{_datadir}/pacemaker/tests %{_includedir}/pacemaker %{_libdir}/*.so %doc COPYING.LIB %doc AUTHORS %changelog * Tue Feb 16 2010 Andrew Beekhof - 1.1.1-1 - First public release of Pacemaker 1.1 - Package reference documentation in a doc subpackage - Move cts into a subpackage so that it can be easily consumed by others - Update source tarball to revision: 17d9cd4ee29f + New stonith daemon that supports global notifications + Service placement influenced by the physical resources + A new tool for simulating failures and the cluster’s to them + Ability to serialize an otherwise unrelated a set of resource actions (eg. Xen migrations) * Wed Feb 10 2010 Andrew Beekhof - 1.0.7-4 - Rebuild for heartbeat 3.0.2-2 * Wed Feb 10 2010 Andrew Beekhof - 1.0.7-3 - Rebuild for cluster-glue 1.0.3 * Tue Jan 19 2010 Andrew Beekhof - 1.0.7-2 - Rebuild for corosync 1.2.0 * Mon Jan 18 2010 Andrew Beekhof - 1.0.7-1 - Update source tarball to revision: 2eed906f43e9 (stable-1.0) tip - Statistics: Changesets: 193 Diff: 220 files changed, 15933 insertions(+), 8782 deletions(-) - Changes since 1.0.5-4 + High: PE: Bug 2213 - Ensure groups process location constraints so that clone-node-max works for cloned groups + High: PE: Bug lf#2153 - non-clones should not restart when clones stop/start on other nodes + High: PE: Bug lf#2209 - Clone ordering should be able to prevent startup of dependant clones + High: PE: Bug lf#2216 - Correctly identify the state of anonymous clones when deciding when to probe + High: PE: Bug lf#2225 - Operations that require fencing should wait for 'stonith_complete' not 'all_stopped'. + High: PE: Bug lf#2225 - Prevent clone peers from stopping while another is instance is (potentially) being fenced + High: PE: Correctly anti-colocate with a group + High: PE: Correctly unpack ordering constraints for resource sets to avoid graph loops + High: Tools: crm: load help from crm_cli.txt + High: Tools: crm: resource sets (bnc#550923) + High: Tools: crm: support for comments (LF 2221) + High: Tools: crm: support for description attribute in resources/operations (bnc#548690) + High: Tools: hb2openais: add EVMS2 CSM processing (and other changes) (bnc#548093) + High: Tools: hb2openais: do not allow empty rules, clones, or groups (LF 2215) + High: Tools: hb2openais: refuse to convert pure EVMS volumes + High: cib: Ensure the loop for login message terminates + High: cib: Finally fix reliability of receiving large messages over remote plaintext connections + High: cib: Fix remote notifications + High: cib: For remote connections, default to CRM_DAEMON_USER since thats the only one that the cib can validate the password for using PAM + High: cib: Remote plaintext - Retry sending parts of the message that did not fit the first time + High: crmd: Ensure batch-limit is correctly enforced + High: crmd: Ensure we have the latest status after a transition abort + High (bnc#547579,547582): Tools: crm: status section editing support + High: shell: Add allow-migrate as allowed meta-attribute (bnc#539968) + Medium: Build: Do not automatically add -L/lib, it could cause 64-bit arches to break + Medium: PE: Bug lf#2206 - rsc_order constraints always use score at the top level + Medium: PE: Only complain about target-role=master for non m/s resources + Medium: PE: Prevent non-multistate resources from being promoted through target-role + Medium: PE: Provide a default action for resource-set ordering + Medium: PE: Silently fix requires=fencing for stonith resources so that it can be set in op_defaults + Medium: Tools: Bug lf#2286 - Allow the shell to accept template parameters on the command line + Medium: Tools: Bug lf#2307 - Provide a way to determin the nodeid of past cluster members + Medium: Tools: crm: add update method to template apply (LF 2289) + Medium: Tools: crm: direct RA interface for ocf class resource agents (LF 2270) + Medium: Tools: crm: direct RA interface for stonith class resource agents (LF 2270) + Medium: Tools: crm: do not add score which does not exist + Medium: Tools: crm: do not consider warnings as errors (LF 2274) + Medium: Tools: crm: do not remove sets which contain id-ref attribute (LF 2304) + Medium: Tools: crm: drop empty attributes elements + Medium: Tools: crm: exclude locations when testing for pathological constraints (LF 2300) + Medium: Tools: crm: fix exit code on single shot commands + Medium: Tools: crm: fix node delete (LF 2305) + Medium: Tools: crm: implement -F (--force) option + Medium: Tools: crm: rename status to cibstatus (LF 2236) + Medium: Tools: crm: revisit configure commit + Medium: Tools: crm: stay in crm if user specified level only (LF 2286) + Medium: Tools: crm: verify changes on exit from the configure level + Medium: ais: Some clients such as gfs_controld want a cluster name, allow one to be specified in corosync.conf + Medium: cib: Clean up logic for receiving remote messages + Medium: cib: Create valid notification control messages + Medium: cib: Indicate where the remote connection came from + Medium: cib: Send password prompt to stderr so that stdout can be redirected + Medium: cts: Fix rsh handling when stdout is not required + Medium: doc: Fill in the section on removing a node from an AIS-based cluster + Medium: doc: Update the docs to reflect the 0.6/1.0 rolling upgrade problem + Medium: doc: Use Publican for docbook based documentation + Medium: fencing: stonithd: add metadata for stonithd instance attributes (and support in the shell) + Medium: fencing: stonithd: ignore case when comparing host names (LF 2292) + Medium: tools: Make crm_mon functional with remote connections + Medium: xml: Add stopped as a supported role for operations + Medium: xml: Bug bnc#552713 - Treat node unames as text fields not IDs + Medium: xml: Bug lf#2215 - Create an always-true expression for empty rules when upgrading from 0.6 * Thu Oct 29 2009 Andrew Beekhof - 1.0.5-4 - Include the fixes from CoroSync integration testing - Move the resource templates - they are not documentation - Ensure documentation is placed in a standard location - Exclude documentation that is included elsewhere in the package - Update the tarball from upstream to version ee19d8e83c2a + High: cib: Correctly clean up when both plaintext and tls remote ports are requested + High: PE: Bug bnc#515172 - Provide better defaults for lt(e) and gt(e) comparisions + High: PE: Bug lf#2197 - Allow master instances placemaker to be influenced by colocation constraints + High: PE: Make sure promote/demote pseudo actions are created correctly + High: PE: Prevent target-role from promoting more than master-max instances + High: ais: Bug lf#2199 - Prevent expected-quorum-votes from being populated with garbage + High: ais: Prevent deadlock - dont try to release IPC message if the connection failed + High: cib: For validation errors, send back the full CIB so the client can display the errors + High: cib: Prevent use-after-free for remote plaintext connections + High: crmd: Bug lf#2201 - Prevent use-of-NULL when running heartbeat * Wed Oct 13 2009 Andrew Beekhof - 1.0.5-3 - Update the tarball from upstream to version 38cd629e5c3c + High: Core: Bug lf#2169 - Allow dtd/schema validation to be disabled + High: PE: Bug lf#2106 - Not all anonymous clone children are restarted after configuration change + High: PE: Bug lf#2170 - stop-all-resources option had no effect + High: PE: Bug lf#2171 - Prevent groups from starting if they depend on a complex resource which can not + High: PE: Disable resource management if stonith-enabled=true and no stonith resources are defined + High: PE: do not include master score if it would prevent allocation + High: ais: Avoid excessive load by checking for dead children every 1s (instead of 100ms) + High: ais: Bug rh#525589 - Prevent shutdown deadlocks when running on CoroSync + High: ais: Gracefully handle changes to the AIS nodeid + High: crmd: Bug bnc#527530 - Wait for the transition to complete before leaving S_TRANSITION_ENGINE + High: crmd: Prevent use-after-free with LOG_DEBUG_3 + Medium: xml: Mask the "symmetrical" attribute on rsc_colocation constraints (bnc#540672) + Medium (bnc#520707): Tools: crm: new templates ocfs2 and clvm + Medium: Build: Invert the disable ais/heartbeat logic so that --without (ais|heartbeat) is available to rpmbuild + Medium: PE: Bug lf#2178 - Indicate unmanaged clones + Medium: PE: Bug lf#2180 - Include node information for all failed ops + Medium: PE: Bug lf#2189 - Incorrect error message when unpacking simple ordering constraint + Medium: PE: Correctly log resources that would like to start but can not + Medium: PE: Stop ptest from logging to syslog + Medium: ais: Include version details in plugin name + Medium: crmd: Requery the resource metadata after every start operation * Fri Aug 21 2009 Tomas Mraz - 1.0.5-2.1 - rebuilt with new openssl * Wed Aug 19 2009 Andrew Beekhof - 1.0.5-2 - Add versioned perl dependancy as specified by https://fedoraproject.org/wiki/Packaging/Perl#Packages_that_link_to_libperl - No longer remove RPATH data, it prevents us finding libperl.so and no other libraries were being hardcoded - Compile in support for heartbeat - Conditionally add heartbeat-devel and corosynclib-devel to the -devel requirements depending on which stacks are supported * Mon Aug 17 2009 Andrew Beekhof - 1.0.5-1 - Add dependancy on resource-agents - Use the version of the configure macro that supplies --prefix, --libdir, etc - Update the tarball from upstream to version 462f1569a437 (Pacemaker 1.0.5 final) + High: Tools: crm_resource - Advertise --move instead of --migrate + Medium: Extra: New node connectivity RA that uses system ping and attrd_updater + Medium: crmd: Note that dc-deadtime can be used to mask the brokeness of some switches * Tue Aug 11 2009 Ville Skyttä - 1.0.5-0.7.c9120a53a6ae.hg - Use bzipped upstream tarball. * Wed Jul 29 2009 Andrew Beekhof - 1.0.5-0.6.c9120a53a6ae.hg - Add back missing build auto* dependancies - Minor cleanups to the install directive * Tue Jul 28 2009 Andrew Beekhof - 1.0.5-0.5.c9120a53a6ae.hg - Add a leading zero to the revision when alphatag is used * Tue Jul 28 2009 Andrew Beekhof - 1.0.5-0.4.c9120a53a6ae.hg - Incorporate the feedback from the cluster-glue review - Realistically, the version is a 1.0.5 pre-release - Use the global directive instead of define for variables - Use the haclient/hacluster group/user instead of daemon - Use the _configure macro - Fix install dependancies * Fri Jul 24 2009 Andrew Beekhof - 1.0.4-3 - Initial Fedora checkin - Include an AUTHORS and license file in each package - Change the library package name to pacemaker-libs to be more Fedora compliant - Remove execute permissions from xml related files - Reference the new cluster-glue devel package name - Update the tarball from upstream to version c9120a53a6ae + High: PE: Only prevent migration if the clone dependancy is stopping/starting on the target node + High: PE: Bug 2160 - Dont shuffle clones due to colocation + High: PE: New implementation of the resource migration (not stop/start) logic + Medium: Tools: crm_resource - Prevent use-of-NULL by requiring a resource name for the -A and -a options + Medium: PE: Prevent use-of-NULL in find_first_action() * Tue Jul 14 2009 Andrew Beekhof - 1.0.4-2 - Reference authors from the project AUTHORS file instead of listing in description - Change Source0 to reference the Mercurial repo - Cleaned up the summaries and descriptions - Incorporate the results of Fedora package self-review * Thu Jun 04 2009 Andrew Beekhof - 1.0.4-1 - Update source tarball to revision: 1d87d3e0fc7f (stable-1.0) - Statistics: Changesets: 209 Diff: 266 files changed, 12010 insertions(+), 8276 deletions(-) - Changes since Pacemaker-1.0.3 + High (bnc#488291): ais: do not rely on byte endianness on ptr cast + High (bnc#507255): Tools: crm: delete rsc/op_defaults (these meta_attributes are killing me) + High (bnc#507255): Tools: crm: import properly rsc/op_defaults + High (LF 2114): Tools: crm: add support for operation instance attributes + High: ais: Bug lf#2126 - Messages replies cannot be routed to transient clients + High: ais: Fix compilation for the latest Corosync API (v1719) + High: attrd: Do not perform all updates as complete refreshes + High: cib: Fix huge memory leak affecting heartbeat-based clusters + High: Core: Allow xpath queries to match attributes + High: Core: Generate the help text directly from a tool options struct + High: Core: Handle differences in 0.6 messaging format + High: crmd: Bug lf#2120 - All transient node attribute updates need to go via attrd + High: crmd: Correctly calculate how long an FSA action took to avoid spamming the logs with errors + High: crmd: Fix another large memory leak affecting Heartbeat based clusters + High: lha: Restore compatability with older versions + High: PE: Bug bnc#495687 - Filesystem is not notified of successful STONITH under some conditions + High: PE: Make running a cluster with STONITH enabled but no STONITH resources an error and provide details on resolutions + High: PE: Prevent use-ofNULL when using resource ordering sets + High: PE: Provide inter-notification ordering guarantees + High: PE: Rewrite the notification code to be understanable and extendable + High: Tools: attrd - Prevent race condition resulting in the cluster forgetting the node wishes to shut down + High: Tools: crm: regression tests + High: Tools: crm_mon - Fix smtp notifications + High: Tools: crm_resource - Repair the ability to query meta attributes + Low Build: Bug lf#2105 - Debian package should contain pacemaker doc and crm templates + Medium (bnc#507255): Tools: crm: handle empty rsc/op_defaults properly + Medium (bnc#507255): Tools: crm: use the right obj_type when creating objects from xml nodes + Medium (LF 2107): Tools: crm: revisit exit codes in configure + Medium: cib: Do not bother validating updates that only affect the status section + Medium: Core: Include supported stacks in version information + Medium: crmd: Record in the CIB, the cluster infrastructure being used + Medium: cts: Do not combine crm_standby arguments - the wrapper ca not process them + Medium: cts: Fix the CIBAusdit class + Medium: Extra: Refresh showscores script from Dominik + Medium: PE: Build a statically linked version of ptest + Medium: PE: Correctly log the actions for resources that are being recovered + Medium: PE: Correctly log the occurance of promotion events + Medium: PE: Implememt node health based on a patch from Mark Hamzy + Medium: Tools: Add examples to help text outputs + Medium: Tools: crm: catch syntax errors for configure load + Medium: Tools: crm: implement erasing nodes in configure erase + Medium: Tools: crm: work with parents only when managing xml objects + Medium: Tools: crm_mon - Add option to run custom notification program on resource operations (Patch by Dominik Klein) + Medium: Tools: crm_resource - Allow --cleanup to function on complex resources and cluster-wide + Medium: Tools: haresource2cib.py - Patch from horms to fix conversion error + Medium: Tools: Include stack information in crm_mon output + Medium: Tools: Two new options (--stack,--constraints) to crm_resource for querying how a resource is configured * Wed Apr 08 2009 Andrew Beekhof - 1.0.3-1 - Update source tarball to revision: b133b3f19797 (stable-1.0) tip - Statistics: Changesets: 383 Diff: 329 files changed, 15471 insertions(+), 15119 deletions(-) - Changes since Pacemaker-1.0.2 + Added tag SLE11-HAE-GMC for changeset 9196be9830c2 + High: ais plugin: Fix quorum calculation (bnc#487003) + High: ais: Another memory fix leak in error path + High: ais: Bug bnc#482847, bnc#482905 - Force a clean exit of OpenAIS once Pacemaker has finished unloading + High: ais: Bug bnc#486858 - Fix update_member() to prevent spamming clients with membership events containing no changes + High: ais: Centralize all quorum calculations in the ais plugin and allow expected votes to be configured int he cib + High: ais: Correctly handle a return value of zero from openais_dispatch_recv() + High: ais: Disable logging to a file + High: ais: Fix memory leak in error path + High: ais: IPC messages are only in scope until a response is sent + High: All signal handlers used with CL_SIGNAL() need to be as minimal as possible + High: cib: Bug bnc#482885 - Simplify CIB disk-writes to prevent data loss. Required a change to the backup filename format + High: cib: crmd: Revert part of 9782ab035003. Complex shutdown routines need G_main_add_SignalHandler to avoid race coditions + High: crm: Avoid infinite loop during crm configure edit (bnc#480327) + High: crmd: Avoid a race condition by waiting for the attrd update to trigger a transition automatically + High: crmd: Bug bnc#480977 - Prevent extra, partial, shutdown when a node restarts too quickly + High: crmd: Bug bnc#480977 - Prevent extra, partial, shutdown when a node restarts too quickly (verified) + High: crmd: Bug bnc#489063 - Ensure the DC is always unset after we 'loose' an election + High: crmd: Bug BSC#479543 - Correctly find the migration source for timed out migrate_from actions + High: crmd: Call crm_peer_init() before we start the FSA - prevents a race condition when used with Heartbeat + High: crmd: Erasing the status section should not be forced to the local node + High: crmd: Fix memory leak in cib notication processing code + High: crmd: Fix memory leak in transition graph processing + High: crmd: Fix memory leaks found by valgrind + High: crmd: More memory leaks fixes found by valgrind + High: fencing: stonithd: is_heartbeat_cluster is a no-no if there is no heartbeat support + High: PE: Bug bnc#466788 - Exclude nodes that can not run resources + High: PE: Bug bnc#466788 - Make colocation based on node attributes work + High: PE: Bug BNC#478687 - Do not crash when clone-max is 0 + High: PE: Bug bnc#488721 - Fix id-ref expansion for clones, the doc-root for clone children is not the cib root + High: PE: Bug bnc#490418 - Correctly determine node state for nodes wishing to be terminated + High: PE: Bug LF#2087 - Correctly parse the state of anonymous clones that have multiple instances on a given node + High: PE: Bug lf#2089 - Meta attributes are not inherited by clone children + High: PE: Bug lf#2091 - Correctly restart modified resources that were found active by a probe + High: PE: Bug lf#2094 - Fix probe ordering for cloned groups + High: PE: Bug LF:2075 - Fix large pingd memory leaks + High: PE: Correctly attach orphaned clone children to their parent + High: PE: Correctly handle terminate node attributes that are set to the output from time() + High: PE: Ensure orphaned clone members are hooked up to the parent when clone-max=0 + High: PE: Fix memory leak in LogActions + High: PE: Fix the determination of whether a group is active + High: PE: Look up the correct promotion preference for anonymous masters + High: PE: Simplify handling of start failures by changing the default migration-threshold to INFINITY + High: PE: The ordered option for clones no longer causes extra start/stop operations + High: RA: Bug bnc#490641 - Shut down dlm_controld with -TERM instead of -KILL + High: RA: pingd: Set default ping interval to 1 instead of 0 seconds + High: Resources: pingd - Correctly tell the ping daemon to shut down + High: Tools: Bug bnc#483365 - Ensure the command from cluster_test includes a value for --log-facility + High: Tools: cli: fix and improve delete command + High: Tools: crm: add and implement templates + High: Tools: crm: add support for command aliases and some common commands (i.e. cd,exit) + High: Tools: crm: create top configuration nodes if they are missing + High: Tools: crm: fix parsing attributes for rules (broken by the previous changeset) + High: Tools: crm: new ra set of commands + High: Tools: crm: resource agents information management + High: Tools: crm: rsc/op_defaults + High: Tools: crm: support for no value attribute in nvpairs + High: Tools: crm: the new configure monitor command + High: Tools: crm: the new configure node command + High: Tools: crm_mon - Prevent use-of-NULL when summarizing an orphan + High: Tools: hb2openais: create clvmd clone for respawn evmsd in ha.cf + High: Tools: hb2openais: fix a serious recursion bug in xml node processing + High: Tools: hb2openais: fix ocfs2 processing + High: Tools: pingd - prevent double free of getaddrinfo() output in error path + High: Tools: The default re-ping interval for pingd should be 1s not 1ms + Medium (bnc#479049): Tools: crm: add validation of resource type for the configure primitive command + Medium (bnc#479050): Tools: crm: add help for RA parameters in tab completion + Medium (bnc#479050): Tools: crm: add tab completion for primitive params/meta/op + Medium (bnc#479050): Tools: crm: reimplement cluster properties completion + Medium (bnc#486968): Tools: crm: listnodes function requires no parameters (do not mix completion with other stuff) + Medium: ais: Remove the ugly hack for dampening AIS membership changes + Medium: cib: Fix memory leaks by using mainloop_add_signal + Medium: cib: Move more logging to the debug level (was info) + Medium: cib: Overhaul the processing of synchronous replies + Medium: Core: Add library functions for instructing the cluster to terminate nodes + Medium: crmd: Add new expected-quorum-votes option + Medium: crmd: Allow up to 5 retires when an attrd update fails + Medium: crmd: Automatically detect and use new values for crm_config options + Medium: crmd: Bug bnc#490426 - Escalated shutdowns stall when there are pending resource operations + Medium: crmd: Clean up and optimize the DC election algorithm + Medium: crmd: Fix memory leak in shutdown + Medium: crmd: Fix memory leaks spotted by Valgrind + Medium: crmd: Ingore join messages from hosts other than our DC + Medium: crmd: Limit the scope of resource updates to the status section + Medium: crmd: Prevent the crmd from being respawned if its told to shut down when it did not ask to be + Medium: crmd: Re-check the election status after membership events + Medium: crmd: Send resource updates via the local CIB during elections + Medium: PE: Bug bnc#491441 - crm_mon does not display operations returning 'uninstalled' correctly + Medium: PE: Bug lf#2101 - For location constraints, role=Slave is equivalent to role=Started + Medium: PE: Clean up the API - removed ->children() and renamed ->find_child() to fine_rsc() + Medium: PE: Compress the display of healthy anonymous clones + Medium: PE: Correctly log the actions for resources that are being recovered + Medium: PE: Determin a promotion score for complex resources + Medium: PE: Ensure clones always have a value for globally-unique + Medium: PE: Prevent orphan clones from being allocated + Medium: RA: controld: Return proper exit code for stop op. + Medium: Tools: Bug bnc#482558 - Fix logging test in cluster_test + Medium: Tools: Bug bnc#482828 - Fix quoting in cluster_test logging setup + Medium: Tools: Bug bnc#482840 - Include directory path to CTSlab.py + Medium: Tools: crm: add more user input checks + Medium: Tools: crm: do not check resource status of we are working with a shadow + Medium: Tools: crm: fix id-refs and allow reference to top objects (i.e. primitive) + Medium: Tools: crm: ignore comments in the CIB + Medium: Tools: crm: multiple column output would not work with small lists + Medium: Tools: crm: refuse to delete running resources + Medium: Tools: crm: rudimentary if-else for templates + Medium: Tools: crm: Start/stop clones via target-role. + Medium: Tools: crm_mon - Compress the node status for healthy and offline nodes + Medium: Tools: crm_shadow - Return 0/cib_ok when --create-empty succeeds + Medium: Tools: crm_shadow - Support -e, the short form of --create-empty + Medium: Tools: Make attrd quieter + Medium: Tools: pingd - Avoid using various clplumbing functions as they seem to leak + Medium: Tools: Reduce pingd logging * Mon Feb 16 2009 Andrew Beekhof - 1.0.2-1 - Update source tarball to revision: d232d19daeb9 (stable-1.0) tip - Statistics: Changesets: 441 Diff: 639 files changed, 20871 insertions(+), 21594 deletions(-) - Changes since Pacemaker-1.0.1 + High (bnc#450815): Tools: crm cli: do not generate id for the operations tag + High: ais: Add support for the new AIS IPC layer + High: ais: Always set header.error to the correct default: SA_AIS_OK + High: ais: Bug BNC#456243 - Ensure the membership cache always contains an entry for the local node + High: ais: Bug BNC:456208 - Prevent deadlocks by not logging in the child process before exec() + High: ais: By default, disable supprt for the WIP openais IPC patch + High: ais: Detect and handle situations where ais and the crm disagree on the node name + High: ais: Ensure crm_peer_seq is updated after a membership update + High: ais: Make sure all IPC header fields are set to sane defaults + High: ais: Repair and streamline service load now that whitetank startup functions correctly + High: build: create and install doc files + High: cib: Allow clients without mainloop to connect to the cib + High: cib: CID:18 - Fix use-of-NULL in cib_perform_op + High: cib: CID:18 - Repair errors introduced in b5a18704477b - Fix use-of-NULL in cib_perform_op + High: cib: Ensure diffs contain the correct values of admin_epoch + High: cib: Fix four moderately sized memory leaks detected by Valgrind + High: Core: CID:10 - Prevent indexing into an array of schemas with a negative value + High: Core: CID:13 - Fix memory leak in log_data_element + High: Core: CID:15 - Fix memory leak in crm_get_peer + High: Core: CID:6 - Fix use-of-NULL in copy_ha_msg_input + High: Core: Fix crash in the membership code preventing node shutdown + High: Core: Fix more memory leaks foudn by valgrind + High: Core: Prevent unterminated strings after decompression + High: crmd: Bug BNC:467995 - Delay marking STONITH operations complete until STONITH tells us so + High: crmd: Bug LF:1962 - Do not NACK peers because they are not (yet) in our membership. Just ignore them. + High: crmd: Bug LF:2010 - Ensure fencing cib updates create the node_state entry if needed to preent re-fencing during cluster startup + High: crmd: Correctly handle reconnections to attrd + High: crmd: Ensure updates for lost migrate operations indicate which node it tried to migrating to + High: crmd: If there are no nodes to finalize, start an election. + High: crmd: If there are no nodes to welcome, start an election. + High: crmd: Prevent node attribute loss by detecting attrd disconnections immediately + High: crmd: Prevent node re-probe loops by ensuring manditory actions always complete + High: PE: Bug 2005 - Fix startup ordering of cloned stonith groups + High: PE: Bug 2006 - Correctly reprobe cloned groups + High: PE: Bug BNC:465484 - Fix the no-quorum-policy=suicide option + High: PE: Bug LF:1996 - Correctly process disabled monitor operations + High: PE: CID:19 - Fix use-of-NULL in determine_online_status + High: PE: Clones now default to globally-unique=false + High: PE: Correctly calculate the number of available nodes for the clone to use + High: PE: Only shoot online nodes with no-quorum-policy=suicide + High: PE: Prevent on-fail settings being ignored after a resource is successfully stopped + High: PE: Prevent use-of-NULL for failed migrate actions in process_rsc_state() + High: PE: Remove an optimization for the terminate node attribute that caused the cluster to block indefinitly + High: PE: Repar the ability to colocate based on node attributes other than uname + High: PE: Start the correct monitor operation for unmanaged masters + High: stonith: CID:3 - Fix another case of exceptionally poor error handling by the original stonith developers + High: stonith: CID:5 - Checking for NULL and then dereferencing it anyway is an interesting approach to error handling + High: stonithd: Sending IPC to the cluster is a privileged operation + High: stonithd: wrong checks for shmid (0 is a valid id) + High: Tools: attrd - Correctly determine when an attribute has stopped changing and should be committed to the CIB + High: Tools: Bug 2003 - pingd does not correctly detect failures when the interface is down + High: Tools: Bug 2003 - pingd does not correctly handle node-down events on multi-NIC systems + High: Tools: Bug 2021 - pingd does not detect sequence wrapping correctly, incorrectly reports nodes offline + High: Tools: Bug BNC:468066 - Do not use the result of uname() when its no longer in scope + High: Tools: Bug BNC:473265 - crm_resource -L dumps core + High: Tools: Bug LF:2001 - Transient node attributes should be set via attrd + High: Tools: Bug LF:2036 - crm_resource cannot set/get parameters for cloned resources + High: Tools: Bug LF:2046 - Node attribute updates are lost because attrd can take too long to start + High: Tools: Cause the correct clone instance to be failed with crm_resource -F + High: Tools: cluster_test - Allow the user to select a stack and fix CTS invocation + High: Tools: crm cli: allow rename only if the resource is stopped + High: Tools: crm cli: catch system errors on file operations + High: Tools: crm cli: completion for ids in configure + High: Tools: crm cli: drop '-rsc' from attributes for order constraint + High: Tools: crm cli: exit with an appropriate exit code + High: Tools: crm cli: fix wrong order of action and resource in order constraint + High: Tools: crm cli: fox wrong exit code + High: Tools: crm cli: improve handling of cib attributes + High: Tools: crm cli: new command: configure rename + High: Tools: crm cli: new command: configure upgrade + High: Tools: crm cli: new command: node delete + High: Tools: crm cli: prevent key errors on missing cib attributes + High: Tools: crm cli: print long help for help topics + High: Tools: crm cli: return on syntax error when parsing score + High: Tools: crm cli: rsc_location can be without nvpairs + High: Tools: crm cli: short node preference location constraint + High: Tools: crm cli: sometimes, on errors, level would change on single shot use + High: Tools: crm cli: syntax: drop a bunch of commas (remains of help tables conversion) + High: Tools: crm cli: verify user input for sanity + High: Tools: crm: find expressions within rules (do not always skip xml nodes due to used id) + High: Tools: crm_master should not define a set id now that attrd is used. Defining one can break lookups + High: Tools: crm_mon Use the OID assigned to the project by IANA for SNMP traps + Medium (bnc#445622): Tools: crm cli: improve the node show command and drop node status + Medium (LF 2009): stonithd: improve timeouts for remote fencing + Medium: ais: Allow dead peers to be removed from membership calculations + Medium: ais: Pass node deletion events on to clients + Medium: ais: Sanitize ipc usage + Medium: ais: Supply the node uname in addtion to the id + Medium: Build: Clean up configure to ensure NON_FATAL_CFLAGS is consistent with CFLAGS (ie. includes -g) + Medium: Build: Install cluster_test + Medium: Build: Use more restrictive CFLAGS and fix the resulting errors + Medium: cib: CID:20 - Fix potential use-after-free in cib_native_signon + Medium: Core: Bug BNC:474727 - Set a maximum time to wait for IPC messages + Medium: Core: CID:12 - Fix memory leak in decode_transition_magic error path + Medium: Core: CID:14 - Fix memory leak in calculate_xml_digest error path + Medium: Core: CID:16 - Fix memory leak in date_to_string error path + Medium: Core: Try to track down the cause of XML parsing errors + Medium: crmd: Bug BNC:472473 - Do not wait excessive amounts of time for lost actions + Medium: crmd: Bug BNC:472473 - Reduce the transition timeout to action_timeout+network_delay + Medium: crmd: Do not fast-track the processing of LRM refreshes when there are pending actions. + Medium: crmd: do_dc_join_filter_offer - Check the 'join' message is for the current instance before deciding to NACK peers + Medium: crmd: Find option values without having to do a config upgrade + Medium: crmd: Implement shutdown using a transient node attribute + Medium: crmd: Update the crmd options to use dashes instead of underscores + Medium: cts: Add 'cluster reattach' to the suite of automated regression tests + Medium: cts: cluster_test - Make some usability enhancements + Medium: CTS: cluster_test - suggest a valid port number + Medium: CTS: Fix python import order + Medium: cts: Implement an automated SplitBrain test + Medium: CTS: Remove references to deleted classes + Medium: Extra: Resources - Use HA_VARRUN instead of HA_RSCTMP for state files as Heartbeat removes HA_RSCTMP at startup + Medium: HB: Bug 1933 - Fake crmd_client_status_callback() calls because HB does not provide them for already running processes + Medium: PE: CID:17 - Fix memory leak in find_actions_by_task error path + Medium: PE: CID:7,8 - Prevent hypothetical use-of-NULL in LogActions + Medium: PE: Defer logging the actions performed on a resource until we have processed ordering constraints + Medium: PE: Remove the symmetrical attribute of colocation constraints + Medium: Resources: pingd - fix the meta defaults + Medium: Resources: Stateful - Add missing meta defaults + Medium: stonithd: exit if we the pid file cannot be locked + Medium: Tools: Allow attrd clients to specify the ID the attribute should be created with + Medium: Tools: attrd - Allow attribute updates to be performed from a hosts peer + Medium: Tools: Bug LF:1994 - Clean up crm_verify return codes + Medium: Tools: Change the pingd defaults to ping hosts once every second (instead of 5 times every 10 seconds) + Medium: Tools: cibmin - Detect resource operations with a view to providing email/snmp/cim notification + Medium: Tools: crm cli: add back symmetrical for order constraints + Medium: Tools: crm cli: generate role in location when converting from xml + Medium: Tools: crm cli: handle shlex exceptions + Medium: Tools: crm cli: keep order of help topics + Medium: Tools: crm cli: refine completion for ids in configure + Medium: Tools: crm cli: replace inf with INFINITY + Medium: Tools: crm cli: streamline cib load and parsing + Medium: Tools: crm cli: supply provider only for ocf class primitives + Medium: Tools: crm_mon - Add support for sending mail notifications of resource events + Medium: Tools: crm_mon - Include the DC version in status summary + Medium: Tools: crm_mon - Sanitize startup and option processing + Medium: Tools: crm_mon - switch to event-driven updates and add support for sending snmp traps + Medium: Tools: crm_shadow - Replace the --locate option with the saner --edit + Medium: Tools: hb2openais: do not remove Evmsd resources, but replace them with clvmd + Medium: Tools: hb2openais: replace crmadmin with crm_mon + Medium: Tools: hb2openais: replace the lsb class with ocf for o2cb + Medium: Tools: hb2openais: reuse code + Medium: Tools: LF:2029 - Display an error if crm_resource is used to reset the operation history of non-primitive resources + Medium: Tools: Make pingd resilient to attrd failures + Medium: Tools: pingd - fix the command line switches + Medium: Tools: Rename ccm_tool to crm_node * Tue Nov 18 2008 Andrew Beekhof - 1.0.1-1 - Update source tarball to revision: 6fc5ce8302ab (stable-1.0) tip - Statistics: Changesets: 170 Diff: 816 files changed, 7633 insertions(+), 6286 deletions(-) - Changes since Pacemaker-1.0.1 + High: ais: Allow the crmd to get callbacks whenever a node state changes + High: ais: Create an option for starting the mgmtd daemon automatically + High: ais: Ensure HA_RSCTMP exists for use by resource agents + High: ais: Hook up the openais.conf config logging options + High: ais: Zero out the PID of disconnecting clients + High: cib: Ensure global updates cause a disk write when appropriate + High: Core: Add an extra snaity check to getXpathResults() to prevent segfaults + High: Core: Do not redefine __FUNCTION__ unnecessarily + High: Core: Repair the ability to have comments in the configuration + High: crmd: Bug:1975 - crmd should wait indefinitely for stonith operations to complete + High: crmd: Ensure PE processing does not occur for all error cases in do_pe_invoke_callback + High: crmd: Requests to the CIB should cause any prior PE calculations to be ignored + High: heartbeat: Wait for membership 'up' events before removing stale node status data + High: PE: Bug LF:1988 - Ensure recurring operations always have the correct target-rc set + High: PE: Bug LF:1988 - For unmanaged resources we need to skip the usual can_run_resources() checks + High: PE: Ensure the terminate node attribute is handled correctly + High: PE: Fix optional colocation + High: PE: Improve up the detection of 'new' nodes joining the cluster + High: PE: Prevent assert failures in master_color() by ensuring unmanaged masters are always reallocated to their current location + High: Tools: crm cli: parser: return False on syntax error and None for comments + High: Tools: crm cli: unify template and edit commands + High: Tools: crm_shadow - Show more line number information after validation failures + High: Tools: hb2openais: add option to upgrade the CIB to v3.0 + High: Tools: hb2openais: add U option to getopts and update usage + High: Tools: hb2openais: backup improved and multiple fixes + High: Tools: hb2openais: fix class/provider reversal + High: Tools: hb2openais: fix testing + High: Tools: hb2openais: move the CIB update to the end + High: Tools: hb2openais: update logging and set logfile appropriately + High: Tools: LF:1969 - Attrd never sets any properties in the cib + High: Tools: Make attrd functional on OpenAIS + Medium: ais: Hook up the options for specifying the expected number of nodes and total quorum votes + Medium: ais: Look for pacemaker options inside the service block with 'name: pacemaker' instead of creating an addtional configuration block + Medium: ais: Provide better feedback when nodes change nodeids (in openais.conf) + Medium: cib: Always store cib contents on disk with num_updates=0 + Medium: cib: Ensure remote access ports are cleaned up on shutdown + Medium: crmd: Detect deleted resource operations automatically + Medium: crmd: Erase a nodes resource operations and transient attributes after a successful STONITH + Medium: crmd: Find a more appropriate place to update quorum and refresh attrd attributes + Medium: crmd: Fix the handling of unexpected PE exits to ensure the current CIB is stored + Medium: crmd: Fix the recording of pending operations in the CIB + Medium: crmd: Initiate an attrd refresh _after_ the status section has been fully repopulated + Medium: crmd: Only the DC should update quorum in an openais cluster + Medium: Ensure meta attributes are used consistantly + Medium: PE: Allow group and clone level resource attributes + Medium: PE: Bug N:437719 - Ensure scores from colocated resources count when allocating groups + Medium: PE: Prevent lsb scripts from being used in globally unique clones + Medium: PE: Make a best-effort guess at a migration threshold for people with 0.6 configs + Medium: Resources: controld - ensure we are part of a clone with globally_unique=false + Medium: Tools: attrd - Automatically refresh all attributes after a CIB replace operation + Medium: Tools: Bug LF:1985 - crm_mon - Correctly process failed cib queries to allow reconnection after cluster restarts + Medium: Tools: Bug LF:1987 - crm_verify incorrectly warns of configuration upgrades for the most recent version + Medium: Tools: crm (bnc#441028): check for key error in attributes management + Medium: Tools: crm_mon - display the meaning of the operation rc code instead of the status + Medium: Tools: crm_mon - Fix the display of timing data + Medium: Tools: crm_verify - check that we are being asked to validate a complete config + Medium: xml: Relax the restriction on the contents of rsc_locaiton.node * Thu Oct 16 2008 Andrew Beekhof - 1.0.0-1 - Update source tarball to revision: 388654dfef8f tip - Statistics: Changesets: 261 Diff: 3021 files changed, 244985 insertions(+), 111596 deletions(-) - Changes since f805e1b30103 + High: add the crm cli program + High: ais: Move the service id definition to a common location and make sure it is always used + High: build: rename hb2openais.sh to .in and replace paths with vars + High: cib: Implement --create for crm_shadow + High: cib: Remove dead files + High: Core: Allow the expected number of quorum votes to be configrable + High: Core: cl_malloc and friends were removed from Heartbeat + High: Core: Only call xmlCleanupParser() if we parsed anything. Doing so unconditionally seems to cause a segfault + High: hb2openais.sh: improve pingd handling; several bugs fixed + High: hb2openais: fix clone creation; replace EVMS strings + High: new hb2openais.sh conversion script + High: PE: Bug LF:1950 - Ensure the current values for all notification variables are always set (even if empty) + High: PE: Bug LF:1955 - Ensure unmanaged masters are unconditionally repromoted to ensure they are monitored correctly. + High: PE: Bug LF:1955 - Fix another case of filtering causing unmanaged master failures + High: PE: Bug LF:1955 - Umanaged mode prevents master resources from being allocated correctly + High: PE: Bug N:420538 - Anit-colocation caused a positive node preference + High: PE: Correctly handle unmanaged resources to prevent them from being started elsewhere + High: PE: crm_resource - Fix the --migrate command + High: PE: MAke stonith-enabled default to true and warn if no STONITH resources are found + High: PE: Make sure orphaned clone children are created correctly + High: PE: Monitors for unmanaged resources do not need to wait for start/promote/demote actions to complete + High: stonithd (LF 1951): fix remote stonith operations + High: stonithd: fix handling of timeouts + High: stonithd: fix logic for stonith resource priorities + High: stonithd: implement the fence-timeout instance attribute + High: stonithd: initialize value before reading fence-timeout + High: stonithd: set timeouts for fencing ops to the timeout of the start op + High: stonithd: stonith rsc priorities (new feature) + High: Tools: Add hb2openais - a tool for upgrading a Heartbeat cluster to use OpenAIS instead + High: Tools: crm_verify - clean up the upgrade logic to prevent crash on invalid configurations + High: Tools: Make pingd functional on Linux + High: Update version numbers for 1.0 candidates + Medium: ais: Add support for a synchronous call to retrieve the nodes nodeid + Medium: ais: Use the agreed service number + Medium: Build: Reliably detect heartbeat libraries during configure + Medium: Build: Supply prototypes for libreplace functions when needed + Medium: Build: Teach configure how to find corosync + Medium: Core: Provide better feedback if Pacemaker is started by a stack it does not support + Medium: crmd: Avoid calling GHashTable functions with NULL + Medium: crmd: Delay raising I_ERROR when the PE exits until we have had a chance to save the current CIB + Medium: crmd: Hook up the stonith-timeout option to stonithd + Medium: crmd: Prevent potential use-of-NULL in global_timer_callback + Medium: crmd: Rationalize the logging of graph aborts + Medium: PE: Add a stonith_timeout option and remove new options that are better set in rsc_defaults + Medium: PE: Allow external entities to ask for a node to be shot by creating a terminate=true transient node attribute + Medium: PE: Bug LF:1950 - Notifications do not contain all documented resource state fields + Medium: PE: Bug N:417585 - Do not restart group children whos individual score drops below zero + Medium: PE: Detect clients that disconnect before receiving their reply + Medium: PE: Implement a true maintenance mode + Medium: PE: Implement on-fail=standby for NTT. Derived from a patch by Satomi TANIGUCHI + Medium: PE: Print the correct message when stonith is disabled + Medium: PE: ptest - check the input is valid before proceeding + Medium: PE: Revert group stickiness to the 'old way' + Medium: PE: Use the correct attribute for action 'requires' (was prereq) + Medium: stonithd: Fix compilation without full heartbeat install + Medium: stonithd: exit with better code on empty host list + Medium: tools: Add a new regression test for CLI tools + Medium: tools: crm_resource - return with non-zero when a resource migration command is invalid + Medium: tools: crm_shadow - Allow the admin to start with an empty CIB (and no cluster connection) + Medium: xml: pacemaker-0.7 is now an alias for the 1.0 schema * Mon Sep 22 2008 Andrew Beekhof - 0.7.3-1 - Update source tarball to revision: 33e677ab7764+ tip - Statistics: Changesets: 133 Diff: 89 files changed, 7492 insertions(+), 1125 deletions(-) - Changes since f805e1b30103 + High: Tools: add the crm cli program + High: Core: cl_malloc and friends were removed from Heartbeat + High: Core: Only call xmlCleanupParser() if we parsed anything. Doing so unconditionally seems to cause a segfault + High: new hb2openais.sh conversion script + High: PE: Bug LF:1950 - Ensure the current values for all notification variables are always set (even if empty) + High: PE: Bug LF:1955 - Ensure unmanaged masters are unconditionally repromoted to ensure they are monitored correctly. + High: PE: Bug LF:1955 - Fix another case of filtering causing unmanaged master failures + High: PE: Bug LF:1955 - Umanaged mode prevents master resources from being allocated correctly + High: PE: Bug N:420538 - Anit-colocation caused a positive node preference + High: PE: Correctly handle unmanaged resources to prevent them from being started elsewhere + High: PE: crm_resource - Fix the --migrate command + High: PE: MAke stonith-enabled default to true and warn if no STONITH resources are found + High: PE: Make sure orphaned clone children are created correctly + High: PE: Monitors for unmanaged resources do not need to wait for start/promote/demote actions to complete + High: stonithd (LF 1951): fix remote stonith operations + High: Tools: crm_verify - clean up the upgrade logic to prevent crash on invalid configurations + Medium: ais: Add support for a synchronous call to retrieve the nodes nodeid + Medium: ais: Use the agreed service number + Medium: PE: Allow external entities to ask for a node to be shot by creating a terminate=true transient node attribute + Medium: PE: Bug LF:1950 - Notifications do not contain all documented resource state fields + Medium: PE: Bug N:417585 - Do not restart group children whos individual score drops below zero + Medium: PE: Implement a true maintenance mode + Medium: PE: Print the correct message when stonith is disabled + Medium: stonithd: exit with better code on empty host list + Medium: xml: pacemaker-0.7 is now an alias for the 1.0 schema * Wed Aug 20 2008 Andrew Beekhof - 0.7.1-1 - Update source tarball to revision: f805e1b30103+ tip - Statistics: Changesets: 184 Diff: 513 files changed, 43408 insertions(+), 43783 deletions(-) - Changes since 0.7.0-19 + Fix compilation when GNUTLS isnt found + High: admin: Fix use-after-free in crm_mon + High: Build: Remove testing code that prevented heartbeat-only builds + High: cib: Use single quotes so that the xpath queries for nvpairs will succeed + High: crmd: Always connect to stonithd when the TE starts and ensure we notice if it dies + High: crmd: Correctly handle a dead PE process + High: crmd: Make sure async-failures cause the failcount to be incrimented + High: PE: Bug LF:1941 - Handle failed clone instance probes when clone-max < #nodes + High: PE: Parse resource ordering sets correctly + High: PE: Prevent use-of-NULL - order->rsc_rh will not always be non-NULL + High: PE: Unpack colocation sets correctly + High: Tools: crm_mon - Prevent use-of-NULL for orphaned resources + Medium: ais: Add support for a synchronous call to retrieve the nodes nodeid + Medium: ais: Allow transient clients to receive membership updates + Medium: ais: Avoid double-free in error path + Medium: ais: Include in the mebership nodes for which we have not determined their hostname + Medium: ais: Spawn the PE from the ais plugin instead of the crmd + Medium: cib: By default, new configurations use the latest schema + Medium: cib: Clean up the CIB if it was already disconnected + Medium: cib: Only incriment num_updates if something actually changed + Medium: cib: Prevent use-after-free in client after abnormal termination of the CIB + Medium: Core: Fix memory leak in xpath searches + Medium: Core: Get more details regarding parser errors + Medium: Core: Repair expand_plus_plus - do not call char2score on unexpanded values + Medium: Core: Switch to the libxml2 parser - its significantly faster + Medium: Core: Use a libxml2 library function for xml -> text conversion + Medium: crmd: Asynchronous failure actions have no parameters + Medium: crmd: Avoid calling glib functions with NULL + Medium: crmd: Do not allow an election to promote a node from S_STARTING + Medium: crmd: Do not vote if we have not completed the local startup + Medium: crmd: Fix te_update_diff() now that get_object_root() functions differently + Medium: crmd: Fix the lrmd xpath expressions to not contain quotes + Medium: crmd: If we get a join offer during an election, better restart the election + Medium: crmd: No further processing is needed when using the LRMs API call for failing resources + Medium: crmd: Only update have-quorum if the value changed + Medium: crmd: Repair the input validation logic in do_te_invoke + Medium: cts: CIBs can no longer contain comments + Medium: cts: Enable a bunch of tests that were incorrectly disabled + Medium: cts: The libxml2 parser wont allow v1 resources to use integers as parameter names + Medium: Do not use the cluster UID and GID directly. Look them up based on the configured value of HA_CCMUSER + Medium: Fix compilation when heartbeat is not supported + Medium: PE: Allow groups to be involved in optional ordering constraints + Medium: PE: Allow sets of operations to be reused by multiple resources + Medium: PE: Bug LF:1941 - Mark extra clone instances as orphans and do not show inactive ones + Medium: PE: Determin the correct migration-threshold during resource expansion + Medium: PE: Implement no-quorum-policy=suicide (FATE #303619) + Medium: pengine: Clean up resources after stopping old copies of the PE + Medium: pengine: Teach the PE how to stop old copies of itself + Medium: Tools: Backport hb_report updates + Medium: Tools: cib_shadow - On create, spawn a new shell with CIB_shadow and PS1 set accordingly + Medium: Tools: Rename cib_shadow to crm_shadow * Fri Jul 18 2008 Andrew Beekhof - 0.7.0-19 - Update source tarball to revision: 007c3a1c50f5 (unstable) tip - Statistics: Changesets: 108 Diff: 216 files changed, 4632 insertions(+), 4173 deletions(-) - Changes added since unstable-0.7 + High: admin: Fix use-after-free in crm_mon + High: ais: Change the tag for the ais plugin to "pacemaker" (used in openais.conf) + High: ais: Log terminated processes as an error + High: cib: Performance - Reorganize things to avoid calculating the XML diff twice + High: PE: Bug LF:1941 - Handle failed clone instance probes when clone-max < #nodes + High: PE: Fix memory leak in action2xml + High: PE: Make OCF_ERR_ARGS a node-level error rather than a cluster-level one + High: PE: Properly handle clones that are not installed on all nodes + Medium: admin: cibadmin - Show any validation errors if the upgrade failed + Medium: admin: cib_shadow - Implement --locate to display the underlying filename + Medium: admin: cib_shadow - Implement a --diff option + Medium: admin: cib_shadow - Implement a --switch option + Medium: admin: crm_resource - create more compact constraints that do not use lifetime (which is deprecated) + Medium: ais: Approximate born_on for OpenAIS based clusters + Medium: cib: Remove do_id_check, it is a poor substitute for ID validation by a schema + Medium: cib: Skip construction of pre-notify messages if no-one wants one + Medium: Core: Attempt to streamline some key functions to increase performance + Medium: Core: Clean up XML parser after validation + Medium: crmd: Detect and optimize the CRMs behavior when processing diffs of an LRM refresh + Medium: Fix memory leaks when resetting the name of an XML object + Medium: PE: Prefer the current location if it is one of a group of nodes with the same (highest) score * Wed Jun 25 2008 Andrew Beekhof - 0.7.0-1 - Update source tarball to revision: bde0c7db74fb tip - Statistics: Changesets: 439 Diff: 676 files changed, 41310 insertions(+), 52071 deletions(-) - Changes added since stable-0.6 + High: A new tool for setting up and invoking CTS + High: Admin: All tools now use --node (-N) for specifying node unames + High: Admin: All tools now use --xml-file (-x) and --xml-text (-X) for specifying where to find XML blobs + High: cib: Cleanup the API - remove redundant input fields + High: cib: Implement CIB_shadow - a facility for making and testing changes before uploading them to the cluster + High: cib: Make registering per-op callbacks an API call and renamed (for clarity) the API call for requesting notifications + High: Core: Add a facility for automatically upgrading old configurations + High: Core: Adopt libxml2 as the XML processing library - all external clients need to be recompiled + High: Core: Allow sending TLS messages larger than the MTU + High: Core: Fix parsing of time-only ISO dates + High: Core: Smarter handling of XML values containing quotes + High: Core: XML memory corruption - catch, and handle, cases where we are overwriting an attribute value with itself + High: Core: The xml ID type does not allow UUIDs that start with a number + High: Core: Implement XPath based versions of query/delete/replace/modify + High: Core: Remove some HA2.0.(3,4) compatability code + High: crmd: Overhaul the detection of nodes that are starting vs. failed + High: PE: Bug LF:1459 - Allow failures to expire + High: PE: Have the PE do non-persistent configuration upgrades before performing calculations + High: PE: Replace failure-stickiness with a simple 'migration-threshold' + High: TE: Simplify the design by folding the tengine process into the crmd + Medium: Admin: Bug LF:1438 - Allow the list of all/active resource operations to be queried by crm_resource + Medium: Admin: Bug LF:1708 - crm_resource should print a warning if an attribute is already set as a meta attribute + Medium: Admin: Bug LF:1883 - crm_mon should display fail-count and operation history + Medium: Admin: Bug LF:1883 - crm_mon should display operation timing data + Medium: Admin: Bug N:371785 - crm_resource -C does not also clean up fail-count attributes + Medium: Admin: crm_mon - include timing data for failed actions + Medium: ais: Read options from the environment since objdb is not completely usable yet + Medium: cib: Add sections for op_defaults and rsc_defaults + Medium: cib: Better matching notification callbacks (for detecting duplicates and removal) + Medium: cib: Bug LF:1348 - Allow rules and attribute sets to be referenced for use in other objects + Medium: cib: BUG LF:1918 - By default, all cib calls now timeout after 30s + Medium: cib: Detect updates that decrease the version tuple + Medium: cib: Implement a client-side operation timeout - Requires LHA update + Medium: cib: Implement callbacks and async notifications for remote connections + Medium: cib: Make cib->cmds->update() an alias for modify at the API level (also implemented in cibadmin) + Medium: cib: Mark the CIB as disconnected if the IPC connection is terminated + Medium: cib: New call option 'cib_can_create' which can be passed to modify actions - allows the object to be created if it does not exist yet + Medium: cib: Reimplement get|set|delete attributes using XPath + Medium: cib: Remove some useless parts of the API + Medium: cib: Remove the 'attributes' scaffolding from the new format + Medium: cib: Implement the ability for clients to connect to remote servers + Medium: Core: Add support for validating xml against RelaxNG schemas + Medium: Core: Allow more than one item to be modified/deleted in XPath based operations + Medium: Core: Fix the sort_pairs function for creating sorted xml objects + Medium: Core: iso8601 - Implement subtract_duration and fix subtract_time + Medium: Core: Reduce the amount of xml copying occuring + Medium: Core: Support value='value+=N' XML updates (in addtion to value='value++') + Medium: crmd: Add support for lrm_ops->fail_rsc if its available + Medium: crmd: HB - watch link status for node leaving events + Medium: crmd: Bug LF:1924 - Improved handling of lrmd disconnects and shutdowns + Medium: crmd: Do not wait for actions with a start_delay over 5 minutes. Confirm them immediately + Medium: PE: Bug LF:1328 - Do not fencing nodes in clusters without managed resources + Medium: PE: Bug LF:1461 - Give transient node attributes (in ) preference over persistent ones (in ) + Medium: PE: Bug LF:1884, Bug LF:1885 - Implement N:M ordering and colocation constraints + Medium: PE: Bug LF:1886 - Create a resource and operation 'defaults' config section + Medium: PE: Bug LF:1892 - Allow recurring actions to be triggered at known times + Medium: PE: Bug LF:1926 - Probes should complete before stop actions are invoked + Medium: PE: Fix the standby when its set as a transient attribute + Medium: PE: Implement a global 'stop-all-resources' option + Medium: PE: Implement cibpipe, a tool for performing/simulating config changes "offline" + Medium: PE: We do not allow colocation with specific clone instances + Medium: Tools: pingd - Implement a stack-independant version of pingd + Medium: xml: Ship an xslt for upgrading from 0.6 to 0.7 * Thu Jun 19 2008 Andrew Beekhof - 0.6.5-1 - Update source tarball to revision: b9fe723d1ac5 tip - Statistics: Changesets: 48 Diff: 37 files changed, 1204 insertions(+), 234 deletions(-) - Changes since Pacemaker-0.6.4 + High: Admin: Repair the ability to delete failcounts + High: ais: Audit IPC handling between the AIS plugin and CRM processes + High: ais: Have the plugin create needed /var/lib directories + High: ais: Make sure the sync and async connections are assigned correctly (not swapped) + High: cib: Correctly detect configuration changes - num_updates does not count + High: PE: Apply stickiness values to the whole group, not the individual resources + High: PE: Bug N:385265 - Ensure groups are migrated instead of remaining partially active on the current node + High: PE: Bug N:396293 - Enforce manditory group restarts due to ordering constraints + High: PE: Correctly recover master instances found active on more than one node + High: PE: Fix memory leaks reported by Valgrind + Medium: Admin: crm_mon - Misc improvements from Satomi Taniguchi + Medium: Bug LF:1900 - Resource stickiness should not allow placement in asynchronous clusters + Medium: crmd: Ensure joins are completed promptly when a node taking part dies + Medium: PE: Avoid clone instance shuffling in more cases + Medium: PE: Bug LF:1906 - Remove an optimization in native_merge_weights() causing group scores to behave eratically + Medium: PE: Make use of target_rc data to correctly process resource operations + Medium: PE: Prevent a possible use of NULL in sort_clone_instance() + Medium: TE: Include target rc in the transition key - used to correctly determin operation failure * Thu May 22 2008 Andrew Beekhof - 0.6.4-1 - Update source tarball to revision: 226d8e356924 tip - Statistics: Changesets: 55 Diff: 199 files changed, 7103 insertions(+), 12378 deletions(-) - Changes since Pacemaker-0.6.3 + High: crmd: Bug LF:1881 LF:1882 - Overhaul the logic for operation cancelation and deletion + High: crmd: Bug LF:1894 - Make sure cancelled recurring operations are cleaned out from the CIB + High: PE: Bug N:387749 - Colocation with clones causes unnecessary clone instance shuffling + High: PE: Ensure 'master' monitor actions are cancelled _before_ we demote the resource + High: PE: Fix assert failure leading to core dump - make sure variable is properly initialized + High: PE: Make sure 'slave' monitoring happens after the resource has been demoted + High: PE: Prevent failure stickiness underflows (where too many failures become a _positive_ preference) + Medium: Admin: crm_mon - Only complain if the output file could not be opened + Medium: Common: filter_action_parameters - enable legacy handling only for older versions + Medium: PE: Bug N:385265 - The failure stickiness of group children is ignored until it reaches -INFINITY + Medium: PE: Implement master and clone colocation by exlcuding nodes rather than setting ones score to INFINITY (similar to cs: 756afc42dc51) + Medium: TE: Bug LF:1875 - Correctly find actions to cancel when their node leaves the cluster * Wed Apr 23 2008 Andrew Beekhof - 0.6.3-1 - Update source tarball to revision: fd8904c9bc67 tip - Statistics: Changesets: 117 Diff: 354 files changed, 19094 insertions(+), 11338 deletions(-) - Changes since Pacemaker-0.6.2 + High: Admin: Bug LF:1848 - crm_resource - Pass set name and id to delete_resource_attr() in the correct order + High: Build: SNMP has been moved to the management/pygui project + High: crmd: Bug LF1837 - Unmanaged resources prevent crmd from shutting down + High: crmd: Prevent use-after-free in lrm interface code (Patch based on work by Keisuke MORI) + High: PE: Allow the cluster to make progress by not retrying failed demote actions + High: PE: Anti-colocation with slave should not prevent master colocation + High: PE: Bug LF 1768 - Wait more often for STONITH ops to complete before starting resources + High: PE: Bug LF1836 - Allow is-managed-default=false to be overridden by individual resources + High: PE: Bug LF185 - Prevent pointless master/slave instance shuffling by ignoring the master-pref of stopped instances + High: PE: Bug N-191176 - Implement interleaved ordering for clone-to-clone scenarios + High: PE: Bug N-347004 - Ensure clone notifications are always sent when an instance is stopped/started + High: PE: Bug N-347004 - Include notification ordering is correct for interleaved clones + High: PE: Bug PM-11 - Directly link probe_complete to starting clone instances + High: PE: Bug PM1 - Fix setting failcounts when applied to complex resources + High: PE: Bug PM12, LF1648 - Extensive revision of group ordering + High: PE: Bug PM7 - Ensure masters are always demoted before they are stopped + High: PE: Create probes after allocation to allow smarter handling of anonymous clones + High: PE: Do not prioritize clone instances that must be moved + High: PE: Fix error in previous commit that allowed more than the required number of masters to be promoted + High: PE: Group start ordering fixes + High: PE: Implement promote/demote ordering for cloned groups + High: TE: Repair failcount updates + High: TE: Use the correct offset when updating failcount + Medium: Admin: Add a summary output that can be easily parsed by CTS for audit purposes + Medium: Build: Make configure fail if bz2 or libxml2 are not present + Medium: Build: Re-instate a better default for LCRSODIR + Medium: CIB: Bug LF-1861 - Filter irrelvant error status from synchronous CIB clients + Medium: Core: Bug 1849 - Invalid conversion of ordinal leap year to gregorian date + Medium: Core: Drop compataibility code for 2.0.4 and 2.0.5 clusters + Medium: crmd: Bug LF-1860 - Automatically cancel recurring ops before demote and promote operations (not only stops) + Medium: crmd: Save the current CIB contents if we detect the PE crashed + Medium: PE: Bug LF:1866 - Fix version check when applying compatability handling for failed start operations + Medium: PE: Bug LF:1866 - Restore the ability to have start failures not be fatal + Medium: PE: Bug PM1 - Failcount applies to all instances of non-unique clone + Medium: PE: Correctly set the state of partially active master/slave groups + Medium: PE: Do not claim to be stopping an already stopped orphan + Medium: PE: Ensure implies_left ordering constraints are always effective + Medium: PE: Indicate each resources 'promotion' score + Medium: PE: Prevent a possible use-of-NULL + Medium: PE: Reprocess the current action if it changed (so that any prior dependancies are updated) + Medium: TE: Bug LF-1859 - Wait for fail-count updates to complete before terminating the transition + Medium: TE: Bug LF:1859 - Do not abort graphs due to our own failcount updates + Medium: TE: Bug LF:1859 - Prevent the TE from interupting itself * Thu Feb 14 2008 Andrew Beekhof - 0.6.2-1 - Update source tarball to revision: 28b1a8c1868b tip - Statistics: Changesets: 11 Diff: 7 files changed, 58 insertions(+), 18 deletions(-) - Changes since Pacemaker-0.6.1 + haresources2cib.py: set default-action-timeout to the default (20s) + haresources2cib.py: update ra parameters lists + Medium: SNMP: Allow the snmp subagent to be built (patch from MATSUDA, Daiki) + Medium: Tools: Make sure the autoconf variables in haresources2cib are expanded * Tue Feb 12 2008 Andrew Beekhof - 0.6.1-1 - Update source tarball to revision: e7152d1be933 tip - Statistics: Changesets: 25 Diff: 37 files changed, 1323 insertions(+), 227 deletions(-) - Changes since Pacemaker-0.6.0 + High: CIB: Ensure changes to top-level attributes (like admin_epoch) cause a disk write + High: CIB: Ensure the archived file hits the disk before returning + High: CIB: Repair the ability to do 'atomic incriment' updates (value="value++") + High: crmd: Bug #7 - Connecting to the crmd immediately after startup causes use-of-NULL + Medium: CIB: Mask cib_diff_resync results from the caller - they do not need to know + Medium: crmd: Delay starting the IPC server until we are fully functional + Medium: CTS: Fix the startup patterns + Medium: PE: Bug 1820 - Allow the first resource in a group to be migrated + Medium: PE: Bug 1820 - Check the colocation dependancies of resources to be migrated * Mon Jan 14 2008 Andrew Beekhof - 0.6.0-2 - This is the first release of the Pacemaker Cluster Resource Manager formerly part of Heartbeat. - For those looking for the GUI, mgmtd, CIM or TSA components, they are now found in the new pacemaker-pygui project. Build dependancies prevent them from being included in Heartbeat (since the built-in CRM is no longer supported) and, being non-core components, are not included with Pacemaker. - Update source tarball to revision: c94b92d550cf - Statistics: Changesets: 347 Diff: 2272 files changed, 132508 insertions(+), 305991 deletions(-) - Test hardware: + 6-node vmware cluster (sles10-sp1/256Mb/vmware stonith) on a single host (opensuse10.3/2Gb/2.66Ghz Quad Core2) + 7-node EMC Centera cluster (sles10/512Mb/2Ghz Xeon/ssh stonith) - Notes: Heartbeat Stack + All testing was performed with STONITH enabled + The CRM was enabled using the "crm respawn" directive - Notes: OpenAIS Stack + This release contains a preview of support for the OpenAIS cluster stack + The current release of the OpenAIS project is missing two important patches that we require. OpenAIS packages containing these patches are available for most major distributions at: http://download.opensuse.org/repositories/server:/ha-clustering + The OpenAIS stack is not currently recommended for use in clusters that have shared data as STONITH support is not yet implimented + pingd is not yet available for use with the OpenAIS stack + 3 significant OpenAIS issues were found during testing of 4 and 6 node clusters. We are activly working together with the OpenAIS project to get these resolved. - Pending bugs encountered during testing: + OpenAIS #1736 - Openais membership took 20s to stabilize + Heartbeat #1750 - ipc_bufpool_update: magic number in head does not match + OpenAIS #1793 - Assertion failure in memb_state_gather_enter() + OpenAIS #1796 - Cluster message corruption - Changes since Heartbeat-2.1.2-24 + High: Add OpenAIS support + High: Admin: crm_uuid - Look in the right place for Heartbeat UUID files + High: admin: Exit and indicate a problem if the crmd exits while crmadmin is performing a query + High: cib: Fix CIB_OP_UPDATE calls that modify the whole CIB + High: cib: Fix compilation when supporting the heartbeat stack + High: cib: Fix memory leaks caused by the switch to get_message_xml() + High: cib: HA_VALGRIND_ENABLED needs to be set _and_ set to 1|yes|true + High: cib: Use get_message_xml() in preference to cl_get_struct() + High: cib: Use the return value from call to write() in cib_send_plaintext() + High: Core: ccm nodes can legitimately have a node id of 0 + High: Core: Fix peer-process tracking for the Heartbeat stack + High: Core: Heartbeat does not send status notifications for nodes that were already part of the cluster. Fake them instead + High: CRM: Add children to HA_Messages such that the field name matches F_XML_TAGNAME + High: crm: Adopt a more flexible appraoch to enabling Valgrind + High: crm: Fix compilation when bzip2 is not installed + High: CRM: Future-proof get_message_xml() + High: crmd: Filter election responses based on time not FSA state + High: crmd: Handle all possible peer states in crmd_ha_status_callback() + High: crmd: Make sure the current date/time is set - prevents use-of-NULL when evaluating rules + High: crmd: Relax an assertion regrading ccm membership instances + High: crmd: Use (node->processes&crm_proc_ais) to accurately update the CIB after replace operations + High: crmd: Heartbeat: Accurately record peer client status + High: PE: Bug 1777 - Allow colocation with a resource in the Stopped state + High: PE: Bug 1822 - Prevent use-of-NULL in PromoteRsc() + High: PE: Implement three recovery policies based on op_status and op_rc + High: PE: Parse fail-count correctly (it may be set to ININFITY) + High: PE: Prevent graph-loop when stonith agents need to be moved around before a STONITH op + High: PE: Prevent graph-loops when two operations have the same name+interval + High: te: Cancel active timers when destroying graphs + High: TE: Ensure failcount is set correctly for failed stops/starts + High: TE: Update failcount for oeprations that time out + Medium: admin: Prevent hang in crm_mon -1 when there is no cib connection - Patch from Junko IKEDA + Medium: cib: Require --force|-f when performing potentially dangerous commands with cibadmin + Medium: cib: Tweak the shutdown code + Medium: Common: Only count peer processes of active nodes + Medium: Core: Create generic cluster sign-in method + Medium: core: Fix compilation when Heartbeat support is disabled + Medium: Core: General cleanup for supporting two stacks + Medium: Core: iso6601 - Support parsing of time-only strings + Medium: core: Isolate more code that is only needed when SUPPORT_HEARTBEAT is enabled + Medium: crm: Improved logging of errors in the XML parser + Medium: crmd: Fix potential use-of-NULL in string comparison + Medium: crmd: Reimpliment syncronizing of CIB queries and updates when invoking the PE + Medium: crm_mon: Indicate when a node is both in standby mode and offline + Medium: PE: Bug 1822 - Do not try an promote groups if not all of it is active + Medium: PE: on_fail=nothing is an alias for 'ignore' not 'restart' + Medium: PE: Prevent a potential use-of-NULL in cron_range_satisfied() + snmp subagent: fix a problem on displaying an unmanaged group + snmp subagent: use the syslog setting + snmp: v2 support (thanks to Keisuke MORI) + snmp_subagent - made it not complain about some things if shutting down * Mon Dec 10 2007 Andrew Beekhof - 0.6.0-1 - Initial opensuse package check-in diff --git a/tools/Makefile.am b/tools/Makefile.am index 4bf73ff09c..c1f976cb59 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,147 +1,148 @@ # # Copyright (C) 2004-2009 Andrew Beekhof # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl COMMONLIBS = \ $(top_builddir)/lib/common/libcrmcommon.la \ $(top_builddir)/lib/cib/libcib.la \ $(CURSESLIBS) $(CLUSTERLIBS) headerdir = $(pkgincludedir)/crm header_HEADERS = attrd.h +pcmkdir = $(datadir)/$(PACKAGE) +pcmk_DATA = report.common report.collector + +sbin_SCRIPTS = crm_report crm_standby crm_master crm_failcount EXTRA_DIST = $(sbin_SCRIPTS) halibdir = $(CRM_DAEMON_DIR) halib_SCRIPTS = hb2openais.sh halib_PROGRAMS = attrd pingd halib_PYTHON = crm_primitive.py hb2openais-helper.py sbin_PROGRAMS = crm_simulate crmadmin cibadmin crm_node crm_attribute crm_resource crm_verify \ crm_uuid crm_shadow attrd_updater crm_diff crm_mon iso8601 testdir = $(datadir)/$(PACKAGE)/tests/cli test_SCRIPTS = regression.sh test_DATA = regression.exp if BUILD_SERVICELOG sbin_PROGRAMS += notifyServicelogEvent endif if BUILD_OPENIPMI_SERICELOG sbin_PROGRAMS += ipmiservicelogd endif if BUILD_HELP -man8_MANS = $(sbin_PROGRAMS:%=%.8) +man8_MANS = $(sbin_PROGRAMS:%=%.8) crm_report.8 endif -sbin_SCRIPTS = crm_standby crm_master crm_failcount -#sbin_SCRIPTS = crm crm_standby crm_master crm_failcount - ## SOURCES -#noinst_HEADERS = config.h control.h crmd.h noinst_HEADERS = crmadmin_SOURCES = crmadmin.c crmadmin_LDADD = $(COMMONLIBS) $(CLUSTERLIBS) \ $(top_builddir)/lib/pengine/libpe_status.la crm_uuid_SOURCES = crm_uuid.c crm_uuid_LDADD = $(top_builddir)/lib/common/libcrmcluster.la cibadmin_SOURCES = cibadmin.c cibadmin_LDADD = $(COMMONLIBS) crm_shadow_SOURCES = cib_shadow.c crm_shadow_LDADD = $(COMMONLIBS) crm_node_SOURCES = ccm_epoche.c crm_node_LDADD = $(COMMONLIBS) $(CLUSTERLIBS) \ $(top_builddir)/lib/common/libcrmcluster.la crm_simulate_SOURCES = crm_inject.c crm_simulate_CFLAGS = -I$(top_srcdir)/pengine crm_simulate_LDADD = $(COMMONLIBS) \ $(top_builddir)/lib/pengine/libpe_status.la \ $(top_builddir)/pengine/libpengine.la \ $(top_builddir)/lib/cib/libcib.la \ $(top_builddir)/lib/transition/libtransitioner.la crm_diff_SOURCES = xml_diff.c crm_diff_LDADD = $(COMMONLIBS) crm_mon_SOURCES = crm_mon.c crm_mon_LDADD = $(COMMONLIBS) $(SNMPLIBS) $(ESMTPLIBS) -llrm \ $(top_builddir)/lib/pengine/libpe_status.la # Arguments could be made that this should live in crm/pengine crm_verify_SOURCES = crm_verify.c crm_verify_LDADD = $(COMMONLIBS) \ $(top_builddir)/lib/pengine/libpe_status.la \ $(top_builddir)/pengine/libpengine.la crm_attribute_SOURCES = crm_attribute.c crm_attribute_LDADD = $(COMMONLIBS) crm_resource_SOURCES = crm_resource.c crm_resource_LDADD = $(COMMONLIBS) \ $(top_builddir)/lib/pengine/libpe_rules.la \ $(top_builddir)/lib/pengine/libpe_status.la \ $(top_builddir)/pengine/libpengine.la iso8601_SOURCES = test.iso8601.c iso8601_LDADD = $(COMMONLIBS) attrd_SOURCES = attrd.c attrd_LDADD = $(COMMONLIBS) $(top_builddir)/lib/common/libcrmcluster.la pingd_SOURCES = pingd.c pingd_LDADD = $(COMMONLIBS) attrd_updater_SOURCES = attrd_updater.c attrd_updater_LDADD = $(COMMONLIBS) if BUILD_SERVICELOG notifyServicelogEvent_SOURCES = notifyServicelogEvent.c notifyServicelogEvent_CFLAGS = `pkg-config --cflags servicelog-1` notifyServicelogEvent_LDFLAGS = `pkg-config --libs servicelog-1` $(top_builddir)/lib/common/libcrmcommon.la endif if BUILD_OPENIPMI_SERICELOG ipmiservicelogd_SOURCES = ipmiservicelogd.c ipmiservicelogd_CFLAGS = `pkg-config --cflags OpenIPMI OpenIPMIposix servicelog-1` ipmiservicelogd_LDFLAGS = `pkg-config --libs OpenIPMI OpenIPMIposix servicelog-1` $(top_builddir)/lib/common/libcrmcommon.la endif %.8: % echo Creating $@ + chmod a+x $< help2man --output $@ --no-info --section 8 --name "Part of the Pacemaker cluster resource manager" $(top_builddir)/tools/$< clean-generic: rm -f *.log *.debug *.xml *~ install-exec-local: uninstall-local: .PHONY: install-exec-hook diff --git a/tools/crm_report.in b/tools/crm_report.in new file mode 100755 index 0000000000..9e718d814a --- /dev/null +++ b/tools/crm_report.in @@ -0,0 +1,383 @@ +#!/bin/sh + + # Copyright (C) 2010 Andrew Beekhof + # + # This program is free software; you can redistribute it and/or + # modify it under the terms of the GNU General Public + # License as published by the Free Software Foundation; either + # version 2.1 of the License, or (at your option) any later version. + # + # This software is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + # General Public License for more details. + # + # You should have received a copy of the GNU General Public + # License along with this library; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # + + +# Note the quotes around `$TEMP': they are essential! +TEMP=`getopt \ + -o hv?xl:f:t:n:T:Lpc:dSACHu:MV \ + --long help,cts:,node:,nodes:,from:,to:logfile:,as-directory,single-node,cluster:,user:,version \ + -n 'pcmk_report' -- "$@"` +eval set -- "$TEMP" + +times="" +tests="" +nodes="" +compress=1 +cluster="any" +ssh_user="root" +search_logs=1 +report_data=`dirname $0` + + +extra_logs="" +sanitize_patterns="passw.*" +log_patterns="CRIT: ERROR:" + +# Prefer helpers in the same directory if they exist, to simplify development +if [ ! -f $report_data/report.common ]; then + report_data=@datadir@/@PACKAGE@ +else + echo "Using local helpers" +fi + +. $report_data/report.common + +usage() { + +cat< "$HALOG_F" + fi + + cat<$l_base/.env +LABEL="$label" +REPORT_HOME="$r_base" +REPORT_MASTER="$host" +LOG_START=$start +LOG_END=$end +REMOVE=1 +SANITIZE="$sanitize_patterns" +CLUSTER=$cluster +LOG_PATTERNS="$log_patterns" +EXTRA_LOGS="$extra_logs" +SEARCH_LOGS=$search_logs +verbose=$verbose +EOF + + for node in $nodes; do + if [ `uname -n` = $node ]; then + cat $l_base/.env $report_data/report.common $report_data/report.collector > $r_base/collector + bash $r_base/collector + else + cat $l_base/.env $report_data/report.common $report_data/report.collector \ + | ssh -l $ssh_user -T $node -- "mkdir -p $r_base; cat > $r_base/collector; bash $r_base/collector" | (cd $l_base && tar xf -) + fi + done + + analyze $l_base > $l_base/$ANALYSIS_F + if [ -f $l_base/$HALOG_F ]; then + node_events $destdir/$HALOG_F > $destdir/$EVENTS_F + fi + + for node in $nodes; do + cat $l_base/$node/$ANALYSIS_F >> $l_base/$ANALYSIS_F + if [ -s $l_base/$node/$EVENTS_F ]; then + cat $l_base/$node/$EVENTS_F >> $l_base/$EVENTS_F + elif [ -s $l_base/$HALOG_F ]; then + awk "\$4==\"$nodes\"" $l_base/$EVENTS_F >> $l_base/$n/$EVENTS_F + fi + done + + log " " + if [ $compress = 1 ]; then + fname=`shrink $l_base` + rm -rf $l_base + log "Collected results are available in $fname" + log " " + log "Please create a bug entry at" + log " http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker" + log "Include a description of your problem and attach this tarball" + log " " + log "Thank you for taking time to create this report." + else + log "Collected results are available in $l_base" + fi + log " " +} + +# +# check if files have same content in the cluster +# +cibdiff() { + d1=`dirname $1` + d2=`dirname $2` + if [ -f $d1/RUNNING -a -f $d2/RUNNING ] || + [ -f $d1/STOPPED -a -f $d2/STOPPED ]; then + if which crm_diff > /dev/null 2>&1; then + crm_diff -c -n $1 -o $2 + else + info "crm_diff(8) not found, cannot diff CIBs" + fi + else + echo "can't compare cibs from running and stopped systems" + fi +} + +diffcheck() { + [ -f "$1" ] || { + echo "$1 does not exist" + return 1 + } + [ -f "$2" ] || { + echo "$2 does not exist" + return 1 + } + case `basename $1` in + $CIB_F) cibdiff $1 $2;; + $B_CONF) diff -u $1 $2;; # confdiff? + *) diff -u $1 $2;; +esac +} + +# +# remove duplicates if files are same, make links instead +# +consolidate() { + for n in $NODES; do + if [ -f $1/$2 ]; then + rm $1/$n/$2 + else + mv $1/$n/$2 $1 + fi + ln -s ../$2 $1/$n + done +} + +analyze_one() { + rc=0 + node0="" + for n in $NODES; do + if [ "$node0" ]; then + diffcheck $1/$node0/$2 $1/$n/$2 + rc=$(($rc+$?)) + else + node0=$n + fi + done + return $rc +} + +analyze() { + flist="$HOSTCACHE $MEMBERSHIP_F $CIB_F $CRM_MON_F $B_CONF logd.cf $SYSINFO_F" + for f in $flist; do + printf "Diff $f... " + ls $1/*/$f >/dev/null 2>&1 || { + echo "no $1/*/$f :/" + continue + } + if analyze_one $1 $f; then + echo "OK" + [ "$f" != $CIB_F ] && consolidate $1 $f + else + echo "" + fi + done +} + +do_cts() { + ctslog=`findmsg 1 "CTS: Stack:"` + if [ x$ctslog = x ]; then + fatal "No CTS control file detected" + fi + + if [ -z "$nodes" ]; then + debug "Using CTS control file: $ctslog" + nodes=`grep CTS: $ctslog | grep -v debug: | grep " \* " | sed s:.*\\\*::g | sort -u | tr '\\n' ' '` + fi + + test_sets=`echo $tests | tr ',' ' '` + for test_set in $test_sets; do + start_test=`echo $test_set | tr '-' ' ' | awk '{print $1}'` + end_test=`echo $test_set | tr '-' ' ' | awk '{print $2}'` + + if [ x$end_test = x ]; then + msg="Extracting test $start_test" + label="CTS-`date +"%a-%d-%b-%Y"`-$start_test" + end_test=`expr $start_test + 1` + else + msg"Extracting set $start_test to $end_test..." + label="CTS-`date +"%a-%d-%b-%Y"`-$start_test-$end_test" + end_test=`expr $end_test + 1` + fi + + if [ $start_test = 0 ]; then + start_pat="BEGINNING [0-9].* TESTS" + else + start_pat="Running test.*\[ *$start_test\]" + fi + ctslog=`findmsg 1 "$start_pat"` + line=`grep -n "$start_pat" $ctslog | tail -1 | sed 's/:.*//'` + start_time=`linetime $ctslog $line` + + ctslog=`findmsg 1 "Running test.*\[ *$end_test\]"` + line=`grep -n "Running test.*\[ *$end_test\]" $ctslog | tail -1 | sed 's/:.*//'` + end_time=`linetime $ctslog $line` + + log "$msg (`time2str $start_time` to `time2str $end_time`)" + collect_data $label $start_time $end_time $ctslog + done +} + +getnodes() { + if [ -z $1 ]; then + cluster=`get_cluster_type` + else + cluster=$1 + fi + + cluster_cf=`find_cluster_cf $cluster` + # 1. Live + if + ps -ef | egrep -qs [c]rmd + then + debug "Querying CRM for nodes" + cibadmin -Ql -o nodes | awk ' + /type="normal"/ { + for( i=1; i<=NF; i++ ) + if( $i~/^uname=/ ) { + sub("uname=.","",$i); + sub("\".*","",$i); + print $i; + next; + } + } + ' + + # 2. hostcache + elif [ -f $HA_STATE_DIR/hostcache ]; then + debug "Reading nodes from $HA_STATE_DIR/hostcache" + awk '{print $1}' $HA_STATE_DIR/hostcache + + # 3. ha.cf + elif [ "x$cluster" = "xheartbeat" ]; then + debug "Reading nodes from $cluster_cf" + getcfvar $cluster node $cluster_cf + + else + # Look in the logs... + logfile=`findmsg 1 "crmd\\|CTS"` + debug "Reading nodes from $logfile" + if [ ! -z "$logfile" ]; then + grep crm_update_peer: $logfile | sed s/.*crm_update_peer// | sed s/://g | awk '{print $2}' | grep -v "(null)" | sort -u | tr '\n' ' ' + fi + fi +} + +if [ "x$tests" != "x" ]; then + do_cts + +elif [ "x$start_time" != "x" ]; then + masterlog="" + if [ -z "$nodes" ]; then + nodes=`getnodes $cluster` + log "Calculated node list: $nodes" + fi + + if [ -z "$nodes" ]; then + fatal "Cannot determine node list, please specify manually with --nodes" + fi + + if + echo $nodes | grep -qs $host + then + debug "We are a cluster node" + else + debug "We are a log master" + masterlog=`findmsg 1 "crmd\\|CTS"` + fi + + + if [ -z $end_time ]; then + end_time=`perl -e 'print time()'` + fi + label="pcmk-`date +"%a-%d-%b-%Y"`" + log "Collecting data from $nodes (`time2str $start_time` to `time2str $end_time`)" + collect_data $label $start_time $end_time $masterlog +else + fatal "Not sure what to do, no tests or times to extract" +fi + diff --git a/tools/report.collector b/tools/report.collector new file mode 100644 index 0000000000..21cdb2c741 --- /dev/null +++ b/tools/report.collector @@ -0,0 +1,646 @@ + # Copyright (C) 2007 Dejan Muhamedagic + # Almost everything as part of hb_report + # Copyright (C) 2010 Andrew Beekhof + # Cleanups, refactoring, extensions + # + # This program is free software; you can redistribute it and/or + # modify it under the terms of the GNU General Public + # License as published by the Free Software Foundation; either + # version 2.1 of the License, or (at your option) any later version. + # + # This software is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + # General Public License for more details. + # + # You should have received a copy of the GNU General Public + # License along with this library; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # + +if + echo $REPORT_HOME | grep -qs '^/' +then + debug "Using full path to working directory" +else + debug "Canonicalizing working directory path" + REPORT_HOME="$HOME/$REPORT_HOME" +fi + +findlogdcf() { + for f in \ + `test -x $CRM_DAEMON_DIR/ha_logd && + which strings > /dev/null 2>&1 && + strings $CRM_DAEMON_DIR/ha_logd | grep 'logd\.cf'` \ + `for d; do echo $d/logd.cf $d/ha_logd.cf; done` + do + if [ -f "$f" ]; then + echo $f + debug "Located logd.cf at: $f" + return 0 + fi + done + debug "Could not determine logd.cf location" + return 1 +} + +# +# find files newer than a and older than b +# +isnumber() { + echo "$*" | grep -qs '^[0-9][0-9]*$' +} + +touchfile() { + t=`mktemp` && + perl -e "\$file=\"$t\"; \$tm=$1;" -e 'utime $tm, $tm, $file;' && + echo $t +} + +find_files_clean() { + [ -z "$from_stamp" ] || rm -f "$from_stamp" + [ -z "$to_stamp" ] || rm -f "$to_stamp" + from_stamp="" + to_stamp="" +} + +find_files() { + dirs=$1 + from_time=$2 + to_time=$3 + isnumber "$from_time" && [ "$from_time" -gt 0 ] || { + warning "sorry, can't find files in [ $1 ] based on time if you don't supply time" + return + } + trap find_files_clean 0 + if ! from_stamp=`touchfile $from_time`; then + warning "sorry, can't create temporary file for find_files" + return + fi + findexp="-newer $from_stamp" + if isnumber "$to_time" && [ "$to_time" -gt 0 ]; then + if ! to_stamp=`touchfile $to_time`; then + warning "sorry, can't create temporary file for find_files" + find_files_clean + return + fi + findexp="$findexp ! -newer $to_stamp" + fi + find $dirs -type f $findexp + find_files_clean + trap "" 0 +} + +# +# check permissions of files/dirs +# +pl_checkperms() { + perl -e ' + # check permissions and ownership + # uid and gid are numeric + # everything must match exactly + # no error checking! (file should exist, etc) + ($filename, $perms, $in_uid, $in_gid) = @ARGV; + ($mode,$uid,$gid) = (stat($filename))[2,4,5]; + $p=sprintf("%04o", $mode & 07777); + $p ne $perms and exit(1); + $uid ne $in_uid and exit(1); + $gid ne $in_gid and exit(1); + ' $* +} + +num_id() { + getent $1 $2 | awk -F: '{print $3}' +} + +chk_id() { + [ "$2" ] && return 0 + echo "$1: id not found" + return 1 +} + +check_perms() { + while read type f p uid gid; do + [ -$type $f ] || { + echo "$f wrong type or doesn't exist" + continue + } + n_uid=`num_id passwd $uid` + chk_id "$uid" "$n_uid" || continue + n_gid=`num_id group $gid` + chk_id "$gid" "$n_gid" || continue + pl_checkperms $f $p $n_uid $n_gid || { + echo "wrong permissions or ownership for $f:" + ls -ld $f + } + done +} + +# +# coredumps +# +findbinary() { + random_binary=`which cat 2>/dev/null` # suppose we are lucky + binary=`gdb $random_binary $1 < /dev/null 2>/dev/null | + grep 'Core was generated' | awk '{print $5}' | + sed "s/^.//;s/[.':]*$//"` + if [ x = x"$binary" ]; then + debug "Could not detect the program name for core $1 from the gdb output; will try with file(1)" + binary=$(file $1 | awk '/from/{ + for( i=1; i<=NF; i++ ) + if( $i == "from" ) { + print $(i+1) + break + } + }') + binary=`echo $binary | tr -d "'"` + binary=$(echo $binary | tr -d '`') + if [ "$binary" ]; then + binary=`which $binary 2>/dev/null` + fi + fi + if [ x = x"$binary" ]; then + warning "Could not find the program path for core $1" + return + fi + fullpath=`which $binary 2>/dev/null` + if [ x = x"$fullpath" ]; then + if [ -x $CRM_DAEMON_DIR/$binary ]; then + echo $CRM_DAEMON_DIR/$binary + debug "Found the program at $CRM_DAEMON_DIR/$binary for core $1" + else + warning "Could not find the program path for core $1" + fi + else + echo $fullpath + debug "Found the program at $fullpath for core $1" + fi +} + +getbt() { + which gdb > /dev/null 2>&1 || { + warning "Please install gdb to get backtraces" + return + } + for corefile; do + absbinpath=`findbinary $corefile` + [ x = x"$absbinpath" ] && continue + echo "====================== start backtrace ======================" + ls -l $corefile + gdb -batch -n -quiet -ex ${BT_OPTS:-"thread apply all bt full"} -ex quit \ + $absbinpath $corefile 2>/dev/null + echo "======================= end backtrace =======================" + done +} + +getconfig() { + target=$1; shift; + + for cf in $*; do + if [ -f "$cf" ]; then + cp -p "$cf" $target/ + fi + done + + crm_uuid -r > $target/$HB_UUID_F 2>&1 + + if + ps -ef | egrep -qs [c]rmd + then + crm_mon -1 2>&1 | grep -v '^Last upd' > $target/$CRM_MON_F + cibadmin -Ql > $target/${CIB_F}.live + crm_node -p > $target/$MEMBERSHIP_F 2>&1 + echo "$host" > $target/RUNNING + else + echo "$host" > $target/STOPPED + fi + + if [ -f "$target/$CIB_F" ]; then + crm_verify -V -x $target/$CIB_F >$target/$CRM_VERIFY_F 2>&1 + CIB_file=$target/$CIB_F crm configure show >$target/$CIB_TXT_F 2>&1 + fi +} + +# +# remove values of sensitive attributes +# +# this is not proper xml parsing, but it will work under the +# circumstances +sanitize_xml_attrs() { + sed $( + for patt in $SANITIZE; do + echo "-e /name=\"$patt\"/s/value=\"[^\"]*\"/value=\"****\"/" + done + ) +} + +sanitize_hacf() { + awk ' + $1=="stonith_host"{ for( i=5; i<=NF; i++ ) $i="****"; } + {print} + ' +} + +sanitize_one_clean() { + [ -z "$tmp" ] || rm -f "$tmp" + tmp="" + [ -z "$ref" ] || rm -f "$ref" + ref="" +} + +sanitize() { + file=$1 + compress="" + if [ -z $SANITIZE ]; then + return + fi + echo $file | grep -qs 'gz$' && compress=gzip + echo $file | grep -qs 'bz2$' && compress=bzip2 + if [ "$compress" ]; then + decompress="$compress -dc" + else + compress=cat + decompress=cat + fi + trap sanitize_one_clean 0 + tmp=`mktemp` + ref=`mktemp` + if [ -z "$tmp" -o -z "$ref" ]; then + sanitize_one_clean + fatal "cannot create temporary files" + fi + touch -r $file $ref # save the mtime + if [ "`basename $file`" = ha.cf ]; then + sanitize_hacf + else + $decompress | sanitize_xml_attrs | $compress + fi < $file > $tmp + mv $tmp $file + # note: cleaning $tmp up is still needed even after it's renamed + # because its temp directory is still there. + + touch -r $ref $file + sanitize_one_clean + trap "" 0 +} + +pickfirst() { + for x; do + which $x >/dev/null 2>&1 && { + echo $x + return 0 + } + done + return 1 +} + +# +# get some system info +# +distro() { + if + which lsb_release >/dev/null 2>&1 + then + lsb_release -d + debug "Using lsb_release for distribution info" + return + fi + + relf=`ls /etc/debian_version 2>/dev/null` || + relf=`ls /etc/slackware-version 2>/dev/null` || + relf=`ls -d /etc/*-release 2>/dev/null` && { + for f in $relf; do + test -f $f && { + echo "`ls $f` `cat $f`" + debug "Found `echo $relf | tr '\n' ' '` distribution release file(s)" + return + } + done + } + warning "No lsb_release, no /etc/*-release, no /etc/debian_version: no distro information" +} + +pkg_ver() { + if which dpkg >/dev/null 2>&1 ; then + pkg_mgr="deb" + elif which rpm >/dev/null 2>&1 ; then + pkg_mgr="rpm" + elif which pkg_info >/dev/null 2>&1 ; then + pkg_mgr="pkg_info" + elif which pkginfo >/dev/null 2>&1 ; then + pkg_mgr="pkginfo" + else + warning "Unknown package manager" + return + fi + debug "The package manager is: $pkg_mgr" + echo "The package manager is: $pkg_mgr" + + # for Linux .deb based systems + case $pkg_mgr in + deb) + dpkg-query -f '${Package} ${Version} ${Architecture}\n' -W + for pkg in $*; do + if dpkg-query -W $pkg 2>/dev/null ; then + debug "Verifying installation of: $pkg" + echo "Verifying installation of: $pkg" + debsums -s $pkg 2>/dev/null + fi + done + ;; + rpm) + rpm -qa --qf '%{name} %{version}-%{release} - %{distribution} %{arch}\n' + for pkg in $*; do + if rpm -q $pkg >/dev/null 2>&1 ; then + debug "Verifying installation of: $pkg" + echo "Verifying installation of: $pkg" + rpm --verify $pkg + fi + done + ;; + pkg_info) + pkg_info + ;; + pkginfo) + pkginfo | awk '{print $3}' # format? + ;; + esac +} + +getbacktraces() { + debug "Looking for backtraces: $*" + flist=$( + for f in `find_files "$CRM_CORE_DIRS" $1 $2`; do + bf=`basename $f` + test `expr match $bf core` -gt 0 && + echo $f + done) + if [ "$flist" ]; then + log "Found core files: `echo $flist | tr '\n' ' '`" + getbt "$flist" + fi +} + +getpeinputs() { + flist=$( + find_files $PE_STATE_DIR $1 $2 | sed "s,`dirname $PE_STATE_DIR`/,,g" + ) + if [ "$flist" ]; then + (cd `dirname $PE_STATE_DIR` && tar cf - $flist) | (cd $3 && tar xf -) + debug "found `echo $flist | wc -w` pengine input files in $PE_STATE_DIR" + fi +} + +# +# some basic system info and stats +# +sys_info() { + cluster=$1; shift + echo "Platform: `uname`" + echo "Kernel release: `uname -r`" + echo "Architecture: `uname -m`" + if [ `uname` = Linux ]; then + echo "Distribution: `distro`" + fi + + cibadmin --version 2>&1 + case $1 in + openais) + : echo "openais version: how?" + ;; + corosync) + /usr/sbin/corosync -v 2>&1 + ;; + heartbeat) + heartbeat version: `$CRM_DAEMON_DIR/heartbeat -V` 2>&1 + ;; + esac + + # TODO: Get cluster-glue build version + echo "resource-agents: `grep 'Build version:' /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs`" + + pkg_ver $* +} + +sys_stats() { + set -x + uname -n + uptime + ps axf + ps auxw + top -b -n 1 + ifconfig -a + ip addr list + netstat -i + arp -an + test -d /proc && { + cat /proc/cpuinfo + } + lsscsi + lspci + mount + df + set +x +} + +dlm_dump() { + if which dlm_tool >/dev/null 2>&1 ; then + echo NOTICE - Lockspace overview: + dlm_tool ls + dlm_tool ls | grep name | + while read X N ; do + echo NOTICE - Lockspace $N: + dlm_tool lockdump $N + done + echo NOTICE - Lockspace history: + dlm_tool dump + fi +} + +iscfvarset() { + test "`getcfvar $1 $2`" +} + +iscfvartrue() { + getcfvar $1 $2 $3 | egrep -qsi "^(true|y|yes|on|1)" +} + +uselogd() { + cf_file=$2 + case $1 in + heartbeat) + iscfvartrue $1 use_logd $cf_file && return 0 # if use_logd true + iscfvarset $1 logfacility $cf_file || + iscfvarset $1 logfile $cf_file || + iscfvarset $1 debugfile $cf_file || + return 0 # or none of the log options set + false + ;; + *) + iscfvartrue $1 use_logd $cf_file + ;; + esac +} + +get_logfile() { + cf_type=$1 + cf_file="$2" + cf_logd="$3" + facility_var="logfacility" + + if [ -f "$cf_logd" ]; then + if uselogd; then + cf_file="$cf_logd" + cf_type="logd" + fi + fi + + case $cf_type in + openais|corosync) + debug "Reading log settings from $cf_file" + if iscfvartrue $cf_type to_syslog $cf_file; then + facility_var=syslog_facility + elif iscfvartrue $cf_type to_file $cf_file; then + logfile=`getcfvar $cf_type logfile $cf_file syslog_facility` + fi + ;; + heartbeat|logd) + debug "Reading log settings from $cf_file" + if + iscfvartrue $cf_type debug $cf_file + then + logfile=`getcfvar $cf_type debugfile $cf_file` + else + logfile=`getcfvar $cf_type logfile $cf_file` + fi + ;; + esac + + if [ "x$logfile" != "x" -a -f "$logfile" ]; then + echo $logfile + + else + facility=`getcfvar $cf_type $facility_var $cf_file` + [ "" = "$facility" ] && facility="daemon" + if [ "none" = "$facility" ]; then + fatal "No logging is configured" + fi + msg="Mark:pcmk:`perl -e 'print time()'`" + logger -p $facility.info $msg >/dev/null 2>&1 + findmsg 1 "$msg" + fi +} + +essential_files() { + cat< $SYSINFO_F +essential_files $cluster | check_perms > $PERMISSIONS_F 2>&1 +getconfig "$REPORT_HOME/$host" "$cluster_cf" "$logd_cf" "$HA_STATE_DIR/crm/$CIB_F" "$HA_STATE_DIR/hostcache" + +dlm_dump > $DLM_DUMP_F 2>&1 +sys_stats > $SYSSTATS_F 2>&1 + +getpeinputs $LOG_START $LOG_END $REPORT_HOME/$host +getbacktraces $LOG_START $LOG_END > $REPORT_HOME/$host/$BT_F + +dc=`crm_mon -1 2>/dev/null | awk '/Current DC/ {print $3}'` +if [ "$host" = "$dc" ]; then + echo "$host" > DC +fi + +debug "Sanitizing files" +# +# replace sensitive info with '****' +# +for f in `basename $cluster_cf` $CIB_F $CIB_TXT_F $CIB_F.live pengine/*; do + if [ -f "$f" ]; then + sanitize $f + fi +done + +# Grab logs +#debug "Gathering logs: $logfile $EXTRA_LOGS" +trap '[ -z "$pattfile" ] || rm -f "$pattfile"' 0 +pattfile=`mktemp` || fatal "cannot create temporary files" +for p in $LOG_PATTERNS; do + echo "$p" +done > $pattfile + +for l in $logfile $EXTRA_LOGS; do + b=`basename $l` + if [ ! -f "$l" ]; then + # Not a file + continue + + elif [ -f "$b" ]; then + # We already have it + continue + fi + dumplogset "$l" $LOG_START $LOG_END > "$b" + echo "Log patterns $host:" > $ANALYSIS_F + cat $b | grep -f $pattfile >> $ANALYSIS_F +done + +rm -f $pattfile +trap "" 0 + +# Purge files containing no information +for f in `ls -1`; do + if [ -d "$f" ]; then + continue + elif [ ! -s "$f" ]; then + debug "Removing empty file: $f" + rm -f $f + fi +done + +# Parse for events +for l in $logfile $EXTRA_LOGS; do + node_events `basename $logfile` > $EVENTS_F + + # Link the first logfile to a standard name if it doesn't yet exist + if [ ! -e $HALOG_F ]; then + ln -s `basename $l` $HALOG_F + fi +done + +if [ "$REPORT_MASTER" != "$host" ]; then + debug "Streaming report back to $REPORT_MASTER" + (cd $REPORT_HOME && tar cf - $host) + if [ "$REMOVE" = "1" ]; then + cd + rm -rf $REPORT_HOME + fi +fi + diff --git a/tools/report.common b/tools/report.common new file mode 100644 index 0000000000..1ab581efe9 --- /dev/null +++ b/tools/report.common @@ -0,0 +1,629 @@ + # Copyright (C) 2007 Dejan Muhamedagic + # Almost everything as part of hb_report + # Copyright (C) 2010 Andrew Beekhof + # Cleanups, refactoring, extensions + # + # + # This program is free software; you can redistribute it and/or + # modify it under the terms of the GNU General Public + # License as published by the Free Software Foundation; either + # version 2.1 of the License, or (at your option) any later version. + # + # This software is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + # General Public License for more details. + # + # You should have received a copy of the GNU General Public + # License along with this library; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # + +host=`uname -n` +shorthost=`echo $host | sed s:\\\\..*::` +if [ -z $verbose ]; then + verbose=0 +fi + +# Target Files +EVENTS_F=events.txt +ANALYSIS_F=analysis.txt +DESCRIPTION_F=description.txt +HALOG_F=cluster-log.txt +BT_F=backtraces.txt +SYSINFO_F=sysinfo.txt +SYSSTATS_F=sysstats.txt +DLM_DUMP_F=dlm_dump.txt +CRM_MON_F=crm_mon.txt +MEMBERSHIP_F=members.txt +HB_UUID_F=hb_uuid.txt +HOSTCACHE=hostcache +CRM_VERIFY_F=crm_verify.txt +PERMISSIONS_F=permissions.txt +CIB_F=cib.xml +CIB_TXT_F=cib.txt + +EVENT_PATTERNS=" +membership pcmk_peer_update.*(lost|memb): +quorum crmd.*ais.disp.*quorum.(lost|ac?quir) +pause Process.pause.detected +resources lrmd.*rsc:(start|stop) +stonith stonithd.*(requests|(Succeeded|Failed).to.STONITH|result=) +start_stop Executive.Service.RELEASE|crm_shutdown:.Requesting.shutdown|pcmk_shutdown:.Shutdown.complete +" + +PACKAGES="pacemaker pacemaker-libs libpacemaker3 +pacemaker-pygui pacemaker-pymgmt pymgmt-client +openais libopenais2 libopenais3 corosync libcorosync4 +resource-agents cluster-glue-libs cluster-glue libglue2 ldirectord +heartbeat heartbeat-common heartbeat-resources libheartbeat2 +ocfs2-tools ocfs2-tools-o2cb ocfs2console +ocfs2-kmp-default ocfs2-kmp-pae ocfs2-kmp-xen ocfs2-kmp-debug ocfs2-kmp-trace +drbd drbd-kmp-xen drbd-kmp-pae drbd-kmp-default drbd-kmp-debug drbd-kmp-trace +drbd-heartbeat drbd-pacemaker drbd-utils drbd-bash-completion drbd-xen +lvm2 lvm2-clvm cmirrord +libdlm libdlm2 libdlm3 +hawk ruby lighttpd +kernel-default kernel-pae kernel-xen +glibc +" + +# +# keep the user posted +# + +log() { + printf "$shorthost:\t$*\n" 1>&2 +} + +debug() { + if [ $verbose -gt 0 ]; then + log "Debug: $*" + fi +} + +info() { + log "$*" +} + +warning() { + log "WARN: $*" +} + +fatal() { + log "ERROR: $*" + exit 1 +} + +detect_host() { + local_state_dir=/var + if [ -d $local_state_dir/run/crm ]; then + CRM_STATE_DIR=$local_state_dir/run/crm + else + for d in `find / -type d -name run`; do + if [ -d $d/crm ]; then + CRM_STATE_DIR=$d/crm + local_state_dir=`dirname $d` + fi + done + fi + if [ ! -d $CRM_STATE_DIR ]; then + fatal "Non-standard Pacemaker installation: State directory not found" + fi + + debug "Machine state directory: $local_state_dir" + debug "State files located in: $CRM_STATE_DIR" + + if [ -d $local_state_dir/lib/pengine ]; then + PE_STATE_DIR=$local_state_dir/lib/pengine + else + for d in `find / -type d -name pengine`; do + PE_STATE_DIR=$d + break + done + fi + if [ -z $PE_STATE_DIR ]; then + fatal "Non-standard Pacemaker installation: Policy Engine directory not found" + fi + debug "PE files located in: $PE_STATE_DIR" + + HA_STATE_DIR=$local_state_dir/lib/heartbeat + if [ ! -d $HA_STATE_DIR ]; then + # TODO: Go looking + fatal "Non-standard Heartbeat installation: Heartbeat state directory not found" + fi + debug "Heartbeat state files located in: $HA_STATE_DIR" + + + CRM_CORE_DIRS="" + for d in $HA_STATE_DIR/cores $local_state_dir/lib/corosync $local_state_dir/lib/openais; do + if [ -d $d ]; then + CRM_CORE_DIRS="$CRM_CORE_DIRS $d" + fi + done + debug "Core files located under: $CRM_CORE_DIRS" + + for d in /usr/lib/heartbeat /usr/lib64/heartbeat; do + if [ -f $d/crmd ]; then + CRM_DAEMON_DIR=$d + break + fi + done + if [ ! -d $CRM_DAEMON_DIR ]; then + for d in `find / -type d -name heartbeat`; do + if [ -f $d/crmd ]; then + CRM_DAEMON_DIR=$d + break + fi + done + fi + + if [ ! -d $CRM_DAEMON_DIR ]; then + for f in `find / -type f -name crmd`; do + if [ -f $f ]; then + CRM_DAEMON_DIR=`basename $f` + fi + done + fi + if [ ! -d $CRM_DAEMON_DIR ]; then + fatal "Non-standard Pacemaker installation: daemons not found" + fi + debug "Pacemaker daemons located under: $CRM_DAEMON_DIR" +} + +time2str() { + perl -e "use POSIX; print strftime('%x %X',localtime($1));" +} + +get_time() { + perl -e "\$time='$*';" -e ' + eval "use Date::Parse"; + if (!$@) { + print str2time($time); + } else { + eval "use Date::Manip"; + if (!$@) { + print UnixDate(ParseDateString($time), "%s"); + } + } + ' +} + +get_time_syslog() { + warning "Unknown time format for: $*" +} + +get_time_syslog() { + awk '{print $1,$2,$3}' +} + +get_time_legacy() { + awk '{print $2}' | sed 's/_/ /' +} + +get_time_format() { + t=0 l="" func="" + trycnt=10 + while [ $trycnt -gt 0 ] && read l; do + t=$(get_time `echo $l | get_time_syslog`) + if [ "$t" ]; then + func="syslog" + break + fi + t=$(get_time `echo $l | get_time_legacy`) + if [ "$t" ]; then + func="legacy" + break + fi + trycnt=$(($trycnt-1)) + done + #debug "Logfile uses the $func time format" + echo $func +} + +linetime() { + format=`get_time_format < $1` + l=`tail -n +$2 $1 | head -1 | get_time_$format` + get_time "$l" +} + +# Find pattern in a logfile somewhere +# Return $max ordered results by age (newest first) +findmsg() { + max=$1 + pattern=$2 + logfiles="" + syslogdirs="/var/log /var/logs /var/syslog /var/adm /var/log/ha /var/log/cluster" + + for d in $syslogdirs; do + if [ -d $d ]; then + logfiles=`grep -l -e "$pattern" $d/*` && break + fi + done 2>/dev/null + + if [ "x$logfiles" != "x" ]; then + list=`ls -t $logfiles | head -n $max | tr '\n' ' '` + echo $list + debug "Pattern \'$pattern\' found in: [ $list ]" + else + debug "Pattern \'$pattern\' not found anywhere" + fi +} + +node_events() { + Epatt=`echo "$EVENT_PATTERNS" | + while read title p; do [ -n "$p" ] && echo -n "|$p"; done | + sed 's/.//' + ` + grep -E "$Epatt" $1 +} + +pickfirst() { + for x; do + which $x >/dev/null 2>&1 && { + echo $x + return 0 + } + done + return 1 +} + +shrink() { + src=$* + target=$1.tar + tar_options=cf + + variant=`pickfirst bzip2 gzip false` + case $variant in + bz*) + tar_options="jcf" + target="$target.bz2" + ;; + gz*) + tar_options="zcf" + target="$target.gz" + ;; + *) + warning "Could not find a compression program, the resulting tarball may be huge" + ;; + esac + + tar $tar_options $target $src >/dev/null 2>&1 + echo $target +} + +findln_by_time() { + local logf=$1 + local tm=$2 + local first=1 + local last=`wc -l < $logf` + while [ $first -le $last ]; do + mid=$((($last+$first)/2)) + trycnt=10 + while [ $trycnt -gt 0 ]; do + tmid=`linetime $logf $mid` + [ "$tmid" ] && break + warning "cannot extract time: $logf:$mid; will try the next one" + trycnt=$(($trycnt-1)) + # shift the whole first-last segment + first=$(($first-1)) + last=$(($last-1)) + mid=$((($last+$first)/2)) + done + if [ -z "$tmid" ]; then + warning "giving up on log..." + return + fi + if [ $tmid -gt $tm ]; then + last=$(($mid-1)) + elif [ $tmid -lt $tm ]; then + first=$(($mid+1)) + else + break + fi + done + echo $mid +} + +dumplog() { + local logf=$1 + local from_line=$2 + local to_line=$3 + [ "$from_line" ] || + return + tail -n +$from_line $logf | + if [ "$to_line" ]; then + head -$(($to_line-$from_line+1)) + else + cat + fi +} + +# +# find log/set of logs which are interesting for us +# +# +# find log slices +# + +find_decompressor() { + if echo $1 | grep -qs 'bz2$'; then + echo "bzip2 -dc" + elif echo $1 | grep -qs 'gz$'; then + echo "gzip -dc" + else + echo "cat" + fi +} +# +# check if the log contains a piece of our segment +# +is_our_log() { + local logf=$1 + local from_time=$2 + local to_time=$3 + + local cat=`find_decompressor $logf` + local format=`$cat $logf | get_time_format` + local first_time=$(get_time "`$cat $logf | head -1 | get_time_$format`") + local last_time=$(get_time "`$cat $logf | tail -1 | get_time_$format`") + + if [ x = "x$first_time" -o x = "x$last_time" ]; then + return 0 # skip (empty log?) + fi + if [ $from_time -gt $last_time ]; then + # we shouldn't get here anyway if the logs are in order + return 2 # we're past good logs; exit + fi + if [ $from_time -ge $first_time ]; then + return 3 # this is the last good log + fi + # have to go further back + if [ x = "x$to_time" -o $to_time -ge $first_time ]; then + return 1 # include this log + else + return 0 # don't include this log + fi +} +# +# go through archived logs (timewise backwards) and see if there +# are lines belonging to us +# (we rely on untouched log files, i.e. that modify time +# hasn't been changed) +# +arch_logs() { + local logf=$1 + local from_time=$2 + local to_time=$3 + + # look for files such as: ha-log-20090308 or + # ha-log-20090308.gz (.bz2) or ha-log.0, etc + ls -t $logf $logf*[0-9z] 2>/dev/null | + while read next_log; do + is_our_log $next_log $from_time $to_time + case $? in + 0) ;; # noop, continue + 1) echo $next_log # include log and continue + debug "Found log $next_log" + ;; + 2) break;; # don't go through older logs! + 3) echo $next_log # include log and continue + debug "Found log $next_log" + break + ;; # don't go through older logs! + esac + done +} + +# +# print part of the log +# +drop_tmp_file() { + [ -z "$tmp" ] || rm -f "$tmp" +} + +print_logseg() { + local logf=$1 + local from_time=$2 + local to_time=$3 + + # uncompress to a temp file (if necessary) + local cat=`find_decompressor $logf` + if [ "$cat" != "cat" ]; then + tmp=`mktemp` + $cat $logf > $tmp + trap drop_tmp_file 0 + sourcef=$tmp + else + sourcef=$logf + tmp="" + fi + + if [ "$from_time" = 0 ]; then + FROM_LINE=1 + else + FROM_LINE=`findln_by_time $sourcef $from_time` + fi + if [ -z "$FROM_LINE" ]; then + warning "couldn't find line for time $from_time; corrupt log file?" + return + fi + + TO_LINE="" + if [ "$to_time" != 0 ]; then + TO_LINE=`findln_by_time $sourcef $to_time` + if [ -z "$TO_LINE" ]; then + warning "couldn't find line for time $to_time; corrupt log file?" + return + fi + fi + dumplog $sourcef $FROM_LINE $TO_LINE + log "Including segment [$FROM_LINE-$TO_LINE] from $logf" + drop_tmp_file + trap "" 0 +} + +# +# find log/set of logs which are interesting for us +# +dumplogset() { + local logf=$1 + local from_time=$2 + local to_time=$3 + + local logf_set=`arch_logs $logf $from_time $to_time` + if [ x = "x$logf_set" ]; then + return + fi + + local num_logs=`echo "$logf_set" | wc -l` + local oldest=`echo $logf_set | awk '{print $NF}'` + local newest=`echo $logf_set | awk '{print $1}'` + local mid_logfiles=`echo $logf_set | awk '{for(i=NF-1; i>1; i--) print $i}'` + + # the first logfile: from $from_time to $to_time (or end) + # logfiles in the middle: all + # the last logfile: from beginning to $to_time (or end) + case $num_logs in + 1) print_logseg $newest $from_time $to_time;; + *) + print_logseg $oldest $from_time 0 + for f in $mid_logfiles; do + `find_decompressor $f` $f + debug "including complete $f logfile" + done + print_logseg $newest 0 $to_time + ;; + esac +} + +# cut out a stanza +getstanza() { + awk -v name="$1" ' + !in_stanza && NF==2 && /^[a-z][a-z]*[[:space:]]*{/ { # stanza start + if ($1 == name) + in_stanza = 1 + } + in_stanza { print } + in_stanza && NF==1 && $1 == "}" { exit } + ' +} +# supply stanza in $1 and variable name in $2 +# (stanza is optional) +getcfvar() { + cf_type=$1; shift; + cf_var=$1; shift; + cf_file=$* + + [ -f "$cf_file" ] || return + case $cf_type in + corosync|openais) + sed 's/#.*//' < $cf_file | + if [ $# -eq 2 ]; then + getstanza "$cf_var" + shift 1 + else + cat + fi | + awk -v varname="$cf_var" ' + NF==2 && match($1,varname":$")==1 { print $2; exit; } + ' + ;; + heartbeat) + sed 's/#.*//' < $cf_file | + grep -w "^$cf_var" | + sed 's/^[^[:space:]]*[[:space:]]*//' + + ;; + logd) + sed 's/#.*//' < $cf_file | + grep -w "^$cf_var" | + sed 's/^[^[:space:]]*[[:space:]]*//' + + ;; + esac +} + +# +# figure out the cluster type, depending on the process list +# and existence of configuration files +# +get_cluster_type() { + if + ps -ef | egrep -qs '[c]orosync' + then + stack="corosync" + elif + ps -ef | egrep -qs '[a]isexec' + then + stack="openais" + elif + ps -ef | egrep -qs '[h]eartbeat' + then + stack="heartbeat" + + # Now we're guessing... + + # TODO: Technically these could be anywhere :-/ + elif [ -f /etc/corosync/corosync.conf ]; then + stack="corosync" + + elif [ -f /etc/ais/openais.conf ]; then + stack="openais" + + else + stack="heartbeat" + fi + + debug "Detected the $stack cluster stack" + echo $stack +} + +find_cluster_cf() { + case $1 in + corosync) + best_size=0 + best_file="" + + # TODO: Technically these could be anywhere :-/ + for cf in /etc/ais/openais.conf /etc/corosync/corosync.conf; do + if [ -f $cf ]; then + if + grep -qs pacemaker $cf + then + size=`wc -l $cf | awk '{print $1}'` + if [ $size -gt $best_size ]; then + best_size=$size + best_file=$cf + fi + fi + fi + done + echo "$best_file" + ;; + openais) + # TODO: Technically it could be anywhere :-/ + cf="/etc/ais/openais.conf" + if [ -f $cf ]; then + echo "$cf" + fi + ;; + heartbeat) + cf="/etc/ha.d/ha.cf" + if [ -f $cf ]; then + echo "$cf" + fi + ;; + esac +} + +# +# check for the major prereq for a) parameter parsing and b) +# parsing logs +# +t=`get_time "12:00"` +if [ "$t" = "" ]; then + fatal "please install the perl Date::Parse module" +fi + +detect_host