Hello community,
here is the log from the commit of package cluster-glue for openSUSE:Factory
checked in at Thu Dec 2 16:12:41 CET 2010.
--------
--- cluster-glue/cluster-glue.changes 2010-06-25 04:14:41.000000000 +0200
+++ cluster-glue/cluster-glue.changes 2010-11-23 10:43:50.000000000 +0100
@@ -1,0 +2,48 @@
+Tue Nov 23 09:43:43 UTC 2010 - coolo@novell.com
+
+- build against libnet-devel on 11.4
+
+-------------------------------------------------------------------
+Thu Aug 12 14:46:19 UTC 2010 - lmb@novell.com
+
+- stonith: Reduce logging.
+- stonith: Improve response times by avoiding unnecessary queries to
+ plugins (bnc#630357)
+- stonith: external: interpret properly exit codes from external stonith
+ plugins (bnc#630357)
+- Upstream version cs: a146a145a3e
+
+-------------------------------------------------------------------
+Wed Aug 4 11:12:08 UTC 2010 - lmb@novell.com
+
+- sbd: increase IO priority to improve behaviour under load; it will
+ take precedence over all other IO (FATE#310113).
+ This requires the sbd device to use the CFQ scheduler for full effect.
+- Upstream version cs: fb42b94f6f05
+
+-------------------------------------------------------------------
+Fri Jul 16 08:46:43 UTC 2010 - dmuhamedagic@novell.com
+
+- fix a wrong function declaration
+- Upstream version cs: 8286b46c91e3
+
+-------------------------------------------------------------------
+Fri Jul 9 16:49:56 UTC 2010 - dmuhamedagic@novell.com
+
+- set version to 1.0.6
+- ha_logger: log strings longer than 1024
+- lrmd: don't allow cancelled operations to get back to the repeating op
+ list (lf#2417)
+- lrmd: exclude stonith resources from child count (bnc#612387)
+- lrmd,clientlib: asynchronous resource delete notification (lf#2439)
+- stonith: add -V (version) to stonith
+- stonith: add -E option to get the configuration from the environment
+- stonith: ha_log: feed the message to stdout and not on command line
+- stonith: external/sbd,xen0: fix wrong reference from ha_log to
+ ha_log.sh (deb#585120)
+- stonith: external/rackpdu: check the snmpset and snmpwalk exit codes
+- hb_report: create cib.txt after sanitizing the CIB (lf#2415)
+- doc: generate lrmadmin.8 from the help text
+- upstream version: stable release 1.0.6 (cs: 1c54d2895647)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
remove-unused-tmp-var.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cluster-glue.spec ++++++
--- /var/tmp/diff_new_pack.xy832F/_old 2010-12-02 16:10:43.000000000 +0100
+++ /var/tmp/diff_new_pack.xy832F/_new 2010-12-02 16:10:43.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package cluster-glue (Version 1.0.5)
+# spec file for package cluster-glue (Version 1.0.6)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -36,17 +36,24 @@
Name: cluster-glue
Summary: The Heartbeat Subsystem for High-Availability Linux
-Version: 1.0.5
+Version: 1.0.6
Release: 1
License: GPLv2 ; LGPLv2.1+
Url: http://linux-ha.org/
Group: Productivity/Clustering/HA
Source: cluster-glue.tar.bz2
+Patch1: remove-unused-tmp-var.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
AutoReqProv: on
BuildRequires: autoconf automake e2fsprogs-devel glib2-devel libtool libxml2-devel pkgconfig python-devel
-BuildRequires: OpenIPMI-devel libnet net-snmp-devel openhpi-devel
+BuildRequires: OpenIPMI-devel net-snmp-devel openhpi-devel
BuildRequires: docbook-xsl-stylesheets docbook_4 libxslt
+BuildRequires: help2man
+%if 0%{?suse_version} > 1130
+BuildRequires: libnet-devel
+%else
+BuildRequires: libnet
+%endif
Conflicts: heartbeat-common < 3.0.2
Obsoletes: heartbeat-common < 3.0.2
Requires(pre): /usr/sbin/groupadd /usr/bin/getent /usr/sbin/useradd
@@ -165,6 +172,7 @@
%prep
###########################################################
%setup -n cluster-glue -q
+%patch1 -p1
###########################################################
%build
++++++ cluster-glue.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/.hg_archival.txt new/cluster-glue/.hg_archival.txt
--- old/cluster-glue/.hg_archival.txt 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/.hg_archival.txt 2010-08-12 16:46:02.000000000 +0200
@@ -1,5 +1,5 @@
repo: e3ffdd7ae81c596b2be7e1e110d2c1255161340e
-node: 1448deafdf79754d12c36993d633bb2a68f82034
+node: ba146a145a3ede967af48e8936ac414984aa1e5f
branch: default
-latesttag: glue-1.0.5
+latesttag: glue-1.0.6
latesttagdistance: 9
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/.hgtags new/cluster-glue/.hgtags
--- old/cluster-glue/.hgtags 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/.hgtags 2010-08-12 16:46:02.000000000 +0200
@@ -56,3 +56,4 @@
761edff8c35ea2cdf3e1bd37d600b06233e61d4f glue-1.0.4-rc1
3229873980e1028bf05de81f5bafccb3a92b9aa4 glue-1.0.4
3af80b93d9e5d5e441f3f4c3aad16775ea27d2d9 glue-1.0.5
+1c87a0c58c59fc384b93ec11476cefdbb6ddc1e1 glue-1.0.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/ChangeLog new/cluster-glue/ChangeLog
--- old/cluster-glue/ChangeLog 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/ChangeLog 2010-08-12 16:46:02.000000000 +0200
@@ -1,6 +1,23 @@
+* Fri Jul 9 2010 Dejan Muhamedagic
+- stable release 1.0.6
+- clplumbing: Add identity info of the user on the other side of socket
+- ha_logger: log strings longer than 1024
+- lrmd: remove operation history on client unregister (lf#2161)
+- lrmd: don't allow cancelled operations to get back to the repeating op list (lf#2417)
+- lrmd: exclude stonith resources from child count (bnc#612387)
+- lrmd,clientlib: asynchronous resource delete notification (lf#2439)
+- stonith: add -V (version) to stonith
+- stonith: add -E option to get the configuration from the environment
+- stonith: ha_log: feed the message to stdout and not on command line
+- stonith: external/sbd,xen0: fix wrong reference from ha_log to ha_log.sh (deb#585120)
+- stonith: external/sbd: reduce monitoring
+- stonith: external/rackpdu: check the snmpset and snmpwalk exit codes
+- hb_report: create cib.txt after sanitizing the CIB (lf#2415)
+
* Mon Apr 15 2010 Dejan Muhamedagic
- stable release 1.0.5
- clplumbing: revert changeset 81ad41d14f72 which breaks the ABI
+
* Mon Apr 12 2010 Dejan Muhamedagic
- stable release 1.0.4
- clplumbing: fix memory leak in cl_msg/lrmd (lf#1841,2389)
@@ -29,9 +46,11 @@
- hb_report: when creating cts reports get information from the log
- hb_report: new option -d to keep the directory
- hb_report: don't give up early when creating backtraces (lf#2350)
+
* Tue Feb 02 2010 Dejan Muhamedagic
- bugfix release 1.0.3
- lrmd: don't flush operations which don't belong to the requesting client (lf#2161)
+
* Mon Feb 01 2010 Dejan Muhamedagic and MANY others
- stable release 1.0.2
- clplumbing: fix a potential resource leak in cl_random (bnc#525393)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/cluster-glue-fedora.spec new/cluster-glue/cluster-glue-fedora.spec
--- old/cluster-glue/cluster-glue-fedora.spec 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/cluster-glue-fedora.spec 2010-08-12 16:46:02.000000000 +0200
@@ -15,7 +15,7 @@
Name: cluster-glue
Summary: Reusable cluster components
-Version: 1.0.5
+Version: 1.0.6
Release: 1%{?dist}
License: GPLv2+ and LGPLv2+
Url: http://www.linux-ha.org/wiki/Cluster_Glue
@@ -39,6 +39,7 @@
BuildRequires: bzip2-devel glib2-devel python-devel libxml2-devel
BuildRequires: OpenIPMI-devel openssl-devel
BuildRequires: libxslt docbook-dtds docbook-style-xsl
+BuildRequires: help2man
%if 0%{?fedora}
BuildRequires: libcurl-devel libnet-devel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/cluster-glue-suse.spec new/cluster-glue/cluster-glue-suse.spec
--- old/cluster-glue/cluster-glue-suse.spec 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/cluster-glue-suse.spec 2010-08-12 16:46:02.000000000 +0200
@@ -29,7 +29,7 @@
Name: cluster-glue
Summary: Reusable cluster components
-Version: 1.0.5
+Version: 1.0.6
Release: 1%{?dist}
License: GPL v2 or later; LGPL v2.1 or later
Url: http://www.linux-ha.org/wiki/Cluster_Glue
@@ -40,6 +40,7 @@
BuildRequires: automake autoconf libtool e2fsprogs-devel glib2-devel pkgconfig python-devel libxml2-devel
BuildRequires: libnet net-snmp-devel OpenIPMI-devel openhpi-devel
BuildRequires: libxslt docbook_4 docbook-xsl-stylesheets
+BuildRequires: help2man
Obsoletes: heartbeat-common
Provides: heartbeat-common
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/configure.ac new/cluster-glue/configure.ac
--- old/cluster-glue/configure.ac 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/configure.ac 2010-08-12 16:46:02.000000000 +0200
@@ -19,7 +19,7 @@
dnl checks for library functions
dnl checks for system services
-AC_INIT(cluster-glue, 1.0.5, linux-ha-dev@lists.linux-ha.org)
+AC_INIT(cluster-glue, 1.0.6, linux-ha-dev@lists.linux-ha.org)
PKG_FEATURES=""
HB_PKG=heartbeat
@@ -427,19 +427,19 @@
AC_PATH_PROGS(HG, hg false)
AC_MSG_CHECKING(build version)
-BUILD_VERSION=unknown
+GLUE_BUILD_VERSION=unknown
if test -f $srcdir/.hg_archival.txt; then
- BUILD_VERSION=`cat $srcdir/.hg_archival.txt | awk '/node:/ { print $2 }'`
+ GLUE_BUILD_VERSION=`cat $srcdir/.hg_archival.txt | awk '/node:/ { print $2 }'`
elif test -x $HG -a -d .hg; then
- BUILD_VERSION=`$HG id -itb`
+ GLUE_BUILD_VERSION=`$HG id -itb`
if test $? != 0; then
- BUILD_VERSION=unknown
+ GLUE_BUILD_VERSION=unknown
fi
fi
-AC_DEFINE_UNQUOTED(BUILD_VERSION, "$BUILD_VERSION", Build version)
-AC_MSG_RESULT($BUILD_VERSION)
-AC_SUBST(BUILD_VERSION)
+AC_DEFINE_UNQUOTED(GLUE_BUILD_VERSION, "$GLUE_BUILD_VERSION", Build version)
+AC_MSG_RESULT($GLUE_BUILD_VERSION)
+AC_SUBST(GLUE_BUILD_VERSION)
dnl check if there are getpid() inconsistency
@@ -1140,7 +1140,10 @@
CC_EXTRAS=""
if export | fgrep " CFLAGS=" > /dev/null; then
- export -n CFLAGS || true # We don't want to bomb out if this fails
+ SAVED_CFLAGS="$CFLAGS"
+ unset CFLAGS
+ CFLAGS="$SAVED_CFLAGS"
+ unset SAVED_CFLAGS
fi
if test "$GCC" != yes; then
@@ -1333,7 +1336,7 @@
AC_MSG_RESULT([])
AC_MSG_RESULT([$PACKAGE configuration:])
-AC_MSG_RESULT([ Version = ${VERSION} (Build: $BUILD_VERSION)])
+AC_MSG_RESULT([ Version = ${VERSION} (Build: $GLUE_BUILD_VERSION)])
AC_MSG_RESULT([ Features =${PKG_FEATURES}])
AC_MSG_RESULT([])
AC_MSG_RESULT([ Prefix = ${prefix}])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/doc/stonith/Makefile.am new/cluster-glue/doc/stonith/Makefile.am
--- old/cluster-glue/doc/stonith/Makefile.am 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/doc/stonith/Makefile.am 2010-08-12 16:46:02.000000000 +0200
@@ -25,6 +25,7 @@
README.ibmrsa-telnet \
README.ipmilan \
README.meatware \
+ README.rackpdu \
README.rcd_serial \
README.riloe \
README.vacm \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/doc/stonith/README.rackpdu new/cluster-glue/doc/stonith/README.rackpdu
--- old/cluster-glue/doc/stonith/README.rackpdu 1970-01-01 01:00:00.000000000 +0100
+++ new/cluster-glue/doc/stonith/README.rackpdu 2010-08-12 16:46:02.000000000 +0200
@@ -0,0 +1,21 @@
+APC Rack PDU
+
+The product information pages:
+
+http://www.apcc.com/products/family/index.cfm?id=70
+
+The User's Guide:
+
+http://www.apcmedia.com/salestools/ASTE-6Z6KAV_R1_EN.pdf
+
+Apparently, an existing http or telnet session will make the
+plugin fail.
+
+In case your nodes are equipped with multiple power supplies, the
+PDU supports synchronous operation on multiple outlets on up to
+four Switched Rack PDUs. See the User's Guide for more
+information on how to setup outlet groups.
+
+NB: There has been a report by one user that in case a link
+between two PDUs in the chain is broken, the PDU returns success
+even though it failed. This needs to be verified.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/hb_report/hb_report.in new/cluster-glue/hb_report/hb_report.in
--- old/cluster-glue/hb_report/hb_report.in 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/hb_report/hb_report.in 2010-08-12 16:46:02.000000000 +0200
@@ -121,19 +121,24 @@
hb_report -f cts:133 /tmp/ctstest_133
. WARNING . WARNING . WARNING . WARNING . WARNING . WARNING .
- We try to sanitize the CIB and the peinputs files. If you
- have more sensitive information, please supply additional
- patterns yourself. The logs and the crm_mon, ccm_tool, and
- crm_verify output are *not* sanitized.
+
+ We won't sanitize the CIB and the peinputs files, because
+ that would make them useless when trying to reproduce the
+ PE behaviour. You may still choose to obliterate sensitive
+ information if you use the -s and -p options, but in that
+ case the support may be lacking as well. The logs and the
+ crm_mon, ccm_tool, and crm_verify output are *not* sanitized.
+
Additional system logs (/var/log/messages) are collected in
order to have a more complete report. If you don't want that
specify -M.
+
IT IS YOUR RESPONSIBILITY TO PROTECT THE DATA FROM EXPOSURE!
EOF
exit
}
version() {
- echo "@PACKAGE_NAME@: @PACKAGE_VERSION@ (@BUILD_VERSION@)"
+ echo "@PACKAGE_NAME@: @PACKAGE_VERSION@ (@GLUE_BUILD_VERSION@)"
exit
}
#
@@ -516,7 +521,7 @@
(
cd `dirname $1`
ptest -D $dotf -x $pef
- dot -Tpng -o $pngf $dotf >/dev/null 2>&1
+ # dot -Tpng -o $pngf $dotf >/dev/null 2>&1
)
}
getpeinputs() {
@@ -926,7 +931,6 @@
u) SSH_USER="$OPTARG";;
l) HA_LOG="$OPTARG";;
e) EDITOR="$OPTARG";;
- s) DO_SANITIZE="1";;
p) SANITIZE="$SANITIZE $OPTARG";;
s) DO_SANITIZE="1";;
L) LOG_PATTERNS="$LOG_PATTERNS $OPTARG";;
@@ -1199,6 +1203,7 @@
getconfigurations $DESTDIR/$WE
touch_DC_if_dc $DESTDIR/$WE
sanitize $DESTDIR/$WE
+ crmconfig $DESTDIR/$WE
check_perms > $DESTDIR/$WE/$PERMISSIONS_F 2>&1
sys_info > $DESTDIR/$WE/$SYSINFO_F 2>&1
dlm_dump > $DESTDIR/$WE/$DLM_DUMP_F 2>&1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/hb_report/utillib.sh new/cluster-glue/hb_report/utillib.sh
--- old/cluster-glue/hb_report/utillib.sh 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/hb_report/utillib.sh 2010-08-12 16:46:02.000000000 +0200
@@ -404,9 +404,10 @@
crm_uuid -r > $1/$HB_UUID_F 2>&1
[ -f "$1/$CIB_F" ] &&
crm_verify -V -x $1/$CIB_F >$1/$CRM_VERIFY_F 2>&1
+}
+crmconfig() {
[ -f "$1/$CIB_F" ] && which crm >/dev/null 2>&1 &&
CIB_file=$1/$CIB_F crm configure show >$1/$CIB_TXT_F 2>&1
-
}
get_crm_nodes() {
cibadmin -Ql -o nodes |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/include/glue_config.h.in new/cluster-glue/include/glue_config.h.in
--- old/cluster-glue/include/glue_config.h.in 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/include/glue_config.h.in 2010-08-12 16:46:02.000000000 +0200
@@ -77,9 +77,12 @@
/* Compiling for Linux platform */
#undef ON_LINUX
-/* Current pacemaker version */
+/* Current glue version */
#undef GLUE_VERSION
+/* Build version */
+#undef GLUE_BUILD_VERSION
+
/* Location of non-pluing stonith scripts */
#undef STONITH_EXT_PLUGINDIR
@@ -93,4 +96,3 @@
#undef ST_TEXTDOMAIN
#undef HA_HBCONF_DIR
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/include/lrm/lrm_api.h new/cluster-glue/include/lrm/lrm_api.h
--- old/cluster-glue/include/lrm/lrm_api.h 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/include/lrm/lrm_api.h 2010-08-12 16:46:02.000000000 +0200
@@ -149,6 +149,7 @@
unsigned long t_rcchange; /* last rc change (as age) */
unsigned long exec_time; /* time it took the op to run */
unsigned long queue_time; /* time spent in queue */
+ int rsc_deleted; /* resource just deleted? */
}lrm_op_t;
extern const lrm_op_t lrm_zero_op; /* an all-zeroes lrm_op_t value */
@@ -172,6 +173,9 @@
#define DEFAULT_FAIL_REASON "asynchronous monitor error"
#define ASYNC_OP_NAME "asyncmon"
+/* in addition to HA_OK and HA_FAIL */
+#define HA_RSCBUSY 2
+
struct rsc_ops
{
/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/include/lrm/lrm_msg.h new/cluster-glue/include/lrm/lrm_msg.h
--- old/cluster-glue/include/lrm/lrm_msg.h 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/include/lrm/lrm_msg.h 2010-08-12 16:46:02.000000000 +0200
@@ -67,6 +67,7 @@
#define F_LRM_TARGETRC "lrm_targetrc"
#define F_LRM_LASTRC "lrm_lastrc"
#define F_LRM_STATUS "lrm_status"
+#define F_LRM_RSCDELETED "lrm_rscdeleted"
#define F_LRM_METADATA "lrm_metadata"
#define F_LRM_USERDATA "lrm_userdata"
#define F_LRM_DELAY "lrm_delay"
@@ -114,7 +115,6 @@
#define MAX_PARAM_LEN 1024
-
GHashTable* copy_str_table(GHashTable* hash_table);
GHashTable* merge_str_tables(GHashTable* old, GHashTable* new);
void free_str_table(GHashTable* hash_table);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/include/stonith/stonith.h new/cluster-glue/include/stonith/stonith.h
--- old/cluster-glue/include/stonith/stonith.h 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/include/stonith/stonith.h 2010-08-12 16:46:02.000000000 +0200
@@ -123,6 +123,7 @@
int stonith_get_status (Stonith* s);
int stonith_req_reset (Stonith* s, int operation, const char* node);
+StonithNVpair* stonith_env_to_NVpair(Stonith* s);
/* Stonith 1 compatibility: Convert string to an NVpair set */
StonithNVpair*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lib/clplumbing/ipctransientclient.c new/cluster-glue/lib/clplumbing/ipctransientclient.c
--- old/cluster-glue/lib/clplumbing/ipctransientclient.c 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lib/clplumbing/ipctransientclient.c 2010-08-12 16:46:02.000000000 +0200
@@ -159,11 +159,11 @@
if(lpc < MAX_MESSAGES && strcmp(messages[lpc], buffer) != 0)
{
- cl_log(LOG_ERR, "[Client] Recieved someone else's message [%s] instead of [%s]", buffer, messages[lpc]);
+ cl_log(LOG_ERR, "[Client] Received someone else's message [%s] instead of [%s]", buffer, messages[lpc]);
}
else if(lpc >= MAX_MESSAGES)
{
- cl_log(LOG_ERR, "[Client] Recieved an extra message [%s]", buffer);
+ cl_log(LOG_ERR, "[Client] Receivedan extra message [%s]", buffer);
}
lpc++;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lib/lrm/clientlib.c new/cluster-glue/lib/lrm/clientlib.c
--- old/cluster-glue/lib/lrm/clientlib.c 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lib/lrm/clientlib.c 2010-08-12 16:46:02.000000000 +0200
@@ -884,6 +884,7 @@
lrm_delete_rsc (ll_lrm_t* lrm, const char* rsc_id)
{
struct ha_msg* msg = NULL;
+ int rc;
/* check whether the rsc_id is available */
if (NULL == rsc_id || RID_LEN <= strlen(rsc_id)) {
@@ -911,12 +912,13 @@
}
ha_msg_del(msg);
/* check the response of the msg */
- if (HA_OK != get_ret_from_ch(ch_cmd)) {
+ rc = get_ret_from_ch(ch_cmd);
+ if (rc != HA_OK && rc != HA_RSCBUSY) {
LOG_GOT_FAIL_RET(LOG_ERR, DELRSC);
return HA_FAIL;
}
- return HA_OK;
+ return rc;
}
static IPC_Channel*
@@ -1098,7 +1100,7 @@
rc = get_ret_from_ch(ch_cmd);
- return rc>0?HA_OK:HA_FAIL;
+ return rc>0?rc:HA_FAIL;
}
static gint
compare_call_id(gconstpointer a, gconstpointer b)
@@ -1404,6 +1406,8 @@
/* op->params */
op->params = ha_msg_value_str_table(msg, F_LRM_PARAM);
+ ha_msg_value_int(msg, F_LRM_RSCDELETED, &op->rsc_deleted);
+
return op;
}
@@ -1593,11 +1597,11 @@
case EXECRA_FAILED_MASTER:
return "master (failed)";
case EXECRA_RA_DEAMON_DEAD1:
- return "status: deamon dead";
+ return "status: daemon dead";
case EXECRA_RA_DEAMON_DEAD2:
- return "status: deamon dead";
+ return "status: daemon dead";
case EXECRA_RA_DEAMON_STOPPED:
- return "status: deamon stopped";
+ return "status: daemon stopped";
case EXECRA_STATUS_UNKNOWN:
return "status: unknown";
default:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lib/plugins/stonith/external/ibmrsa new/cluster-glue/lib/plugins/stonith/external/ibmrsa
--- old/cluster-glue/lib/plugins/stonith/external/ibmrsa 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lib/plugins/stonith/external/ibmrsa 2010-08-12 16:46:02.000000000 +0200
@@ -7,7 +7,7 @@
# This STONITH module depends on IBMmpcli.
#
-trap 'if [ -n "$outf" ]; then ha_log.sh err "`cat $outf`"; rm -f "$outf"; fi' 0
+trap 'rm -f "$outf"' 0
outf=`mktemp` || {
ha_log.sh err 'mktemp failed'
exit 1
@@ -36,7 +36,7 @@
cat
) | /opt/IBMmpcli/bin/MPCLI.sh | grep -w $goodstg >/dev/null 2>&1
rc=$?
- grep -w $failstg $outf
+ grep -w $failstg $outf >/dev/null
if [ $rc -eq 0 -a $? -eq 1 ]; then
return 0
else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lib/plugins/stonith/external/rackpdu new/cluster-glue/lib/plugins/stonith/external/rackpdu
--- old/cluster-glue/lib/plugins/stonith/external/rackpdu 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lib/plugins/stonith/external/rackpdu 2010-08-12 16:46:02.000000000 +0200
@@ -66,12 +66,16 @@
fi
else
# Get outlet number from device
-
+
local outlet_num=1
- local snmp_result=`snmpwalk -v1 -c $community $pduip $names_oid 2>&1`
+ local snmp_result
+ snmp_result=`snmpwalk -v1 -c $community $pduip $names_oid 2>&1`
+ if [ $? -ne 0 ]; then
+ ha_log.sh err "snmpwalk $community $pduip $names_oid failed. Result: $snmp_result"
+ return 0
+ fi
local names=`echo "$snmp_result" | cut -f2 -d'"' | tr ' ' '_' | tr '\012' ' '`
-
for name in $names; do
if [ "$name" != "$nodename" ]; then
local outlet_num=`expr $outlet_num + 1`
@@ -95,14 +99,17 @@
local outlet=$?
if [ $outlet -gt 0 ]; then
- local set_result=`snmpset -v1 -c $community $pduip $oid.$outlet i $command 2>&1`
- local check_result=`echo "$set_result" | grep "Timeout"`
-
- if [ ! -z "$check_result" ]; then
- ha_log.sh err "Write SNMP value $oid.$outlet=$command. Result: $set_result"
- fi
-
- return 0
+ local set_result
+ set_result=`snmpset -v1 -c $community $pduip $oid.$outlet i $command 2>&1`
+ if [ $? -ne 0 ]; then
+ ha_log.sh err "Write SNMP to $pduip value $oid.$outlet=$command failed. Result: $set_result"
+ return 1
+ fi
+ if echo "$set_result" | grep -qs "Timeout"; then
+ ha_log.sh err "Write SNMP to $pduip value $oid.$outlet=$command timed out. Result: $set_result"
+ return 1
+ fi
+ return 0
else
return 1
fi
@@ -115,12 +122,15 @@
case $incommand in
gethosts)
if [ "$hostlist" = "AUTO" ]; then
+ local snmp_result
snmp_result=`snmpwalk -v1 -c $community $pduip $names_oid 2>&1`
- snmp_check=`echo "$snmp_result" | grep "Timeout"`
-
- if [ ! -z "$snmp_check" ]; then
- ha_log.sh err "Cannot read list of nodes from device. Result: $snmp_result"
- exit 1
+ if [ $? -ne 0 ]; then
+ ha_log.sh err "snmpwalk $community $pduip $names_oid failed. Result: $snmp_result"
+ exit 1
+ fi
+ if echo "$snmp_result" | grep -qs "Timeout"; then
+ ha_log.sh err "snmpwalk $community $pduip $names_oid timed out. Result: $snmp_result"
+ exit 1
else
hostlist=`echo "$snmp_result" | cut -f2 -d'"' | tr ' ' '_' | tr '\012' ' '`
fi
@@ -187,7 +197,7 @@
exit 0
;;
getinfo-devurl)
- echo "http://www.it-consultant.su/rackpdu"
+ echo "http://www.apcc.com/products/family/index.cfm?id=30"
exit 0
;;
getinfo-xml)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lib/plugins/stonith/external/sbd new/cluster-glue/lib/plugins/stonith/external/sbd
--- old/cluster-glue/lib/plugins/stonith/external/sbd 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lib/plugins/stonith/external/sbd 2010-08-12 16:46:02.000000000 +0200
@@ -20,7 +20,7 @@
;;
status)
if ! sbd -d $sbd_device list >/dev/null 2>&1 ; then
- ha_log err "sbd could not list nodes from $sbd_device"
+ ha_log.sh err "sbd could not list nodes from $sbd_device"
exit 1
fi
exit 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lib/plugins/stonith/external/xen0 new/cluster-glue/lib/plugins/stonith/external/xen0
--- old/cluster-glue/lib/plugins/stonith/external/xen0 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lib/plugins/stonith/external/xen0 2010-08-12 16:46:02.000000000 +0200
@@ -38,7 +38,7 @@
CheckHostList() {
if [ "x" = "x$hostlist" ]
then
- ha_log err "hostlist isn't set"
+ ha_log.sh err "hostlist isn't set"
exit 1
fi
}
@@ -46,7 +46,7 @@
CheckDom0() {
if [ "x" = "x$dom0" ]
then
- ha_log err "dom0 isn't set"
+ ha_log.sh err "dom0 isn't set"
exit 1
fi
}
@@ -66,7 +66,7 @@
if [ "x" = "x$node" ]
then
- ha_log err "Syntax error in host list"
+ ha_log.sh err "Syntax error in host list"
exit 1
fi
@@ -85,7 +85,7 @@
kill_node=`$SSH_COMMAND $dom0 "grep ^[[:space:]]*name $cfg" | cut -f 2 -d '=' | sed -e 's,",,g'`
if [ "x" = "x$kill_node" ]
then
- ha_log err "Couldn't find a node name to stop"
+ ha_log.sh err "Couldn't find a node name to stop"
exit 1
fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lib/plugins/stonith/external.c new/cluster-glue/lib/plugins/stonith/external.c
--- old/cluster-glue/lib/plugins/stonith/external.c 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lib/plugins/stonith/external.c 2010-08-12 16:46:02.000000000 +0200
@@ -415,7 +415,7 @@
for (p = sd->confignames; *p; p++) {
if (OurImports->GetValue(list, *p) == NULL) {
- LOG(PIL_INFO, "Cannot get parameter %s from "
+ LOG(PIL_DEBUG, "Cannot get parameter %s from "
"StonithNVpair", *p);
}
}
@@ -702,7 +702,7 @@
const int BUFF_LEN=4096;
char buff[BUFF_LEN];
int read_len = 0;
- int rc;
+ int status, rc;
char * data = NULL;
FILE * file;
char cmd[FILENAME_MAX+64];
@@ -811,9 +811,25 @@
goto out;
}
- rc = pclose(file);
- if (rc != 0) {
- LOG(PIL_INFO, "%s: Calling '%s' returned %d", __FUNCTION__, cmd, rc);
+ status = pclose(file);
+ if (WIFEXITED(status)) {
+ rc = WEXITSTATUS(status);
+ if (rc != 0) {
+ LOG(PIL_CRIT,
+ "%s: Calling '%s' returned %d", __FUNCTION__, cmd, rc);
+ }
+ } else {
+ if (WIFSIGNALED(status)) {
+ LOG(PIL_CRIT, "%s: '%s' got signal %d",
+ __FUNCTION__, cmd, WTERMSIG(status));
+ } else if (WIFSTOPPED(status)) {
+ LOG(PIL_INFO, "%s: '%s' stopped with signal %d",
+ __FUNCTION__, cmd, WSTOPSIG(status));
+ } else {
+ LOG(PIL_CRIT, "%s: '%s' exited abnormally (core dumped?)",
+ __FUNCTION__, cmd);
+ }
+ rc = -1;
}
if (Debug && output && data) {
LOG(PIL_DEBUG, "%s: '%s' output: %s", __FUNCTION__, cmd, data);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lib/stonith/ha_log.sh new/cluster-glue/lib/stonith/ha_log.sh
--- old/cluster-glue/lib/stonith/ha_log.sh 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lib/stonith/ha_log.sh 2010-08-12 16:46:02.000000000 +0200
@@ -23,7 +23,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# Build version: @BUILD_VERSION@
+# Build version: @GLUE_BUILD_VERSION@
PROG=`basename $0`
@@ -79,8 +79,9 @@
fi
[ "x$HA_LOGD" = "xyes" ] &&
- ha_logger -t "$HA_LOGTAG" "$msg" &&
- return 0
+ cat<
#include
-#define OPTIONS "c:F:p:t:T:snSlLmvhd"
+#define OPTIONS "c:F:p:t:T:EsnSlLmvhVd"
#define EQUAL '='
extern char * optarg;
@@ -61,6 +61,7 @@
"</special>\n"
"</resource-agent>\n";
+void version(void);
void usage(const char * cmd, int exit_status, const char * devtype);
void confhelp(const char * cmd, FILE* stream, const char * devtype);
void print_stonith_meta(Stonith * stonith_obj, const char *rsc_type);
@@ -73,6 +74,13 @@
*/
void
+version()
+{
+ printf("stonith: %s (%s)\n", GLUE_VERSION, GLUE_BUILD_VERSION);
+ exit(0);
+}
+
+void
usage(const char * cmd, int exit_status, const char * devtype)
{
FILE *stream;
@@ -100,6 +108,7 @@
"-t stonith-device-type "
"{-p stonith-device-parameters | "
"-F stonith-device-parameters-file | "
+ "-E | "
"name=value...} "
"[-c count] "
"-lS\n"
@@ -109,6 +118,7 @@
"-t stonith-device-type "
"{-p stonith-device-parameters | "
"-F stonith-device-parameters-file | "
+ "-E | "
"name=value...} "
"[-c count] "
"-T {reset|on|off} nodename\n"
@@ -283,6 +293,7 @@
int listhosts = 0;
int listtypes = 0;
int listparanames = 0;
+ int params_from_env = 0;
int c;
int errors = 0;
@@ -329,6 +340,9 @@
case 'F': optfile = optarg;
break;
+ case 'E': params_from_env = 1;
+ break;
+
case 'h': help++;
break;
@@ -373,6 +387,9 @@
case 'v': ++verbose;
break;
+ case 'V': version();
+ break;
+
default: ++errors;
break;
}
@@ -385,9 +402,10 @@
PILpisysSetDebugLevel(debug);
setenv("HA_debug","2",0);
}
- if (optfile && parameters) {
+ if ((optfile && parameters) || (optfile && params_from_env)
+ || (params_from_env && parameters)) {
fprintf(stderr
- , "Cannot include both -F and -p options\n");
+ , "Please use just one of -F, -p, and -E options\n");
usage(cmdname, 1, NULL);
}
@@ -411,6 +429,12 @@
"style arguments\n");
usage(cmdname, 1, NULL);
}
+ if (params_from_env) {
+ fprintf(stderr
+ , "Cannot use both -E and name=value "
+ "style arguments\n");
+ usage(cmdname, 1, NULL);
+ }
if (nvcount >= MAXNVARG) {
fprintf(stderr
, "Too many name=value style arguments\n");
@@ -468,7 +492,8 @@
stonith_set_debug(s, debug);
}
- if (!listparanames && !metadata && optfile == NULL && parameters == NULL && nvcount == 0) {
+ if (!listparanames && !metadata && optfile == NULL &&
+ parameters == NULL && !params_from_env && nvcount == 0) {
const char** names;
int needs_parms = 1;
@@ -478,7 +503,7 @@
if (needs_parms) {
fprintf(stderr
- , "Must specify either -p option, -F option or "
+ , "Must specify either -p option, -F option, -E option, or "
"name=value style arguments\n");
if (s != NULL) {
stonith_delete(s);
@@ -524,6 +549,21 @@
stonith_delete(s); s=NULL;
exit(S_BADCONFIG);
}
+ }else if (params_from_env) {
+ /* Configure Stonith object from the environment */
+ StonithNVpair * pairs;
+ if ((pairs = stonith_env_to_NVpair(s)) == NULL) {
+ fprintf(stderr
+ , "Invalid config info for %s device.\n"
+ , SwitchType);
+ stonith_delete(s); s=NULL;
+ exit(1);
+ }
+ if ((rc = stonith_set_config(s, pairs)) != S_OK) {
+ fprintf(stderr
+ , "Invalid config info for %s device\n"
+ , SwitchType);
+ }
}else if (parameters) {
/* Configure Stonith object from the -p argument */
StonithNVpair * pairs;
@@ -537,7 +577,7 @@
}
if ((rc = stonith_set_config(s, pairs)) != S_OK) {
fprintf(stderr
- , "Invalid config info for %s device"
+ , "Invalid config info for %s device\n"
, SwitchType);
}
}else{
@@ -569,19 +609,19 @@
for (j=0; j < count; ++j) {
- rc = stonith_get_status(s);
+ rc = S_OK;
- if ((tmp = stonith_get_info(s, ST_DEVICEID)) == NULL) {
- SwitchType = tmp;
- }
+ if (status) {
+ rc = stonith_get_status(s);
- if (status && !silent) {
- if (rc == S_OK) {
- syslog(LOG_ERR, "%s device OK.", SwitchType);
- }else{
- /* Uh-Oh */
- syslog(LOG_ERR, "%s device not accessible."
- , SwitchType);
+ if (!silent) {
+ if (rc == S_OK) {
+ syslog(LOG_ERR, "%s device OK.", SwitchType);
+ }else{
+ /* Uh-Oh */
+ syslog(LOG_ERR, "%s device not accessible."
+ , SwitchType);
+ }
}
}
@@ -592,6 +632,7 @@
if (hostlist == NULL) {
syslog(LOG_ERR, "Could not list hosts for %s."
, SwitchType);
+ rc = -1;
}else{
char ** this;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lib/stonith/sbd.c new/cluster-glue/lib/stonith/sbd.c
--- old/cluster-glue/lib/stonith/sbd.c 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lib/stonith/sbd.c 2010-08-12 16:46:02.000000000 +0200
@@ -19,12 +19,15 @@
#include
#include
#include
+#include
#include
#include
#include
#include
#include
+#include
#include
+#include
#include
#include
#include
@@ -50,6 +53,7 @@
static int watchdog_use = 0;
static int go_daemon = 0;
+static int skip_rt = 0;
static int debug = 0;
static const char *watchdogdev = "/dev/watchdog";
static char * local_uname;
@@ -73,6 +77,7 @@
"-h Display this help.\n"
"-n <node> Set local node name; defaults to uname -n (optional)\n"
"\n"
+"-R Do NOT enable realtime priority (debugging only)\n"
"-W Use watchdog (recommended) (watch only)\n"
"-w <dev> Specify watchdog device (optional) (watch only)\n"
"-D Run as background daemon (optional) (watch only)\n"
@@ -163,6 +168,53 @@
}
}
+/* This duplicates some code from linux/ioprio.h since these are not included
+ * even in linux-kernel-headers. Sucks. See also
+ * /usr/src/linux/Documentation/block/ioprio.txt and ioprio_set(2) */
+extern int sys_ioprio_set(int, int, int);
+static int ioprio_set(int which, int who, int ioprio);
+static inline int ioprio_set(int which, int who, int ioprio)
+{
+ return syscall(__NR_ioprio_set, which, who, ioprio);
+}
+
+enum {
+ IOPRIO_CLASS_NONE,
+ IOPRIO_CLASS_RT,
+ IOPRIO_CLASS_BE,
+ IOPRIO_CLASS_IDLE,
+};
+
+enum {
+ IOPRIO_WHO_PROCESS = 1,
+ IOPRIO_WHO_PGRP,
+ IOPRIO_WHO_USER,
+};
+
+#define IOPRIO_BITS (16)
+#define IOPRIO_CLASS_SHIFT (13)
+#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
+
+#define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
+#define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
+#define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data)
+
+static void
+maximize_priority(void)
+{
+ if (skip_rt) {
+ cl_log(LOG_INFO, "Not elevating to realtime (-R specified).");
+ return;
+ }
+
+ cl_make_realtime(-1, -1, 256, 256);
+
+ if (ioprio_set(IOPRIO_WHO_PROCESS, getpid(),
+ IOPRIO_PRIO_VALUE(IOPRIO_CLASS_RT, 1)) != 0) {
+ cl_perror("ioprio_set() call failed.");
+ }
+}
+
static int
open_device(const char* devname)
{
@@ -750,6 +802,9 @@
cl_log_enable_stderr(FALSE);
+ /* This is the child; ensure privileges have not been lost. */
+ maximize_priority();
+
umask(022);
close(0);
(void)open(devnull, O_RDONLY);
@@ -758,8 +813,6 @@
close(2);
(void)open(devnull, O_WRONLY);
cl_cdtocoredir();
- cl_make_realtime(-1, -1, 128, 128);
-
}
@@ -788,7 +841,7 @@
if (watchdog_use != 0)
watchdog_init();
-
+
while (1) {
t0 = time(NULL);
sleep(timeout_loop);
@@ -904,11 +957,14 @@
get_uname();
- while ((c = getopt (argc, argv, "DWhvw:d:n:1:2:3:4:5:")) != -1) {
+ while ((c = getopt (argc, argv, "DRWhvw:d:n:1:2:3:4:5:")) != -1) {
switch (c) {
case 'D':
go_daemon = 1;
break;
+ case 'R':
+ skip_rt = 1;
+ break;
case 'v':
debug = 1;
break;
@@ -956,6 +1012,7 @@
goto out;
}
+ maximize_priority();
if (open_device(devname) < 0) {
exit_status = -1;
goto out;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lib/stonith/sbd.h new/cluster-glue/lib/stonith/sbd.h
--- old/cluster-glue/lib/stonith/sbd.h 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lib/stonith/sbd.h 2010-08-12 16:46:02.000000000 +0200
@@ -87,5 +87,6 @@
static void do_off(void);
static void make_daemon(void);
static int daemonize(void);
+static void maximize_priority(void);
static void get_uname(void);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lib/stonith/stonith.c new/cluster-glue/lib/stonith/stonith.c
--- old/cluster-glue/lib/stonith/stonith.c 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lib/stonith/stonith.c 2010-08-12 16:46:02.000000000 +0200
@@ -517,6 +517,47 @@
return NULL;
}
+StonithNVpair*
+stonith_env_to_NVpair(Stonith* s)
+{
+ /* Read the config names values from the environment */
+ const char ** config_names;
+ int n_names;
+ int j;
+ StonithNVpair* ret;
+
+ if ((config_names = stonith_get_confignames(s)) == NULL) {
+ return NULL;
+ }
+ for (n_names=0; config_names[n_names] != NULL; ++n_names) {
+ /* Just count */;
+ }
+ ret = (StonithNVpair*) (MALLOC((n_names+1)*sizeof(StonithNVpair)));
+ if (ret == NULL) {
+ return NULL;
+ }
+ memset(ret, 0, (n_names+1)*sizeof(StonithNVpair));
+ for (j=0; j < n_names; ++j) {
+ char *env_value;
+ if ((ret[j].s_name = STRDUP(config_names[j])) == NULL) {
+ goto freeandexit;
+ }
+ env_value = getenv(config_names[j]);
+ if (env_value) {
+ if ((ret[j].s_value = STRDUP(env_value)) == NULL) {
+ goto freeandexit;
+ }
+ } else {
+ ret[j].s_value = NULL;
+ }
+ }
+ ret[j].s_name = NULL;
+ return ret;
+freeandexit:
+ free_NVpair(ret); ret = NULL;
+ return NULL;
+}
+
static int NVcur = -1;
static int NVmax = -1;
static gboolean NVerr = FALSE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/logd/ha_logger.c new/cluster-glue/logd/ha_logger.c
--- old/cluster-glue/logd/ha_logger.c 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/logd/ha_logger.c 2010-08-12 16:46:02.000000000 +0200
@@ -46,13 +46,14 @@
"ha_logger [-t tag] [-D ] [message]\n");
return;
}
+#define BUFSIZE 1024
int
main(int argc, char** argv)
{
int priority;
char* entity = NULL;
int c;
- char buf[1024];
+ char buf[BUFSIZE];
const char* logtype = "ha-log";
@@ -96,49 +97,24 @@
}
if (argc > 0){
-
- register char *p, *endp;
- int len;
-
- for (p = buf, endp = buf + sizeof(buf) - 2; *argv;) {
- len = strlen(*argv);
- if (p + len > endp && p > buf) {
+ register char *p;
+
+ for (p = *argv; *argv; argv++, p = *argv) {
+ while (strlen(p) > BUFSIZE-1) {
+ memcpy(buf, p, BUFSIZE-1);
+ *(buf+BUFSIZE-1) = '\0';
if (LogToDaemon(priority,buf,
- strnlen(buf, 1024),FALSE) ==HA_OK){
- continue;
- }else{
- return EXIT_FAIL;
- }
- /* NOTREACHED */
- /* p = buf; */
- }
- if (len > sizeof(buf) - 1) {
- if (LogToDaemon(priority,*argv,
- strnlen(*argv, 1024),FALSE) ==HA_OK){
- argv++;
- continue;
- }else{
+ BUFSIZE,FALSE) != HA_OK){
return EXIT_FAIL;
}
-
- } else {
- if (p != buf){
- *p++ = ' ';
- }
- memcpy(p, *argv++, len);
- *(p += len) = '\0';
+ p += BUFSIZE-1;
}
- }
- if (p != buf) {
- if (LogToDaemon(priority,buf,
- strnlen(buf, 1024),FALSE) ==HA_OK){
- return EXIT_OK;
- }else{
+ if (LogToDaemon(priority,p,
+ strnlen(p, BUFSIZE),FALSE) != HA_OK){
return EXIT_FAIL;
}
}
-
-
+ return EXIT_OK;
}else {
while (fgets(buf, sizeof(buf), stdin) != NULL) {
/* glibc is buggy and adds an additional newline,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lrm/admin/Makefile.am new/cluster-glue/lrm/admin/Makefile.am
--- old/cluster-glue/lrm/admin/Makefile.am 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lrm/admin/Makefile.am 2010-08-12 16:46:02.000000000 +0200
@@ -29,3 +29,11 @@
lrmadmin_LDFLAGS = $(COMMONLIBS)
lrmadmin_LDADD = $(top_builddir)/lib/$(LRM_DIR)/liblrm.la
lrmadmin_DEPENDENCIES = $(top_builddir)/lib/$(LRM_DIR)/liblrm.la
+
+if BUILD_HELP
+man8_MANS = $(sbin_PROGRAMS:%=%.8)
+%.8: %
+ echo Creating $@
+ chmod a+x $<
+ help2man --output $@ --no-info --section 8 --name "Part of the Linux-HA project" $(top_builddir)/lrm/admin/$<
+endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lrm/admin/lrmadmin.c new/cluster-glue/lrm/admin/lrmadmin.c
--- old/cluster-glue/lrm/admin/lrmadmin.c 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lrm/admin/lrmadmin.c 2010-08-12 16:46:02.000000000 +0200
@@ -47,7 +47,7 @@
#include
#include
-static const char *optstring = "A:D:X:dE:F:dg:p:M:O:P:c:S:LI:CT:n:h";
+static const char *optstring = "A:D:X:dE:F:dg:p:M:O:P:c:S:LI:CT:n:hv";
#ifdef HAVE_GETOPT_H
static struct option long_options[] = {
@@ -68,6 +68,7 @@
{"set_lrmd_param", 1, NULL, 'p'},
{"get_lrmd_param", 1, NULL, 'g'},
{"help", 0, NULL, 'h'},
+ {"version", 0, NULL, 'v'},
{NULL, 0, NULL, 0}
};
#endif /* HAVE_GETOPT_H */
@@ -139,23 +140,24 @@
static int TIMEOUT = -1; /* the unit is ms */
static const char *simple_help_screen =
-"lrmadmin {-d|--deamon}\n"
-" {-A|--add} <rscid> <raclass> <ratype> []\n"
-" {-D|--delete} <rscid>\n"
-" {-F|--flush} <rscid>\n"
-" {-X|--fail} <rscid> [ []]\n"
-" {-E|--execute} <rscid> <operator> <timeout> <interval> []\n"
-" {-S|--state} <rscid> [-n ]\n"
-" {-L|--listall}\n"
-" {-I|--information} \n"
-" {-C|--raclass_supported}\n"
-" {-T|--ratype_supported} <raclass>\n"
-" {-O|--all metadata of this class} <raclass>\n"
-" {-M|--metadata} <raclass> <ratype> \n"
-" {-P|--provider} <raclass> <ratype>\n"
-" {-p|--set_lrmd_param} <name> <value>\n"
-" {-g|--get_lrmd_param} <name>\n"
-" {-h|--help}\n";
+"lrmadmin -d,--daemon\n"
+" -A,--add <rscid> <raclass> <ratype> []\n"
+" -D,--delete <rscid>\n"
+" -F,--flush <rscid>\n"
+" -X,--fail <rscid> [ []]\n"
+" -E,--execute <rscid> <operator> <timeout> <interval> []\n"
+" -S,--state <rscid> [-n ]\n"
+" -L,--listall\n"
+" -I,--information \n"
+" -C,--raclass_supported\n"
+" -T,--ratype_supported <raclass>\n"
+" -O,--all metadata of this class <raclass>\n"
+" -M,--metadata <raclass> <ratype> \n"
+" -P,--provider <raclass> <ratype>\n"
+" -p,--set_lrmd_param <name> <value>\n"
+" -g,--get_lrmd_param <name>\n"
+" -v,--version\n"
+" -h,--help\n";
#define OPTION_OBSCURE_CHECK \
if ( lrmadmin_cmd != NULL_OP ) { \
@@ -339,6 +341,9 @@
}
break;
+ case 'v':
+ printf("%s\n",GLUE_VERSION);
+ return 0;
case 'h':
OPTION_OBSCURE_CHECK
printf("%s",simple_help_screen);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lrm/admin/lrmadmin.txt new/cluster-glue/lrm/admin/lrmadmin.txt
--- old/cluster-glue/lrm/admin/lrmadmin.txt 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lrm/admin/lrmadmin.txt 2010-08-12 16:46:02.000000000 +0200
@@ -4,7 +4,7 @@
lrmadmin - Local Resource Manager Commander-line Daministrator Tools
SYNOPSIS
-lrmadmin {-d|--deamon}
+lrmadmin {-d|--daemon}
{-A|--add} <rscid> []
{-D|--delete} <rscid>
{-F|--flush} <rscid>
@@ -20,8 +20,8 @@
Detailed Explanation for Options
-Lrmd deamon options
- {-d|--deamon}
+Lrmd daemon options
+ {-d|--daemon}
# -s The status of lrmd: running or not running
# -r Reset lrmd (?)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lrm/lrmd/lrmd.c new/cluster-glue/lrm/lrmd/lrmd.c
--- old/cluster-glue/lrm/lrmd/lrmd.c 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lrm/lrmd/lrmd.c 2010-08-12 16:46:02.000000000 +0200
@@ -87,8 +87,6 @@
#define NO_MSG 1
#define send_msg_now(p) \
(p->reply_time==REPLY_NOW)
-/* magic number, must be different from other return codes! */
-#define POSTPONED 32
struct msg_map msg_maps[] = {
{REGISTER, REPLY_NOW, on_msg_register},
@@ -347,6 +345,8 @@
ret->t_done = op->t_done;
ret->t_rcchange = op->t_rcchange;
ret->is_copy = TRUE;
+ ret->is_cancelled = FALSE;
+ ret->weight = op->weight;
return ret;
}
@@ -421,11 +421,12 @@
ha_msg_value_int(op->msg, F_LRM_TARGETRC, &target_rc);
lrmd_debug(LOG_DEBUG
, "%s: lrmd_op: %s status: %s, target_rc=%s, client pid %d call_id"
- ": %d, child pid: %d (%s) %s"
+ ": %d, child pid: %d (%s) %s %s"
, text, op_info(op), op_status_to_str(op_status)
, op_target_rc_to_str(target_rc)
, op->client_id, op->call_id, op->exec_pid, pidstat
- , (op->is_copy ? "copy" : "original"));
+ , (op->is_copy ? "copy" : "original")
+ , (op->is_cancelled ? "cancelled" : ""));
lrmd_debug(LOG_DEBUG
, "%s: lrmd_op2: rt_tag: %d, interval: %d, delay: %d"
, text, op->repeat_timeout_tag
@@ -1983,8 +1984,9 @@
(void)flush_all(&(rsc->repeat_op_list),0);
if( flush_all(&(rsc->op_list),0) ) {
set_rsc_removal_pending(rsc);
+ lrmd_log(LOG_INFO, "resource %s busy, removal pending", rsc->id);
LRMAUDIT();
- return HA_OK; /* resource is busy, delay removal */
+ return HA_RSCBUSY; /* resource is busy, removal delayed */
}
lrmd_rsc_destroy(rsc);
LRMAUDIT();
@@ -2173,7 +2175,7 @@
,"%s: %s cancelled"
, __FUNCTION__, op_info(op));
rc = flush_op(op);
- if( rc != POSTPONED && rc != HA_FAIL ) {
+ if( rc != HA_RSCBUSY && rc != HA_FAIL ) {
notify_client(op); /* send notification now */
*listp = g_list_remove(*listp, op);
remove_op_history(op);
@@ -2213,13 +2215,16 @@
if( cancel_op(&(rsc->repeat_op_list), cancel_op_id) != HA_OK ) {
op_cancelled = cancel_op(&(rsc->op_list), cancel_op_id);
- if(op_cancelled == POSTPONED) {
- op_cancelled = HA_OK;
- }
}
if( op_cancelled == HA_FAIL ) {
lrmd_log(LOG_INFO, "%s: no operation with id %d",
__FUNCTION__, cancel_op_id);
+ } else if( op_cancelled == HA_RSCBUSY ) {
+ lrmd_log(LOG_INFO, "%s: operation %d running, cancel pending",
+ __FUNCTION__, cancel_op_id);
+ } else {
+ lrmd_debug(LOG_DEBUG, "%s: operation %d cancelled",
+ __FUNCTION__, cancel_op_id);
}
LRMAUDIT();
return op_cancelled;
@@ -2239,7 +2244,7 @@
node = g_list_next(node);
continue; /* not the client's operation */
}
- if( flush_op(op) == POSTPONED ) {
+ if( flush_op(op) == HA_RSCBUSY ) {
rsc_busy = TRUE;
node = g_list_next(node);
} else if (!client_pid || op->client_id == client_pid) {
@@ -2279,6 +2284,9 @@
(void)flush_all(&(rsc->repeat_op_list),0);
if( flush_all(&(rsc->op_list),0) ) {
set_rsc_flushing_ops(rsc); /* resource busy */
+ lrmd_log(LOG_INFO, "resource %s busy, all flush pending", rsc->id);
+ LRMAUDIT();
+ return HA_RSCBUSY;
}
LRMAUDIT();
return HA_OK;
@@ -2340,6 +2348,7 @@
op->rsc_id = strdup(rsc->id);
op->interval = interval;
op->delay = delay;
+ op->weight = no_child_count(rsc) ? 0 : 1;
op->msg = ha_msg_copy(msg);
@@ -2696,7 +2705,7 @@
rsc->op_list = g_list_append(rsc->op_list, op);
if (g_list_length(rsc->op_list) >= 4) {
lrmd_log(LOG_WARNING
- , "operations list for %s is suspicously"
+ , "operations list for %s is suspiciously"
" long [%d]"
, rsc->id
, g_list_length(rsc->op_list));
@@ -2765,7 +2774,7 @@
, "%s:%s is removed from op list"
, __FUNCTION__, op_info(op));
- if (op_status != LRM_OP_CANCELLED) {
+ if (!op->is_cancelled) {
if( !record_op_completion(rsc,op) ) { /*record the outcome of the op */
if (op->interval) /* copy op to the repeat list */
to_repeatlist(rsc,op);
@@ -2774,17 +2783,24 @@
remove_op_history(op);
}
+ if (rsc_removal_pending(rsc)) {
+ if (HA_OK != ha_msg_add_int(op->msg,F_LRM_RSCDELETED,1)) {
+ LOG_FAILED_TO_ADD_FIELD(F_LRM_RSCDELETED);
+ }
+ }
if (op_status != LRM_OP_DONE
|| (op_rc == -1)
|| (op_rc == target_rc)
|| (target_rc == EVERYTIME)
|| ((target_rc == CHANGED) && rc_changed)
+ || rsc_removal_pending(rsc)
) {
notify_client(op);
}
lrmd_op_destroy(op);
if( !rsc->op_list ) {
if( rsc_removal_pending(rsc) ) {
+ lrmd_log(LOG_INFO, "late removal of resource %s", rsc->id);
lrmd_rsc_destroy(rsc);
rc = -1; /* let the caller know that the rsc is gone */
} else {
@@ -2824,10 +2840,11 @@
}
return HA_OK;
} else {
+ op->is_cancelled = TRUE; /* mark the op as cancelled */
lrmd_log(LOG_INFO, "%s: process for %s still "
"running, flush delayed"
,__FUNCTION__,small_op_info(op));
- return POSTPONED;
+ return HA_RSCBUSY;
}
}
@@ -2880,6 +2897,11 @@
while (NULL != node) {
op = node->data;
if (-1 != op->exec_pid) {
+ if (!g_list_next(node)) {
+ /* this is the only operation, no need to do
+ * anything further */
+ break;
+ }
lrmd_log(LOG_INFO, "%s:%d: %s for rsc is already running."
, __FUNCTION__, __LINE__, op_info(op));
if( rsc->delay_timeout > 0 ) {
@@ -2897,11 +2919,11 @@
}
break;
}
- if (child_count >= max_child_count) {
+ if (op->weight && child_count >= max_child_count) {
if ((int)rsc->delay_timeout > 0) {
lrmd_log(LOG_INFO
- , "%s:%d: operations on resource %s already delayed"
- , __FUNCTION__, __LINE__, lrm_str(rsc->id));
+ , "%s:%d: max_child_count (%d) reached and operations on resource %s already delayed"
+ , __FUNCTION__, __LINE__, max_child_count, lrm_str(rsc->id));
} else {
lrmd_debug(LOG_NOTICE
, "max_child_count (%d) reached, postponing "
@@ -3071,7 +3093,7 @@
return HA_FAIL;
default: /* Parent */
- child_count++;
+ child_count += op->weight;
NewTrackedProc(pid, 1
, debug_level ?
((op->interval && !is_logmsg_due(op)) ? PT_LOGNORMAL : PT_LOGVERBOSE) : PT_LOGNONE
@@ -3204,14 +3226,17 @@
int op_status;
LRMAUDIT();
- if (--child_count < 0) {
+
+ CHECK_ALLOCATED(p, "ProcTrack p", );
+ op = proctrack_data(p);
+
+ child_count -= op->weight;
+ if (child_count < 0) {
lrmd_log(LOG_ERR, "%s:%d: child count is less than zero: %d"
, __FUNCTION__, __LINE__, child_count);
child_count = 0;
}
- CHECK_ALLOCATED(p, "ProcTrack p", );
- op = proctrack_data(p);
lrmd_debug2(LOG_DEBUG, "on_ra_proc_finished: accessing the op whose "
"address is %p", op);
CHECK_ALLOCATED(op, "op", );
@@ -3235,19 +3260,6 @@
LRMAUDIT();
return;
}
-
- if (HA_OK == ha_msg_value_int(op->msg, F_LRM_OPSTATUS, &op_status)
- && (op_status_t)op_status == LRM_OP_CANCELLED ) {
- lrmd_debug(LOG_DEBUG, "on_ra_proc_finished: "
- "%s cancelled.", op_info(op));
- on_op_done(rsc,op);
- reset_proctrack_data(p);
- if (debug_level >= 2) {
- dump_data_for_debug();
- }
- LRMAUDIT();
- return;
- }
RAExec = g_hash_table_lookup(RAExecFuncs,rsc->class);
if (NULL == RAExec) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cluster-glue/lrm/lrmd/lrmd.h new/cluster-glue/lrm/lrmd/lrmd.h
--- old/cluster-glue/lrm/lrmd/lrmd.h 2010-05-12 10:25:47.000000000 +0200
+++ new/cluster-glue/lrm/lrmd/lrmd.h 2010-08-12 16:46:02.000000000 +0200
@@ -168,6 +168,9 @@
(unsigned long)LOGMSG_INTERVAL)
#define probe_str(op,op_type) \
((op && !op->interval && !strcmp(op_type,"monitor")) ? "probe" : op_type)
+/* exclude stonith class from child count */
+#define no_child_count(rsc) \
+ (strcmp((rsc)->class,"stonith") == 0)
struct lrmd_rsc
{
@@ -183,7 +186,6 @@
GHashTable* last_op_table; /* Last operation of each type */
lrmd_op_t* last_op_done; /* The last finished op of the resource */
guint delay_timeout; /* The delay value of op_list execution */
- GList* requestors; /* a list of client pids to send replies to */
int state; /* status of the resource */
};
@@ -197,6 +199,8 @@
guint repeat_timeout_tag;
int interval;
int delay;
+ gboolean is_cancelled;
+ int weight;
int copyparams;
struct ha_msg* msg;
ra_pipe_op_t * rapop;
++++++ remove-unused-tmp-var.patch ++++++
Index: cluster-glue/lib/stonith/main.c
===================================================================
--- cluster-glue.orig/lib/stonith/main.c
+++ cluster-glue/lib/stonith/main.c
@@ -283,7 +283,6 @@ main(int argc, char** argv)
int rc;
Stonith * s;
const char * SwitchType = NULL;
- const char * tmp;
const char * optfile = NULL;
const char * parameters = NULL;
int reset_type = ST_GENERIC_RESET;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org