[Debian-ha-commits] [cluster-glue] 46/73: Imported Upstream version 1.0.12
Richard Winters
devrik-guest at moszumanska.debian.org
Sat Apr 18 20:24:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
devrik-guest pushed a commit to branch master
in repository cluster-glue.
commit 589c42774e3c4a2b33225b703d7cc22ec9c76b45
Author: Richard B Winters <rik at mmogp.com>
Date: Thu Apr 16 05:28:00 2015 -0400
Imported Upstream version 1.0.12
---
.hg_archival.txt | 2 +-
.hgsigs | 1 +
.hgtags | 1 +
ChangeLog | 14 ++++
Makefile.am | 3 +
cluster-glue-fedora.spec | 26 ++++++-
cluster-glue-suse.spec | 39 +++++++++-
configure.ac | 28 ++++++-
doc/hb_report.8.txt | 11 ++-
hb_report/Makefile.am | 1 -
hb_report/combine-logs.pl | 136 ----------------------------------
hb_report/ha_cf_support.sh | 2 +-
hb_report/hb_report.in | 119 ++++++++++++++++-------------
hb_report/openais_conf_support.sh | 2 +-
hb_report/utillib.sh | 74 +++++++++++++-----
lib/clplumbing/cl_log.c | 4 +-
lib/clplumbing/ipcsocket.c | 11 ++-
lib/clplumbing/ocf_ipc.c | 6 +-
lib/plugins/stonith/external/vcenter | 10 +++
lib/plugins/stonith/ipmilan_command.c | 1 +
logd/Makefile.am | 6 +-
logd/ha_logd.c | 12 ++-
logd/logd.service.in | 13 ++++
23 files changed, 295 insertions(+), 227 deletions(-)
diff --git a/.hg_archival.txt b/.hg_archival.txt
index bf0a272..22a0b4f 100644
--- a/.hg_archival.txt
+++ b/.hg_archival.txt
@@ -1,2 +1,2 @@
repo: e3ffdd7ae81c596b2be7e1e110d2c1255161340e
-node: b5f1605097857b8b96bd517282ab300e2ad7af99
+node: 0a7add1d9996b6d869d441da6c82fb7b8abcef4f
diff --git a/.hgsigs b/.hgsigs
index 1c5b645..ddb9f3d 100644
--- a/.hgsigs
+++ b/.hgsigs
@@ -1,3 +1,4 @@
b6dca003bb176978af803eeb33019b6aef3c58b0 0 iEYEABECAAYFAktnGJAACgkQWnQN9wr0w1ywBACghXYwYkv/70Xg5AQMzVjRWKZecIoAnjRUytRoYl+dhhqbhfdXSD+/Bfvw
6007185b487e3f2dc3b24674a9105761b2cde6ea 0 iEYEABECAAYFAktoWfsACgkQWnQN9wr0w1ySZwCfQILyC2VJrCnVEU2zvTIyI7ustDAAn37hhb9JM8JQVKLfPEbqIloz1m3m
979c4ffae287976631a30d10258903aea6fb28fa 0 iEYEABECAAYFAktoY38ACgkQWnQN9wr0w1wHxgCeMZyOt8ccxmIsvIHg4/y6KmqtTVAAn2jn7dOmFMjA8m4ju59YaQ1Bznhb
+798645ead29e20b361af883fce695b85caf3392b 0 iEYEABECAAYFAlPJCM4ACgkQWnQN9wr0w1wv+QCeJQOjaYNXNJZA61n7Fu8f63CeVBEAnja4WqiYC+TS4HvmRJz6oNi6p48u
diff --git a/.hgtags b/.hgtags
index 2599266..6e84e98 100644
--- a/.hgtags
+++ b/.hgtags
@@ -65,3 +65,4 @@ c69dc6ace936f501776df92dab3d611c2405f69e glue-1.0.8
12055ca2b025ab250a544701edaa1f5aaf63aef1 glue-1.0.10
02bdcf58f9a098b717784746308e199e12eeb005 glue-1.0.11
c64d6e96f20ad5ba245f7fb9e1295b14fa179e29 glue-1.0.12-rc1
+d05229decc34d66c4752536dc7c9d812d1e6d5ca glue-1.0.12
diff --git a/ChangeLog b/ChangeLog
index af8c4d0..4366ee3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+* Fri Jul 18 2014 Dejan Muhamedagic <dejan at suse.de>, Lars Ellenberg <lars.ellenberg at linbit.com>, and many others
+- stable release 1.0.12
+- hb_report: add -Q option for quick runs
+- hb_report: dot is not illegal in file names (bnc#884079, deb#715391)
+- build: update spec files for systemd
+- hb_report: update interface to zypper
+- hb_report: support logs with varied timestamps
+- stonith: external/vcenter: add parameter for SSL hostname
+ verification (bnc#851990)
+- hb_report: fix ssh passwords again (bnc#867365)
+- hb_report: Don't use deprecated corosync-fplay (bnc#870913)
+- logd: Add systemd unit file for logd (bnc#863248)
+- hb_report: Add support for xz compression (bnc#854060)
+
* Thu Sep 26 2013 Dejan Muhamedagic <dejan at suse.de>, Lars Ellenberg <lars.ellenberg at linbit.com>, and many others
- release candidate 1.0.12-rc1
- clplumbing: increase listen backlog to 128
diff --git a/Makefile.am b/Makefile.am
index d724837..93dbaf6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,6 +16,9 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
+DISTCHECK_CONFIGURE_FLAGS = \
+ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
+
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure DRF/config-h.in \
DRF/stamp-h.in libtool.m4 ltdl.m4 libltdl.tar
diff --git a/cluster-glue-fedora.spec b/cluster-glue-fedora.spec
index 964a3ba..b480ff5 100644
--- a/cluster-glue-fedora.spec
+++ b/cluster-glue-fedora.spec
@@ -16,7 +16,7 @@
Name: cluster-glue
Summary: Reusable cluster components
Version: 1.0.12
-Release: 0.rc1%{?dist}
+Release: 1%{?dist}
License: GPLv2+ and LGPLv2+
Url: http://www.linux-ha.org/wiki/Cluster_Glue
Group: System Environment/Base
@@ -60,6 +60,11 @@ BuildRequires: libuuid-devel
BuildRequires: e2fsprogs-devel
%endif
+%if %{defined systemd_requires}
+BuildRequires: systemd
+%{?systemd_requires}
+%endif
+
%prep
%setup -q -n cluster-glue
@@ -82,6 +87,9 @@ export docdir=%{glue_docdir}
--with-daemon-user=%{uname} \
--localstatedir=%{_var} \
--libdir=%{_libdir} \
+%if %{defined _unitdir}
+ --with-systemdsystemunitdir=%{_unitdir} \
+%endif
--docdir=%{glue_docdir}
%endif
@@ -112,11 +120,14 @@ standards, and an interface to common STONITH devices.
%files
%defattr(-,root,root)
%dir %{_datadir}/%{name}
+%if %{defined _unitdir}
+%{_unitdir}/logd.service
+%else
%{_sysconfdir}/init.d/logd
+%endif
%{_datadir}/%{name}/ha_cf_support.sh
%{_datadir}/%{name}/openais_conf_support.sh
%{_datadir}/%{name}/utillib.sh
-%{_datadir}/%{name}/combine-logs.pl
%{_datadir}/%{name}/ha_log.sh
%{_sbindir}/ha_logger
@@ -176,6 +187,17 @@ useradd -r -g %{gname} -d %{_var}/lib/heartbeat/cores/hacluster -s /sbin/nologin
-c "cluster user" %{uname}
exit 0
+%if %{defined _unitdir}
+%post
+%systemd_post logd.service
+
+%preun
+%systemd_preun logd.service
+
+%postun
+%systemd_postun_with_restart logd.service
+%endif
+
%post -n cluster-glue-libs -p /sbin/ldconfig
%postun -n cluster-glue-libs -p /sbin/ldconfig
diff --git a/cluster-glue-suse.spec b/cluster-glue-suse.spec
index d344513..e2ca7c7 100644
--- a/cluster-glue-suse.spec
+++ b/cluster-glue-suse.spec
@@ -30,7 +30,7 @@
Name: cluster-glue
Summary: Reusable cluster components
Version: 1.0.12
-Release: 0.rc1%{?dist}
+Release: 1%{?dist}
License: GPL v2 or later; LGPL v2.1 or later
Url: http://www.linux-ha.org/wiki/Cluster_Glue
Group: Productivity/Clustering/HA
@@ -42,6 +42,7 @@ BuildRequires: libnet net-snmp-devel OpenIPMI-devel openhpi-devel
BuildRequires: libxslt docbook_4 docbook-xsl-stylesheets
BuildRequires: help2man
BuildRequires: asciidoc
+BuildRequires: libbz2-devel libaio-devel
Obsoletes: heartbeat-common
Provides: heartbeat-common
@@ -56,6 +57,11 @@ BuildRequires: sgml-skel
BuildRequires: libcurl-devel
%endif
+%if %{defined systemd_requires}
+BuildRequires: systemd
+%{?systemd_requires}
+%endif
+
%description
A collection of common tools derived from the Heartbeat project that are
useful for writing cluster managers such as Pacemaker.
@@ -112,6 +118,10 @@ export docdir=%{glue_docdir}
--with-package-name=%{name} \
--with-daemon-group=%{gname} \
--with-daemon-user=%{uname} \
+ --with-rundir=%{_rundir} \
+%if %{defined _unitdir}
+ --with-systemdsystemunitdir=%{_unitdir} \
+%endif
--docdir=%{glue_docdir}
%endif
@@ -127,11 +137,15 @@ find $RPM_BUILD_ROOT -name '*.la' -type f -print0 | xargs -0 rm -f
find $RPM_BUILD_ROOT -name '*.pyc' -type f -print0 | xargs -0 rm -f
find $RPM_BUILD_ROOT -name '*.pyo' -type f -print0 | xargs -0 rm -f
+%if %{defined _unitdir}
+ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rclogd
+%else
test -d $RPM_BUILD_ROOT/sbin || mkdir $RPM_BUILD_ROOT/sbin
(
cd $RPM_BUILD_ROOT/sbin
ln -s /etc/init.d/logd rclogd
)
+%endif
###########################################################
@@ -162,7 +176,20 @@ else
-d %{_var}/lib/heartbeat/cores/%{uname} -o -u %{uid} \
%{uname} 2>/dev/null || :
fi
+%if %{defined _unitdir}
+ %service_add_pre logd.service
+%endif
+
+%if %{defined _unitdir}
+%post
+%service_add_post logd.service
+
+%preun
+%service_del_preun logd.service
+%postun
+%service_del_postun logd.service
+%else
%preun
%stop_on_removal logd
@@ -171,6 +198,7 @@ fi
%postun
%insserv_cleanup
+%endif
%post -n libglue2
/sbin/ldconfig
@@ -202,7 +230,6 @@ fi
%{_datadir}/%{name}/ha_cf_support.sh
%{_datadir}/%{name}/openais_conf_support.sh
%{_datadir}/%{name}/utillib.sh
-%{_datadir}/%{name}/combine-logs.pl
%{_datadir}/%{name}/ha_log.sh
%{_sbindir}/ha_logger
@@ -212,7 +239,13 @@ fi
%{_sbindir}/meatclient
%{_sbindir}/stonith
+%if %{defined _unitdir}
+%{_unitdir}/logd.service
+%{_sbindir}/rclogd
+%else
%{_sysconfdir}/init.d/logd
+/sbin/rclogd
+%endif
%doc %{_mandir}/man1/*
%doc %{_mandir}/man8/*
@@ -222,8 +255,6 @@ fi
%doc logd/logd.cf
%doc doc/stonith/README*
-/sbin/rclogd
-
%{_libdir}/heartbeat/lrmd
%{_libdir}/heartbeat/ha_logd
diff --git a/configure.ac b/configure.ac
index 2a93124..36bcf12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ dnl checks for compiler characteristics
dnl checks for library functions
dnl checks for system services
-AC_INIT(cluster-glue, 1.0.12-rc1, linux-ha-dev at lists.linux-ha.org)
+AC_INIT(cluster-glue, 1.0.12, linux-ha-dev at lists.linux-ha.org)
FEATURES=""
HB_PKG=heartbeat
@@ -52,6 +52,22 @@ AC_ARG_WITH(pkg-name,
[ --with-pkg-name=name Override package name (if you're a packager needing to pretend) ],
[ PACKAGE_NAME="$withval" ])
+PKG_PROG_PKG_CONFIG
+AC_ARG_WITH([systemdsystemunitdir],
+ [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
+ [with_systemdsystemunitdir=auto])
+AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
+ def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
+
+ AS_IF([test "x$def_systemdsystemunitdir" = "x"],
+ [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
+ [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
+ with_systemdsystemunitdir=no],
+ [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
+AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
+ [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
+
AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
AC_DEFINE_UNQUOTED(GLUE_VERSION, "$PACKAGE_VERSION", Current version of the glue library)
@@ -161,6 +177,15 @@ AC_ARG_WITH(
[ GLUE_DAEMON_USER="hacluster" ],
)
+
+AC_ARG_WITH(
+ rundir,
+ [ --with-rundir=DIR
+ directory to store state information [default=localstatedir/run] ],
+ [ GLUE_STATE_DIR="$withval" ],
+ [ GLUE_STATE_DIR="${localstatedir}/run" ],
+ )
+
dnl ===============================================
dnl General Processing
dnl ===============================================
@@ -1368,6 +1393,7 @@ lrm/Makefile \
lrm/test/testcases/Makefile \
logd/Makefile \
logd/logd \
+logd/logd.service \
replace/Makefile \
hb_report/Makefile \
hb_report/hb_report \
diff --git a/doc/hb_report.8.txt b/doc/hb_report.8.txt
index c4f5dac..5efbc32 100644
--- a/doc/hb_report.8.txt
+++ b/doc/hb_report.8.txt
@@ -14,7 +14,8 @@ hb_report - create report for CRM based clusters (Pacemaker)
SYNOPSIS
--------
*hb_report* -f {time|"cts:"testnum} [-t time] [-u user] [-l file]
- [-n nodes] [-E files] [-p patt] [-L patt] [-e prog] [-MSDCZAVsvhd] [dest]
+ [-n nodes] [-E files] [-p patt] [-L patt] [-e prog]
+ [-MSDCZAQVsvhd] [dest]
DESCRIPTION
@@ -75,6 +76,14 @@ dest::
Additional patterns to match parameter name which contain
sensitive information. This option is additive (default: "passw.*").
+*-Q*::
+ Quick run. Gathering some system information can be expensive.
+ With this option, such operations are skipped and thus
+ information collecting sped up. The operations considered
+ I/O or CPU intensive: verifying installed packages content,
+ sanitizing files for sensitive information, and producing dot
+ files from PE inputs.
+
*-A*::
This is an OpenAIS cluster. hb_report has some heuristics to
find the cluster stack, but that is not always reliable.
diff --git a/hb_report/Makefile.am b/hb_report/Makefile.am
index 574f9e1..cd4ad65 100644
--- a/hb_report/Makefile.am
+++ b/hb_report/Makefile.am
@@ -21,7 +21,6 @@ MAINTAINERCLEANFILES = Makefile.in
hanoarchdir = $(datadir)/$(PACKAGE_NAME)
-hanoarch_SCRIPTS = combine-logs.pl
hanoarch_DATA = utillib.sh ha_cf_support.sh openais_conf_support.sh
sbin_SCRIPTS = hb_report
diff --git a/hb_report/combine-logs.pl b/hb_report/combine-logs.pl
deleted file mode 100755
index 2cfacd7..0000000
--- a/hb_report/combine-logs.pl
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/usr/bin/perl
-#
-# combine-logs v1.0
-#
-# Copyright (c) 1999 Steven J. Madsen. All rights reserved.
-#
-# Combines multiple syslog-format logs into a single chronological log. Very
-# handy for syslog report generators such as cksyslog.
-#
-# usage: combine-logs <log file> [...]
-#
-# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-# Note by Dejan Muhamedagic <dejan at suse.de>
-#
-# This program was downloaded from
-# http://www.moonglade.com/syslog/combine-logs-1.0.tar.gz
-#
-
-$debugging = 0;
-
-# Open all of the logs.
-$handle = "fh00";
-foreach $file (@ARGV)
-{
- $handle++;
- open $handle, $file || die "Could not open $file: $!\n";
- push @fh, $handle;
-}
-
-# Get the first line from each of the files.
-$i = 0;
-foreach $handle (@fh)
-{
- $current_line[$i++] = get_next_line($handle);
-}
-
-# Process the logs.
-while (1)
-{
- $first = 0;
- for ($i = 1; $i < @fh; $i++)
- {
- if (first_entry($current_line[$first], $current_line[$i]))
- {
- $first = $i;
- }
- }
- # Fall out if the entry isn't defined (no more entries to print).
- last if !defined($current_line[$first]);
-
- # Print the entry and get the next line from that log.
- print $current_line[$first];
- $current_line[$first] = get_next_line($fh[$first]);
-}
-
-# Gets the next line from the provided file handle.
-sub get_next_line()
-{
- my($handle) = @_;
- my($line);
- while ($line = <$handle>)
- {
- print " read $line" if $debugging;
-
- # Weed out useless "last message repeated" messages.
- next if $line =~ m/last message repeated \d+ times$/;
-
- # Fall out if the line passes the above tests.
- last;
- }
- return $line;
-}
-
-# Determines which syslog-style log entry comes first. If $a comes first,
-# the function returns 0. If $b comes first, the function returns 1.
-sub first_entry()
-{
- my($a, $b) = @_;
- print " \$a=$a \$b=$b" if $debugging;
- return 0 if !defined($b);
- return 1 if !defined($a);
-
- my(%month) = (Jan => 0, Feb => 1, Mar => 2, Apr => 3, May => 4, Jun => 5,
- Jul => 6, Aug => 7, Sep => 8, Oct => 9, Nov => 10, Dec => 11);
- my($a_month, $a_day, $a_hour, $a_minute, $a_second) =
- $a =~ /^(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s/;
- my($b_month, $b_day, $b_hour, $b_minute, $b_second) =
- $b =~ /^(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s/;
-
- print " a: $a_month $a_day $a_hour:$a_minute:$a_second\n" if $debugging;
- print " b: $b_month $b_day $b_hour:$b_minute:$b_second\n" if $debugging;
-
- # Strictly speaking, Jan comes before Dec, but in the case that we are
- # comparing exactly those two, we consider Jan to come later. In the
- # context of a log, this probably means a new year.
- return 0 if $a_month eq "Dec" && $b_month eq "Jan";
- return 1 if $a_month eq "Jan" && $b_month eq "Dec";
-
- # All other comparisons are as you'd expect.
- if ($a_month ne $b_month)
- {
- return $month{$a_month} > $month{$b_month};
- }
- if ($a_day ne $b_day)
- {
- return $a_day > $b_day;
- }
- if ($a_hour ne $b_hour)
- {
- return $a_hour > $b_hour;
- }
- if ($a_minute ne $b_minute)
- {
- return $a_minute > $b_minute;
- }
- if ($a_second ne $b_second)
- {
- return $a_second > $b_second;
- }
-
- # They have identical times, so just pick the first one.
- return 0;
-}
diff --git a/hb_report/ha_cf_support.sh b/hb_report/ha_cf_support.sh
index 0c674b8..7b35c98 100644
--- a/hb_report/ha_cf_support.sh
+++ b/hb_report/ha_cf_support.sh
@@ -76,7 +76,7 @@ essential_files() {
cat<<EOF
d $HA_VARLIB 0755 root root
d $HA_VARLIB/ccm 0750 hacluster haclient
-d $PCMK_LIB 0755 root root
+d $PCMK_LIB 0750 hacluster haclient
d $PE_STATE_DIR 0750 hacluster haclient
d $CIB_DIR 0750 hacluster haclient
EOF
diff --git a/hb_report/hb_report.in b/hb_report/hb_report.in
index 1b10a28..a3f9c66 100755
--- a/hb_report/hb_report.in
+++ b/hb_report/hb_report.in
@@ -36,6 +36,7 @@ export DEFAULT_HA_LOGFACILITY
LOGD_CF=`findlogdcf @sysconfdir@ $HA_DIR`
export LOGD_CF
+SSH_PASSWORD_NODES=""
: ${SSH_OPTS="-o StrictHostKeyChecking=no -o EscapeChar=none"}
LOG_PATTERNS="CRIT: ERROR:"
# PEINPUTS_PATT="peng.*PEngine Input stored"
@@ -68,7 +69,7 @@ usage() {
cat<<EOF
usage: hb_report -f {time|"cts:"testnum} [-t time]
[-u user] [-X ssh-options] [-l file] [-n nodes] [-E files]
- [-p patt] [-L patt] [-e prog] [-MSDZAVsvhd] [dest]
+ [-p patt] [-L patt] [-e prog] [-MSDZAQVsvhd] [dest]
-f time: time to start from or a CTS test number
-t time: time to finish at (dflt: now)
@@ -88,6 +89,7 @@ usage: hb_report -f {time|"cts:"testnum} [-t time]
-L patt: regular expression to match in log files for analysis;
this option is additive (dflt: $LOG_PATTERNS)
-e prog: your favourite editor
+ -Q : don't run resource intensive operations (speed up)
-M : don't collect extra logs (/var/log/messages)
-D : don't invoke editor to write description
-Z : if destination directories exist, remove them instead of exiting
@@ -169,11 +171,19 @@ setvarsanddefaults() {
TRY_SSH="root hacluster"
SLAVEPIDS=""
NO_DESCRIPTION="1"
+ SKIP_LVL=0
VERBOSITY=0
}
+#
+# caller may skip collecting information if the skip level
+# exceeds the given value
+#
+skip_lvl() {
+ [ $SKIP_LVL -ge $1 ]
+}
chkname() {
[ "$1" ] || usage short
- echo $1 | grep -qs '[^a-zA-Z0-9 at _+=:-]' &&
+ echo $1 | grep -qs '[^a-zA-Z0-9 at _+=:.-]' &&
fatal "$1 contains illegal characters"
}
set_dest() {
@@ -315,7 +325,9 @@ findlog() {
#
find_decompressor() {
- if echo $1 | grep -qs 'bz2$'; then
+ if echo $1 | grep -qs 'xz$'; then
+ echo "xz -dc"
+ elif echo $1 | grep -qs 'bz2$'; then
echo "bzip2 -dc"
elif echo $1 | grep -qs 'gz$'; then
echo "gzip -dc"
@@ -526,6 +538,7 @@ MASTER_IS_HOSTLOG=$MASTER_IS_HOSTLOG
UNIQUE_MSG=$UNIQUE_MSG
SANITIZE="$SANITIZE"
DO_SANITIZE="$DO_SANITIZE"
+SKIP_LVL="$SKIP_LVL"
EXTRA_LOGS="$EXTRA_LOGS"
USER_CLUSTER_TYPE="$USER_CLUSTER_TYPE"
CONF="$CONF"
@@ -561,19 +574,27 @@ start_slave_collector() {
#
# does ssh work?
# and how
+# test the provided ssh user
+# or try to find a ssh user which works without password
+# if ssh works without password, we can run the collector in the
+# background and save some time
#
testsshconn() {
ssh $SSH_OPTS -T -o Batchmode=yes $1 true 2>/dev/null
}
findsshuser() {
local n u rc
- local ssh_s ssh_user="__undef" try_user_list failed_nodes=""
- try_user_list="\"\" $TRY_SSH"
+ local ssh_s ssh_user="__undef" try_user_list
+ if [ -z "$SSH_USER" ]; then
+ try_user_list="__default $TRY_SSH"
+ else
+ try_user_list="$SSH_USER"
+ fi
for n in $NODES; do
rc=1
[ "$n" = "$WE" ] && continue
for u in $try_user_list; do
- if [ "$u" != '""' ]; then
+ if [ "$u" != '__default' ]; then
ssh_s=$u@$n
else
ssh_s=$n
@@ -589,20 +610,34 @@ findsshuser() {
fi
done
[ $rc = 1 ] &&
- failed_nodes="$failed_nodes $n"
+ SSH_PASSWORD_NODES="$SSH_PASSWORD_NODES $n"
done
- [ -n "$failed_nodes" ] &&
- warning "ssh to node(s) $failed_nodes does not work"
- # drop nodes we cannot reach
- NODES=`for n in $failed_nodes $NODES; do echo $n; done | sort | uniq -u`
+ if [ -n "$SSH_PASSWORD_NODES" ]; then
+ warning "passwordless ssh to node(s) $SSH_PASSWORD_NODES does not work"
+ fi
+
if [ "$ssh_user" = "__undef" ]; then
return 1
fi
- if [ "$ssh_user" != '""' ]; then
- echo $ssh_user
+ if [ "$ssh_user" != "__default" ]; then
+ SSH_USER=$ssh_user
fi
return 0
}
+node_needs_pwd() {
+ local n
+ for n in $SSH_PASSWORD_NODES; do
+ [ "$n" = "$1" ] && return 0
+ done
+ return 1
+}
+say_ssh_user() {
+ if [ -n "$SSH_USER" ]; then
+ echo $SSH_USER
+ else
+ echo your user
+ fi
+}
#
# the usual stuff
@@ -649,7 +684,7 @@ getpeinputs() {
}
if [ `echo $flist | wc -w` -le 20 ]; then
for f in $flist; do
- pe2dot $3/`basename $pe_dir`/`basename $f`
+ skip_lvl 1 || pe2dot $3/`basename $pe_dir`/`basename $f`
done
else
debug "too many PE inputs to create dot files"
@@ -681,7 +716,7 @@ corosync_blackbox() {
local inpf
inpf=`find_files /var/lib/corosync $from_time $to_time | grep -w fdata`
if [ -f "$inpf" ]; then
- corosync-fplay > $outf
+ corosync-blackbox > $outf
touch -r $inpf $outf
fi
}
@@ -709,7 +744,8 @@ sys_info() {
hb_report -V # our info
echo "resource-agents: `grep 'Build version:' @OCF_ROOT_DIR@/lib/heartbeat/ocf-shellfuncs`"
crm_info
- pkg_ver $PACKAGES
+ pkg_versions $PACKAGES
+ skip_lvl 1 || verify_packages $PACKAGES
echo "Platform: `uname`"
echo "Kernel release: `uname -r`"
echo "Architecture: `uname -m`"
@@ -951,24 +987,6 @@ events() {
}
#
-# if there is no central log, let's combine logs from individual
-# nodes; the ordering may not be perfect, but then centralized
-# logging doesn't guarantee the order of messages either
-# (network delay, machine load)
-#
-combine_logs() {
- local destdir
- destdir=$1
- test $NODECNT -gt 1 ||
- return
- test -x $HA_NOARCHBIN/combine-logs.pl ||
- warning "cannot combine logs: no $HA_NOARCHBIN/combine-logs.pl"
- $HA_NOARCHBIN/combine-logs.pl $destdir/*/$HALOG_F > $destdir/$HALOG_F
- loginfo $destdir/$HALOG_F combined > $destdir/$HALOG_F.info
- $HA_NOARCHBIN/combine-logs.pl $destdir/*/events.txt > $destdir/events.txt
-}
-
-#
# description template, editing, and other notes
#
mktemplate() {
@@ -1018,8 +1036,10 @@ edittemplate() {
fi
}
pickcompress() {
- if COMPRESS_PROG=`pickfirst bzip2 gzip`; then
- if [ "$COMPRESS_PROG" = bzip2 ]; then
+ if COMPRESS_PROG=`pickfirst bzip2 gzip xz`; then
+ if [ "$COMPRESS_PROG" = xz ]; then
+ COMPRESS_EXT=.xz
+ elif [ "$COMPRESS_PROG" = bzip2 ]; then
COMPRESS_EXT=.bz2
else
COMPRESS_EXT=.gz
@@ -1032,7 +1052,7 @@ pickcompress() {
}
# get the right part of the log
getlog() {
- local getstampproc cnt
+ local cnt
local outf
outf=$WORKDIR/$HALOG_F
@@ -1082,13 +1102,13 @@ getlog() {
# get all other info (config, stats, etc)
#
collect_info() {
- local getstampproc l
+ local l
sys_info > $WORKDIR/$SYSINFO_F 2>&1 &
sys_stats > $WORKDIR/$SYSSTATS_F 2>&1 &
getconfig $WORKDIR
getpeinputs $FROM_TIME $TO_TIME $WORKDIR &
crmconfig $WORKDIR &
- touch_DC_if_dc $WORKDIR &
+ skip_lvl 1 || touch_DC_if_dc $WORKDIR &
getbacktraces $FROM_TIME $TO_TIME $WORKDIR/$BT_F
getconfigurations $WORKDIR
check_perms > $WORKDIR/$PERMISSIONS_F 2>&1
@@ -1097,7 +1117,7 @@ collect_info() {
corosync_blackbox $FROM_TIME $TO_TIME $WORKDIR/$COROSYNC_RECORDER_F
getratraces $FROM_TIME $TO_TIME $WORKDIR
wait
- sanitize $WORKDIR
+ skip_lvl 1 || sanitize $WORKDIR
for l in $EXTRA_LOGS; do
[ "$NO_str2time" ] && break
@@ -1154,7 +1174,7 @@ if ! is_collector; then
userargs="$@"
DESTDIR=.
DEST="hb_report-"`date +"%a-%d-%b-%Y"`
- while getopts f:t:l:u:X:p:L:e:E:n:MSDCZAVsvhd o; do
+ while getopts f:t:l:u:X:p:L:e:E:n:MSDCZAVsvhdQ o; do
case "$o" in
h) usage;;
V) version;;
@@ -1180,6 +1200,7 @@ if ! is_collector; then
e) EDITOR="$OPTARG";;
p) SANITIZE="$SANITIZE $OPTARG";;
s) DO_SANITIZE="1";;
+ Q) SKIP_LVL=$((SKIP_LVL + 1));;
L) LOG_PATTERNS="$LOG_PATTERNS $OPTARG";;
S) NO_SSH=1;;
D) NO_DESCRIPTION=1;;
@@ -1214,7 +1235,7 @@ fi
is_collector || {
info "high debug level, please read debug.out"
}
- PS4='+ ${FUNCNAME[0]:+${FUNCNAME[0]}:}${LINENO}: '
+ PS4='+ `date +"%T"`: ${FUNCNAME[0]:+${FUNCNAME[0]}:}${LINENO}: '
if echo "$SHELL" | grep bash > /dev/null &&
[ ${BASH_VERSINFO[0]} = "4" ]; then
exec 3>>$WORKDIR/debug.out
@@ -1344,9 +1365,7 @@ if ! is_collector; then
if [ -z "$NO_SSH" ]; then
# if the ssh user was supplied, consider that it
# works; helps reduce the number of ssh invocations
- if [ -z "$SSH_USER" ]; then
- SSH_USER=`findsshuser`
- fi
+ findsshuser
if [ -n "$SSH_USER" ]; then
SSH_OPTS="$SSH_OPTS -o User=$SSH_USER"
fi
@@ -1383,11 +1402,13 @@ fi
if ! is_collector; then
for node in $NODES; do
- if [ -z "$SSH_USER" ]; then
+ if node_needs_pwd $node; then
+ info "Please provide password for `say_ssh_user` at $node"
+ info "Note that collecting data will take a while."
+ start_slave_collector $node
+ else
start_slave_collector $node &
SLAVEPIDS="$SLAVEPIDS $!"
- else
- start_slave_collector $node
fi
done
fi
@@ -1413,8 +1434,6 @@ else
read junk
edittemplate $WORKDIR/$DESCRIPTION_F
}
- test -f $WORKDIR/$HALOG_F ||
- combine_logs $WORKDIR
wait
if [ "$COMPRESS" = "1" ]; then
pickcompress
diff --git a/hb_report/openais_conf_support.sh b/hb_report/openais_conf_support.sh
index ea2e02f..b96d1aa 100644
--- a/hb_report/openais_conf_support.sh
+++ b/hb_report/openais_conf_support.sh
@@ -90,7 +90,7 @@ cluster_info() {
}
essential_files() {
cat<<EOF
-d $PCMK_LIB 0755 root root
+d $PCMK_LIB 0750 hacluster haclient
d $PE_STATE_DIR 0750 hacluster haclient
d $CIB_DIR 0750 hacluster haclient
EOF
diff --git a/hb_report/utillib.sh b/hb_report/utillib.sh
index 365aad6..0fcab80 100644
--- a/hb_report/utillib.sh
+++ b/hb_report/utillib.sh
@@ -175,10 +175,21 @@ getstamp_legacy() {
getstamp_rfc5424() {
awk '{print $1}'
}
+get_ts() {
+ local l="$1" ts
+ ts=$(str2time `echo "$l" | $getstampproc`)
+ if [ -z "$ts" ]; then
+ local fmt
+ for fmt in rfc5424 syslog legacy; do
+ [ "getstamp_$fmt" = "$getstampproc" ] && continue
+ ts=$(str2time `echo "$l" | getstamp_$fmt`)
+ [ -n "$ts" ] && break
+ done
+ fi
+ echo $ts
+}
linetime() {
- local l
- l=`tail -n +$2 $1 | head -1 | $getstampproc`
- str2time "$l"
+ get_ts "`tail -n +$2 $1 | head -1`"
}
find_getstampproc() {
local t l func trycnt
@@ -210,7 +221,7 @@ find_getstampproc() {
find_first_ts() {
local l ts
while read l; do
- ts=$(str2time "`echo $l | $getstampproc`")
+ ts=`get_ts "$l"`
[ "$ts" ] && break
warning "cannot extract time: |$l|; will try the next one"
done
@@ -355,24 +366,30 @@ pkg_mgr_list() {
# regex pkg_mgr
# no spaces allowed in regex
cat<<EOF
-Try:.zypper.install zypper
+zypper.install zypper
EOF
}
-MYBINARIES="crmd|pengine|lrmd|attrd|cib|mgmtd|stonithd|corosync|libplumb|libpils"
listpkg_zypper() {
local bins
local binary=$1 core=$2
gdb $binary $core </dev/null 2>&1 |
- awk -v bins="$MYBINARIES" '
+ awk '
+ # this zypper version dumps all packages on a single line
+ /Missing separate debuginfos.*zypper.install/ {
+ sub(".*zypper.install ",""); print
+ exit}
n>0 && /^Try: zypper install/ {gsub("\"",""); print $NF}
n>0 {n=0}
- /Missing separate debuginfo/ && match($NF, bins) {n=1}
+ /Missing separate debuginfo/ {n=1}
' | sort -u
}
fetchpkg_zypper() {
+ local pkg
debug "get debuginfo packages using zypper: $@"
zypper -qn ref > /dev/null
- zypper -qn install -C $@ >/dev/null
+ for pkg in $@; do
+ zypper -qn install -C $pkg >/dev/null
+ done
}
find_pkgmgr() {
local binary=$1 core=$2
@@ -390,7 +407,7 @@ get_debuginfo() {
local binary=$1 core=$2
local pkg_mgr pkgs
gdb $binary $core </dev/null 2>/dev/null |
- grep 'no debugging symbols found' > /dev/null ||
+ egrep 'Missing.*debuginfo|no debugging symbols found' > /dev/null ||
return # no missing debuginfo
pkg_mgr=`find_pkgmgr $binary $core`
if [ -z "$pkg_mgr" ]; then
@@ -671,13 +688,10 @@ distro() {
pkg_ver_deb() {
dpkg-query -f '${Name} ${Version}' -W $* 2>/dev/null
- debsums -s $* 2>/dev/null
}
pkg_ver_rpm() {
- {
- rpm -q --qf '%{name} %{version}-%{release} - %{distribution} %{arch}\n' $*
- rpm --verify $*
- } 2>&1 | grep -v 'not installed'
+ rpm -q --qf '%{name} %{version}-%{release} - %{distribution} %{arch}\n' $* 2>&1 |
+ grep -v 'not installed'
}
pkg_ver_pkg_info() {
for pkg; do
@@ -689,7 +703,20 @@ pkg_ver_pkginfo() {
pkginfo $pkg | awk '{print $3}' # format?
done
}
-pkg_ver() {
+verify_deb() {
+ debsums -s $* 2>/dev/null
+}
+verify_rpm() {
+ rpm --verify $* 2>&1 | grep -v 'not installed'
+}
+verify_pkg_info() {
+ :
+}
+verify_pkginfo() {
+ :
+}
+
+get_pkg_mgr() {
local pkg_mgr
if which dpkg >/dev/null 2>&1 ; then
pkg_mgr="deb"
@@ -700,12 +727,25 @@ pkg_ver() {
elif which pkginfo >/dev/null 2>&1 ; then
pkg_mgr="pkginfo"
else
- echo "Unknown package manager!"
+ warning "Unknown package manager!"
return
fi
+ echo $pkg_mgr
+}
+
+pkg_versions() {
+ local pkg_mgr=`get_pkg_mgr`
+ [ -z "$pkg_mgr" ] &&
+ return
debug "the package manager is $pkg_mgr"
pkg_ver_$pkg_mgr $*
}
+verify_packages() {
+ local pkg_mgr=`get_pkg_mgr`
+ [ -z "$pkg_mgr" ] &&
+ return
+ verify_$pkg_mgr $*
+}
crm_info() {
$CRM_DAEMON_DIR/crmd version 2>&1
diff --git a/lib/clplumbing/cl_log.c b/lib/clplumbing/cl_log.c
index 13c3322..213e760 100644
--- a/lib/clplumbing/cl_log.c
+++ b/lib/clplumbing/cl_log.c
@@ -719,12 +719,12 @@ cl_log(int priority, const char * fmt, ...)
}
if (stderr_enabled) {
- print_logline(stderr, cl_log_entity,cl_process_pid,
+ append_log(stderr, cl_log_entity,cl_process_pid,
NULLTIME, prio2str(priority), buf);
}
if (stdout_enabled) {
- print_logline(stdout, cl_log_entity,cl_process_pid,
+ append_log(stdout, cl_log_entity,cl_process_pid,
NULLTIME, prio2str(priority), buf);
}
diff --git a/lib/clplumbing/ipcsocket.c b/lib/clplumbing/ipcsocket.c
index 679b70d..14c3504 100644
--- a/lib/clplumbing/ipcsocket.c
+++ b/lib/clplumbing/ipcsocket.c
@@ -1388,8 +1388,15 @@ socket_resume_io_read(struct IPC_CHANNEL *ch, int* nbytes, gboolean read1anyway)
*nbytes = msg_len;
nmsgs = ipc_bufpool_update(pool, ch, msg_len, ch->recv_queue) ;
- SocketIPCStats.ninqueued += nmsgs;
-
+ if (nmsgs < 0) {
+ /* we didn't like the other side */
+ cl_log(LOG_ERR, "socket_resume_io_read: "
+ "disconnecting the other side");
+ ch->ch_status = IPC_DISCONNECT;
+ retcode = IPC_FAIL;
+ } else {
+ SocketIPCStats.ninqueued += nmsgs;
+ }
}
}
diff --git a/lib/clplumbing/ocf_ipc.c b/lib/clplumbing/ocf_ipc.c
index 28c168c..c243934 100644
--- a/lib/clplumbing/ocf_ipc.c
+++ b/lib/clplumbing/ocf_ipc.c
@@ -445,8 +445,8 @@ ipc_bufpool_update(struct ipc_bufpool* pool,
if (head->magic != HEADMAGIC) {
GList* last = g_list_last(rqueue->queue);
cl_log(LOG_ERR, "ipc_bufpool_update: "
- "magic number in head does not match."
- "Something very bad happened, abort now, farside pid =%d",
+ "magic number in head does not match. "
+ "Something very bad happened, farside pid =%d",
ch->farside_pid);
cl_log(LOG_ERR, "magic=%x, expected value=%x", head->magic, HEADMAGIC);
ipc_bufpool_display(pool);
@@ -456,7 +456,7 @@ ipc_bufpool_update(struct ipc_bufpool* pool,
IPC_Message* m = (IPC_Message*)last;
ipcmsg_display(m);
}
- abort();
+ return -1;
}
if ( head->msg_len > MAXMSG) {
diff --git a/lib/plugins/stonith/external/vcenter b/lib/plugins/stonith/external/vcenter
index 96cfdb8..71a6302 100755
--- a/lib/plugins/stonith/external/vcenter
+++ b/lib/plugins/stonith/external/vcenter
@@ -106,6 +106,16 @@ Enable/disable a PowerOnVM on reset when the target virtual machine is off
Allowed values: 0, 1
</longdesc>
</parameter>
+<parameter name="PERL_LWP_SSL_VERIFY_HOSTNAME">
+<content type="string"/>
+<shortdesc lang="en">Enable or disable SSL hostname verification</shortdesc>
+<longdesc lang="en">
+To disable SSL hostname verification set this option to 0.
+To enable hostname verification, set this option to 1.
+This option is actually part of the LWP Perl library.
+See LWP(3pm) for more information.
+</longdesc>
+</parameter>
</parameters>} . "\n";
}
else { dielog("Invalid command specified: $command\n"); }
diff --git a/lib/plugins/stonith/ipmilan_command.c b/lib/plugins/stonith/ipmilan_command.c
index 8549805..a3de493 100644
--- a/lib/plugins/stonith/ipmilan_command.c
+++ b/lib/plugins/stonith/ipmilan_command.c
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <sys/socket.h>
+#include <OpenIPMI/ipmiif.h>
#include <OpenIPMI/selector.h>
#include <OpenIPMI/ipmi_conn.h>
#include <OpenIPMI/ipmi_lan.h>
diff --git a/logd/Makefile.am b/logd/Makefile.am
index 3005c7d..7ac75e2 100644
--- a/logd/Makefile.am
+++ b/logd/Makefile.am
@@ -48,5 +48,9 @@ ha_logger_LDADD = $(top_builddir)/lib/clplumbing/libplumb.la
logtest_SOURCES = logtest.c
logtest_LDADD = $(top_builddir)/lib/clplumbing/libplumb.la
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = \
+ logd.service
+else
initd_SCRIPTS = logd
-
+endif
diff --git a/logd/ha_logd.c b/logd/ha_logd.c
index 06cdd6e..c98b9d7 100644
--- a/logd/ha_logd.c
+++ b/logd/ha_logd.c
@@ -637,7 +637,7 @@ parse_config(const char* cfgfile)
gboolean ret = TRUE;
if ((f = fopen(cfgfile, "r")) == NULL){
- cl_perror("Cannot open config file [%s]", cfgfile);
+ cl_log(LOG_WARNING, "Cannot open config file [%s]", cfgfile);
return(FALSE);
}
@@ -1016,9 +1016,13 @@ main(int argc, char** argv, char** envp)
if (cfgfile && !parse_config(cfgfile)) {
- cl_log(LOG_ERR, "Config file [%s] is incorrect."
- , cfgfile);
- exit(LSB_EXIT_NOTCONFIGED);
+ FILE* f;
+ if ((f = fopen(cfgfile, "r")) != NULL){
+ fclose(f);
+ cl_log(LOG_ERR, "Config file [%s] is incorrect."
+ , cfgfile);
+ exit(LSB_EXIT_NOTCONFIGED);
+ }
}
if (strlen(logd_config.debugfile) > 0) {
diff --git a/logd/logd.service.in b/logd/logd.service.in
new file mode 100644
index 0000000..9783547
--- /dev/null
+++ b/logd/logd.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=ha_logd logging daemon
+Before=pacemaker.service
+PartOf=pacemaker.service
+
+[Service]
+ExecStart=@libdir@/@HB_PKG@/ha_logd -c @sysconfdir@/logd.cf
+ExecStartPre=/bin/rm -f @HA_VARRUNDIR@/logd.pid
+ExecStopPost=/bin/rm -f @HA_VARRUNDIR@/logd.pid
+PIDFile=@HA_VARRUNDIR@/logd.pid
+
+[Install]
+WantedBy=multi-user.target
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/cluster-glue.git
More information about the Debian-HA-Commits
mailing list