2.0.0-0.1.rc3 - Update for new upstream tarball
...for release candidate: Pacemaker-2.0.0-rc3, for full details, see included ChangeLog file or https://github.com/ClusterLabs/pacemaker/releases/tag/Pacemaker-2.0.0-rc3 Adapt spec file more akin to upstream version including: . new --without legacy_links conditional (c8a7e5225) . reflect name change of the auxiliary daemons (e4f4a0d64, db5536e40, e2fdc2bac + 9ecbfea1c, 038c465e2 + ed8ce4055a) . new dummy systemd service for -cts (bf0a22812) . honor system-wide crypto policies once for all, via package-build-time configurable "pcmk_gnutls_priorities" defaulting to @SYSTEM as prescribed in https://fedoraproject.org/wiki/Packaging:CryptoPolicies (based on b3dfce1d3) Adapt spec file akin to current packaging guidelines including: . make -nagios-plugins-metadata package noarch Drop patches that got subsumed in upstream Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
This commit is contained in:
parent
436eae4e1e
commit
e7308f95f4
@ -1,43 +0,0 @@
|
|||||||
From b2bd800e70547990c00b8e8efc67b930e699887b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
Date: Wed, 11 Apr 2018 11:48:13 +1000
|
|
||||||
Subject: [PATCH 01/17] Fix: rhbz#1565187 - Ensure failures that cause fencing
|
|
||||||
are not removed until after fencing completes
|
|
||||||
|
|
||||||
---
|
|
||||||
lib/pengine/unpack.c | 12 ++++++++++++
|
|
||||||
1 file changed, 12 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/lib/pengine/unpack.c b/lib/pengine/unpack.c
|
|
||||||
index fcfd7ccbf..6b1e519c7 100644
|
|
||||||
--- a/lib/pengine/unpack.c
|
|
||||||
+++ b/lib/pengine/unpack.c
|
|
||||||
@@ -2807,6 +2807,7 @@ static bool check_operation_expiry(resource_t *rsc, node_t *node, int rc, xmlNod
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clear_reason != NULL) {
|
|
||||||
+ node_t *remote_node = pe_find_node(data_set->nodes, rsc->id);
|
|
||||||
char *key = generate_op_key(rsc->id, CRM_OP_CLEAR_FAILCOUNT, 0);
|
|
||||||
action_t *clear_op = custom_action(rsc, key, CRM_OP_CLEAR_FAILCOUNT,
|
|
||||||
node, FALSE, TRUE, data_set);
|
|
||||||
@@ -2815,6 +2816,17 @@ static bool check_operation_expiry(resource_t *rsc, node_t *node, int rc, xmlNod
|
|
||||||
|
|
||||||
crm_notice("Clearing failure of %s on %s because %s " CRM_XS " %s",
|
|
||||||
rsc->id, node->details->uname, clear_reason, clear_op->uuid);
|
|
||||||
+
|
|
||||||
+ if (is_set(data_set->flags, pe_flag_stonith_enabled)
|
|
||||||
+ && rsc->remote_reconnect_ms
|
|
||||||
+ && remote_node
|
|
||||||
+ && remote_node->details->unclean) {
|
|
||||||
+
|
|
||||||
+ action_t *fence = pe_fence_op(remote_node, NULL, TRUE, NULL, data_set);
|
|
||||||
+ crm_notice("Waiting for %s to complete before clearing %s failure for remote node %s", fence?fence->uuid:"nil", task, rsc->id);
|
|
||||||
+
|
|
||||||
+ order_actions(fence, clear_op, pe_order_implies_then);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
if (expired && (interval_ms == 0) && safe_str_eq(task, CRMD_ACTION_STATUS)) {
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,29 +0,0 @@
|
|||||||
From faefccc1dc3108853bc7cfa35681a1ac261c5461 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Wed, 11 Apr 2018 11:28:43 -0500
|
|
||||||
Subject: [PATCH 03/17] Test: cts-pengine: create_mode is now controlled by
|
|
||||||
--update
|
|
||||||
|
|
||||||
---
|
|
||||||
cts/cts-pengine.in | 5 -----
|
|
||||||
1 file changed, 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cts/cts-pengine.in b/cts/cts-pengine.in
|
|
||||||
index ca29d76c3..905354db2 100644
|
|
||||||
--- a/cts/cts-pengine.in
|
|
||||||
+++ b/cts/cts-pengine.in
|
|
||||||
@@ -391,11 +391,6 @@ if [ -n "$single_test" ]; then
|
|
||||||
fi
|
|
||||||
|
|
||||||
DO_VERSIONED_TESTS=0
|
|
||||||
-create_mode=true
|
|
||||||
-# info Creating the following tests from $io_dir
|
|
||||||
-# do_test order-expired-failure "Order failcount cleanup after remote fencing"
|
|
||||||
-
|
|
||||||
-create_mode=false
|
|
||||||
|
|
||||||
info Performing the following tests from $io_dir
|
|
||||||
echo ""
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,178 +0,0 @@
|
|||||||
From 5f370802061ea4e8d5a194fd5ed4f1020e195145 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Mon, 9 Apr 2018 10:57:40 -0500
|
|
||||||
Subject: [PATCH 04/17] Build: cts: update scripts to use new @BASH_PATH@
|
|
||||||
subsitution variable
|
|
||||||
|
|
||||||
---
|
|
||||||
configure.ac | 5 ++++
|
|
||||||
cts/{CTS.py => CTS.py.in} | 28 +++++------------------
|
|
||||||
cts/{cluster_test => cluster_test.in} | 8 ++++++-
|
|
||||||
cts/{cts-cli => cts-cli.in} | 8 ++++++-
|
|
||||||
cts/{cts-regression => cts-regression.in} | 7 +++++-
|
|
||||||
cts/{cts => cts.in} | 8 ++++++-
|
|
||||||
7 files changed, 38 insertions(+), 26 deletions(-)
|
|
||||||
rename cts/{CTS.py => CTS.py.in} (97%)
|
|
||||||
rename cts/{cluster_test => cluster_test.in} (96%)
|
|
||||||
rename cts/{cts-cli => cts-cli.in} (99%)
|
|
||||||
rename cts/{cts-regression => cts-regression.in} (96%)
|
|
||||||
rename cts/{cts => cts.in} (97%)
|
|
||||||
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index c39954272..41676ed61 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -1700,9 +1700,13 @@ dnl Files we output that need to be executable
|
|
||||||
AC_CONFIG_FILES([cts/CTSlab.py], [chmod +x cts/CTSlab.py])
|
|
||||||
AC_CONFIG_FILES([cts/LSBDummy], [chmod +x cts/LSBDummy])
|
|
||||||
AC_CONFIG_FILES([cts/OCFIPraTest.py], [chmod +x cts/OCFIPraTest.py])
|
|
||||||
+AC_CONFIG_FILES([cts/cluster_test], [chmod +x cts/cluster_test])
|
|
||||||
+AC_CONFIG_FILES([cts/cts], [chmod +x cts/cts])
|
|
||||||
+AC_CONFIG_FILES([cts/cts-cli], [chmod +x cts/cts-cli])
|
|
||||||
AC_CONFIG_FILES([cts/cts-coverage], [chmod +x cts/cts-coverage])
|
|
||||||
AC_CONFIG_FILES([cts/cts-lrmd], [chmod +x cts/cts-lrmd])
|
|
||||||
AC_CONFIG_FILES([cts/cts-pengine], [chmod +x cts/cts-pengine])
|
|
||||||
+AC_CONFIG_FILES([cts/cts-regression], [chmod +x cts/cts-regression])
|
|
||||||
AC_CONFIG_FILES([cts/cts-stonithd], [chmod +x cts/cts-stonithd])
|
|
||||||
AC_CONFIG_FILES([cts/lxc_autogen.sh], [chmod +x cts/lxc_autogen.sh])
|
|
||||||
AC_CONFIG_FILES([cts/benchmark/clubench], [chmod +x cts/benchmark/clubench])
|
|
||||||
@@ -1718,6 +1722,7 @@ dnl Other files we output
|
|
||||||
AC_CONFIG_FILES(Makefile \
|
|
||||||
Doxyfile \
|
|
||||||
cts/Makefile \
|
|
||||||
+ cts/CTS.py \
|
|
||||||
cts/CTSvars.py \
|
|
||||||
cts/benchmark/Makefile \
|
|
||||||
cib/Makefile \
|
|
||||||
diff --git a/cts/CTS.py b/cts/CTS.py.in
|
|
||||||
similarity index 97%
|
|
||||||
rename from cts/CTS.py
|
|
||||||
rename to cts/CTS.py.in
|
|
||||||
index e78b54d56..30ecfba88 100644
|
|
||||||
--- a/cts/CTS.py
|
|
||||||
+++ b/cts/CTS.py.in
|
|
||||||
@@ -3,27 +3,11 @@
|
|
||||||
Classes related to testing high-availability clusters...
|
|
||||||
'''
|
|
||||||
|
|
||||||
-from __future__ import print_function
|
|
||||||
-
|
|
||||||
-__copyright__ = '''
|
|
||||||
-Copyright (C) 2000, 2001 Alan Robertson <alanr@unix.sh>
|
|
||||||
-Licensed under the GNU GPL.
|
|
||||||
-'''
|
|
||||||
-
|
|
||||||
-#
|
|
||||||
-# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
+# Pacemaker targets compatibility with Python 2.7 and 3.2+
|
|
||||||
+from __future__ import print_function, unicode_literals, absolute_import, division
|
|
||||||
+
|
|
||||||
+__copyright__ = "Copyright 2000-2018 Alan Robertson <alanr@unix.sh>"
|
|
||||||
+__license__ = "GNU General Public License version 2 or later (GPLv2+) WITHOUT ANY WARRANTY"
|
|
||||||
|
|
||||||
import string, sys, time, re, os, traceback
|
|
||||||
|
|
||||||
@@ -42,7 +26,7 @@ from cts.patterns import PatternSelector
|
|
||||||
has_log_stats = {}
|
|
||||||
log_stats_bin = CTSvars.CRM_DAEMON_DIR + "/cts_log_stats.sh"
|
|
||||||
log_stats = """
|
|
||||||
-#!/bin/bash
|
|
||||||
+#!@BASH_PATH@
|
|
||||||
# Tool for generating system load reports while CTS runs
|
|
||||||
|
|
||||||
trap "" 1
|
|
||||||
diff --git a/cts/cluster_test b/cts/cluster_test.in
|
|
||||||
similarity index 96%
|
|
||||||
rename from cts/cluster_test
|
|
||||||
rename to cts/cluster_test.in
|
|
||||||
index 0cc8c26af..603bfe2f7 100755
|
|
||||||
--- a/cts/cluster_test
|
|
||||||
+++ b/cts/cluster_test.in
|
|
||||||
@@ -1,4 +1,10 @@
|
|
||||||
-#!/bin/bash
|
|
||||||
+#!@BASH_PATH@
|
|
||||||
+#
|
|
||||||
+# Copyright 2008-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
+#
|
|
||||||
+# This source code is licensed under the GNU General Public License version 2
|
|
||||||
+# or later (GPLv2+) WITHOUT ANY WARRANTY.
|
|
||||||
+#
|
|
||||||
if [ -e ~/.cts ]; then
|
|
||||||
. ~/.cts
|
|
||||||
fi
|
|
||||||
diff --git a/cts/cts-cli b/cts/cts-cli.in
|
|
||||||
similarity index 99%
|
|
||||||
rename from cts/cts-cli
|
|
||||||
rename to cts/cts-cli.in
|
|
||||||
index 75751c662..e62e5e2fe 100755
|
|
||||||
--- a/cts/cts-cli
|
|
||||||
+++ b/cts/cts-cli.in
|
|
||||||
@@ -1,4 +1,10 @@
|
|
||||||
-#!/bin/bash
|
|
||||||
+#!@BASH_PATH@
|
|
||||||
+#
|
|
||||||
+# Copyright 2008-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
+#
|
|
||||||
+# This source code is licensed under the GNU General Public License version 2
|
|
||||||
+# or later (GPLv2+) WITHOUT ANY WARRANTY.
|
|
||||||
+#
|
|
||||||
|
|
||||||
USAGE_TEXT="Usage: cts-cli [<options>]
|
|
||||||
Options:
|
|
||||||
diff --git a/cts/cts-regression b/cts/cts-regression.in
|
|
||||||
similarity index 96%
|
|
||||||
rename from cts/cts-regression
|
|
||||||
rename to cts/cts-regression.in
|
|
||||||
index fbc6319f8..6c9931f79 100755
|
|
||||||
--- a/cts/cts-regression
|
|
||||||
+++ b/cts/cts-regression.in
|
|
||||||
@@ -1,9 +1,14 @@
|
|
||||||
-#!/bin/bash
|
|
||||||
+#!@BASH_PATH@
|
|
||||||
#
|
|
||||||
# cts-regression
|
|
||||||
#
|
|
||||||
# Convenience wrapper for running any of the Pacemaker regression tests
|
|
||||||
#
|
|
||||||
+# Copyright 2012-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
+#
|
|
||||||
+# This source code is licensed under the GNU General Public License version 2
|
|
||||||
+# or later (GPLv2+) WITHOUT ANY WARRANTY.
|
|
||||||
+#
|
|
||||||
|
|
||||||
USAGE_TEXT="Usage: cts-regression [<options>] [<test> ...]
|
|
||||||
Options:
|
|
||||||
diff --git a/cts/cts b/cts/cts.in
|
|
||||||
similarity index 97%
|
|
||||||
rename from cts/cts
|
|
||||||
rename to cts/cts.in
|
|
||||||
index 5a2ee0c47..9ff107c66 100755
|
|
||||||
--- a/cts/cts
|
|
||||||
+++ b/cts/cts.in
|
|
||||||
@@ -1,4 +1,10 @@
|
|
||||||
-#!/bin/bash
|
|
||||||
+#!@BASH_PATH
|
|
||||||
+#
|
|
||||||
+# Copyright 2012-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
+#
|
|
||||||
+# This source code is licensed under the GNU General Public License version 2
|
|
||||||
+# or later (GPLv2+) WITHOUT ANY WARRANTY.
|
|
||||||
+#
|
|
||||||
|
|
||||||
if [ -e $PWD/cts/CTSlab.py ]; then
|
|
||||||
cts_root=$PWD/cts
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,104 +0,0 @@
|
|||||||
From 25698bc62f4b1bf14112012809e1c70b57a44cd9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Mon, 9 Apr 2018 14:05:55 -0500
|
|
||||||
Subject: [PATCH 05/17] Test: cts: don't use readlink -e unless supported
|
|
||||||
|
|
||||||
BSD readlink doesn't
|
|
||||||
---
|
|
||||||
cts/cts-cli.in | 9 ++++++++-
|
|
||||||
cts/cts-pengine.in | 32 ++++++++++++++------------------
|
|
||||||
cts/cts-regression.in | 9 ++++++++-
|
|
||||||
3 files changed, 30 insertions(+), 20 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cts/cts-cli.in b/cts/cts-cli.in
|
|
||||||
index e62e5e2fe..365f4b10b 100755
|
|
||||||
--- a/cts/cts-cli.in
|
|
||||||
+++ b/cts/cts-cli.in
|
|
||||||
@@ -15,8 +15,15 @@ Options:
|
|
||||||
-v, --valgrind Run all commands under valgrind
|
|
||||||
-s Save actual output as expected output"
|
|
||||||
|
|
||||||
+# If readlink supports -e (i.e. GNU), use it
|
|
||||||
+readlink -e / >/dev/null 2>/dev/null
|
|
||||||
+if [ $? -eq 0 ]; then
|
|
||||||
+ test_home="$(dirname $(readlink -e $0))"
|
|
||||||
+else
|
|
||||||
+ test_home="$(dirname $0)"
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
: ${shadow=cts-cli}
|
|
||||||
-test_home="$(dirname $(readlink -e $0))"
|
|
||||||
shadow_dir=$(mktemp -td cts-cli.shadow.XXXXXXXXXX)
|
|
||||||
num_errors=0
|
|
||||||
num_passed=0
|
|
||||||
diff --git a/cts/cts-pengine.in b/cts/cts-pengine.in
|
|
||||||
index 905354db2..fb0952580 100644
|
|
||||||
--- a/cts/cts-pengine.in
|
|
||||||
+++ b/cts/cts-pengine.in
|
|
||||||
@@ -1,21 +1,10 @@
|
|
||||||
#!@BASH_PATH@
|
|
||||||
-
|
|
||||||
- # Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
- #
|
|
||||||
- # 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
- #
|
|
||||||
+#
|
|
||||||
+# Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
+#
|
|
||||||
+# This source code is licensed under the GNU General Public License version 2
|
|
||||||
+# or later (GPLv2+) WITHOUT ANY WARRANTY.
|
|
||||||
+#
|
|
||||||
|
|
||||||
USAGE_TEXT="Usage: cts-pengine [<options>]
|
|
||||||
Options:
|
|
||||||
@@ -34,7 +23,14 @@ SBINDIR="@sbindir@"
|
|
||||||
BUILDDIR="@abs_top_builddir@"
|
|
||||||
CRM_SCHEMA_DIRECTORY="@CRM_SCHEMA_DIRECTORY@"
|
|
||||||
|
|
||||||
-test_home=$(dirname $(readlink -e $0))
|
|
||||||
+# If readlink supports -e (i.e. GNU), use it
|
|
||||||
+readlink -e / >/dev/null 2>/dev/null
|
|
||||||
+if [ $? -eq 0 ]; then
|
|
||||||
+ test_home="$(dirname $(readlink -e $0))"
|
|
||||||
+else
|
|
||||||
+ test_home="$(dirname $0)"
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
io_dir="$test_home/pengine"
|
|
||||||
failed="$test_home/.regression.failed.diff"
|
|
||||||
test_binary=
|
|
||||||
diff --git a/cts/cts-regression.in b/cts/cts-regression.in
|
|
||||||
index 6c9931f79..e89394b69 100755
|
|
||||||
--- a/cts/cts-regression.in
|
|
||||||
+++ b/cts/cts-regression.in
|
|
||||||
@@ -24,7 +24,14 @@ Tests (default tests are 'pengine cli lrmd'):
|
|
||||||
fencing Fencing daemon
|
|
||||||
all Synonym for 'pengine cli lrmd fencing'"
|
|
||||||
|
|
||||||
-test_home="$(dirname $(readlink -e $0))"
|
|
||||||
+# If readlink supports -e (i.e. GNU), use it
|
|
||||||
+readlink -e / >/dev/null 2>/dev/null
|
|
||||||
+if [ $? -eq 0 ]; then
|
|
||||||
+ test_home="$(dirname $(readlink -e $0))"
|
|
||||||
+else
|
|
||||||
+ test_home="$(dirname $0)"
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
valgrind=""
|
|
||||||
verbose=""
|
|
||||||
tests=""
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,511 +0,0 @@
|
|||||||
From c7abf9bc0b3596b41981ee10af60c24a68287e78 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Mon, 9 Apr 2018 14:15:23 -0500
|
|
||||||
Subject: [PATCH 06/17] Refactor: libcrmcommon: move PID functions to own file
|
|
||||||
|
|
||||||
Line counts before:
|
|
||||||
1515 lib/common/utils.c
|
|
||||||
|
|
||||||
and after:
|
|
||||||
1353 lib/common/utils.c
|
|
||||||
183 lib/common/pid.c
|
|
||||||
---
|
|
||||||
include/crm/common/internal.h | 26 ++---
|
|
||||||
include/crm_internal.h | 23 +----
|
|
||||||
lib/common/Makefile.am | 19 +---
|
|
||||||
lib/common/pid.c | 183 ++++++++++++++++++++++++++++++++++
|
|
||||||
lib/common/utils.c | 162 ------------------------------
|
|
||||||
5 files changed, 201 insertions(+), 212 deletions(-)
|
|
||||||
create mode 100644 lib/common/pid.c
|
|
||||||
|
|
||||||
diff --git a/include/crm/common/internal.h b/include/crm/common/internal.h
|
|
||||||
index 076b9f60b..064e983b6 100644
|
|
||||||
--- a/include/crm/common/internal.h
|
|
||||||
+++ b/include/crm/common/internal.h
|
|
||||||
@@ -1,20 +1,8 @@
|
|
||||||
/*
|
|
||||||
- * Copyright (C) 2015
|
|
||||||
- * Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
+ * Copyright 2015-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
*
|
|
||||||
- * This program is free software; you can redistribute it and/or modify
|
|
||||||
- * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
- *
|
|
||||||
- * You should have received a copy of the GNU Lesser General Public
|
|
||||||
- * License along with this library; if not, write to the Free Software
|
|
||||||
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
+ * This source code is licensed under the GNU Lesser General Public License
|
|
||||||
+ * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CRM_COMMON_INTERNAL__H
|
|
||||||
@@ -59,6 +47,14 @@ void crm_schema_init(void);
|
|
||||||
void crm_schema_cleanup(void);
|
|
||||||
|
|
||||||
|
|
||||||
+/* internal functions related to process IDs (from pid.c) */
|
|
||||||
+
|
|
||||||
+int crm_pid_active(long pid, const char *daemon);
|
|
||||||
+long crm_pidfile_inuse(const char *filename, long mypid, const char *daemon);
|
|
||||||
+long crm_read_pidfile(const char *filename);
|
|
||||||
+int crm_lock_pidfile(const char *filename, const char *name);
|
|
||||||
+
|
|
||||||
+
|
|
||||||
/* internal generic string functions (from strings.c) */
|
|
||||||
|
|
||||||
long long crm_int_helper(const char *text, char **end_text);
|
|
||||||
diff --git a/include/crm_internal.h b/include/crm_internal.h
|
|
||||||
index 4c6fb0d4a..78d947905 100644
|
|
||||||
--- a/include/crm_internal.h
|
|
||||||
+++ b/include/crm_internal.h
|
|
||||||
@@ -1,22 +1,8 @@
|
|
||||||
-/* crm_internal.h */
|
|
||||||
-
|
|
||||||
/*
|
|
||||||
- * Copyright (C) 2006 - 2008
|
|
||||||
- * Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
- *
|
|
||||||
- * This program is free software; you can redistribute it and/or modify
|
|
||||||
- * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
|
|
||||||
+ * Copyright 2006-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
*
|
|
||||||
- * You should have received a copy of the GNU Lesser General Public
|
|
||||||
- * License along with this library; if not, write to the Free Software
|
|
||||||
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
+ * This source code is licensed under the GNU Lesser General Public License
|
|
||||||
+ * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CRM_INTERNAL__H
|
|
||||||
@@ -141,7 +127,6 @@ extern int node_score_green;
|
|
||||||
extern int node_score_yellow;
|
|
||||||
|
|
||||||
/* Assorted convenience functions */
|
|
||||||
-int crm_pid_active(long pid, const char *daemon);
|
|
||||||
void crm_make_daemon(const char *name, gboolean daemonize, const char *pidfile);
|
|
||||||
|
|
||||||
/* from operations.c */
|
|
||||||
@@ -251,8 +236,6 @@ void strip_text_nodes(xmlNode * xml);
|
|
||||||
void pcmk_panic(const char *origin);
|
|
||||||
void sysrq_init(void);
|
|
||||||
pid_t pcmk_locate_sbd(void);
|
|
||||||
-long crm_pidfile_inuse(const char *filename, long mypid, const char *daemon);
|
|
||||||
-long crm_read_pidfile(const char *filename);
|
|
||||||
|
|
||||||
# define crm_config_err(fmt...) { crm_config_error = TRUE; crm_err(fmt); }
|
|
||||||
# define crm_config_warn(fmt...) { crm_config_warning = TRUE; crm_warn(fmt); }
|
|
||||||
diff --git a/lib/common/Makefile.am b/lib/common/Makefile.am
|
|
||||||
index 1fce0b927..7546fe9fc 100644
|
|
||||||
--- a/lib/common/Makefile.am
|
|
||||||
+++ b/lib/common/Makefile.am
|
|
||||||
@@ -1,19 +1,8 @@
|
|
||||||
#
|
|
||||||
-# Copyright (C) 2004 Andrew Beekhof
|
|
||||||
+# Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
#
|
|
||||||
-# 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.
|
|
||||||
+# This source code is licensed under the GNU General Public License version 2
|
|
||||||
+# or later (GPLv2+) WITHOUT ANY WARRANTY.
|
|
||||||
#
|
|
||||||
include $(top_srcdir)/Makefile.common
|
|
||||||
|
|
||||||
@@ -40,7 +29,7 @@ libcrmcommon_la_LIBADD = @LIBADD_DL@ $(GNUTLSLIBS)
|
|
||||||
libcrmcommon_la_SOURCES = compat.c digest.c ipc.c io.c procfs.c utils.c xml.c \
|
|
||||||
iso8601.c remote.c mainloop.c logging.c watchdog.c \
|
|
||||||
schemas.c strings.c xpath.c attrd_client.c alerts.c \
|
|
||||||
- operations.c results.c
|
|
||||||
+ operations.c pid.c results.c
|
|
||||||
if BUILD_CIBSECRETS
|
|
||||||
libcrmcommon_la_SOURCES += cib_secrets.c
|
|
||||||
endif
|
|
||||||
diff --git a/lib/common/pid.c b/lib/common/pid.c
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000..803799e64
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/lib/common/pid.c
|
|
||||||
@@ -0,0 +1,183 @@
|
|
||||||
+/*
|
|
||||||
+ * Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
+ *
|
|
||||||
+ * This source code is licensed under the GNU Lesser General Public License
|
|
||||||
+ * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#include <crm_internal.h>
|
|
||||||
+
|
|
||||||
+#ifndef _GNU_SOURCE
|
|
||||||
+# define _GNU_SOURCE
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#include <stdio.h>
|
|
||||||
+#include <string.h>
|
|
||||||
+#include <sys/stat.h>
|
|
||||||
+
|
|
||||||
+#include <crm/crm.h>
|
|
||||||
+
|
|
||||||
+int
|
|
||||||
+crm_pid_active(long pid, const char *daemon)
|
|
||||||
+{
|
|
||||||
+ static int have_proc_pid = 0;
|
|
||||||
+
|
|
||||||
+ if (have_proc_pid == 0) {
|
|
||||||
+ char proc_path[PATH_MAX], exe_path[PATH_MAX];
|
|
||||||
+
|
|
||||||
+ // Make sure pid hasn't been reused by another process
|
|
||||||
+ snprintf(proc_path, sizeof(proc_path), "/proc/%lu/exe",
|
|
||||||
+ (long unsigned int)getpid());
|
|
||||||
+
|
|
||||||
+ have_proc_pid = 1;
|
|
||||||
+ if (readlink(proc_path, exe_path, PATH_MAX - 1) < 0) {
|
|
||||||
+ have_proc_pid = -1;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (pid <= 0) {
|
|
||||||
+ return -1;
|
|
||||||
+
|
|
||||||
+ } else if ((kill(pid, 0) < 0) && (errno == ESRCH)) {
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ } else if ((daemon == NULL) || (have_proc_pid == -1)) {
|
|
||||||
+ return 1;
|
|
||||||
+
|
|
||||||
+ } else {
|
|
||||||
+ int rc = 0;
|
|
||||||
+ char proc_path[PATH_MAX], exe_path[PATH_MAX], myexe_path[PATH_MAX];
|
|
||||||
+
|
|
||||||
+ // Make sure pid hasn't been reused by another process
|
|
||||||
+ snprintf(proc_path, sizeof(proc_path), "/proc/%ld/exe", pid);
|
|
||||||
+
|
|
||||||
+ rc = readlink(proc_path, exe_path, PATH_MAX - 1);
|
|
||||||
+ if ((rc < 0) && (errno == EACCES)) {
|
|
||||||
+ crm_perror(LOG_INFO, "Could not read from %s", proc_path);
|
|
||||||
+ return 1;
|
|
||||||
+ } else if (rc < 0) {
|
|
||||||
+ crm_perror(LOG_ERR, "Could not read from %s", proc_path);
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ exe_path[rc] = 0;
|
|
||||||
+
|
|
||||||
+ if (daemon[0] != '/') {
|
|
||||||
+ rc = snprintf(myexe_path, sizeof(proc_path), CRM_DAEMON_DIR"/%s",
|
|
||||||
+ daemon);
|
|
||||||
+ myexe_path[rc] = 0;
|
|
||||||
+ } else {
|
|
||||||
+ rc = snprintf(myexe_path, sizeof(proc_path), "%s", daemon);
|
|
||||||
+ myexe_path[rc] = 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (strcmp(exe_path, myexe_path) == 0) {
|
|
||||||
+ return 1;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#define LOCKSTRLEN 11
|
|
||||||
+
|
|
||||||
+long
|
|
||||||
+crm_read_pidfile(const char *filename)
|
|
||||||
+{
|
|
||||||
+ int fd;
|
|
||||||
+ struct stat sbuf;
|
|
||||||
+ long pid = -ENOENT;
|
|
||||||
+ char buf[LOCKSTRLEN + 1];
|
|
||||||
+
|
|
||||||
+ fd = open(filename, O_RDONLY);
|
|
||||||
+ if (fd < 0) {
|
|
||||||
+ goto bail;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if ((fstat(fd, &sbuf) >= 0) && (sbuf.st_size < LOCKSTRLEN)) {
|
|
||||||
+ sleep(2); /* if someone was about to create one,
|
|
||||||
+ * give'm a sec to do so
|
|
||||||
+ */
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (read(fd, buf, sizeof(buf)) < 1) {
|
|
||||||
+ goto bail;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (sscanf(buf, "%ld", &pid) > 0) {
|
|
||||||
+ if (pid <= 0) {
|
|
||||||
+ pid = -ESRCH;
|
|
||||||
+ } else {
|
|
||||||
+ crm_trace("Got pid %lu from %s\n", pid, filename);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ bail:
|
|
||||||
+ if (fd >= 0) {
|
|
||||||
+ close(fd);
|
|
||||||
+ }
|
|
||||||
+ return pid;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+long
|
|
||||||
+crm_pidfile_inuse(const char *filename, long mypid, const char *daemon)
|
|
||||||
+{
|
|
||||||
+ long pid = crm_read_pidfile(filename);
|
|
||||||
+
|
|
||||||
+ if (pid < 2) {
|
|
||||||
+ // Invalid pid
|
|
||||||
+ pid = -ENOENT;
|
|
||||||
+ unlink(filename);
|
|
||||||
+
|
|
||||||
+ } else if (mypid && (pid == mypid)) {
|
|
||||||
+ // In use by us
|
|
||||||
+ pid = pcmk_ok;
|
|
||||||
+
|
|
||||||
+ } else if (crm_pid_active(pid, daemon) == FALSE) {
|
|
||||||
+ // Contains a stale value
|
|
||||||
+ unlink(filename);
|
|
||||||
+ pid = -ENOENT;
|
|
||||||
+
|
|
||||||
+ } else if (mypid && (pid != mypid)) {
|
|
||||||
+ // Locked by existing process
|
|
||||||
+ pid = -EEXIST;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return pid;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+int
|
|
||||||
+crm_lock_pidfile(const char *filename, const char *name)
|
|
||||||
+{
|
|
||||||
+ long mypid = 0;
|
|
||||||
+ int fd = 0;
|
|
||||||
+ int rc = 0;
|
|
||||||
+ char buf[LOCKSTRLEN + 2];
|
|
||||||
+
|
|
||||||
+ mypid = (unsigned long) getpid();
|
|
||||||
+
|
|
||||||
+ rc = crm_pidfile_inuse(filename, 0, name);
|
|
||||||
+ if (rc == -ENOENT) {
|
|
||||||
+ // Exists, but the process is not active
|
|
||||||
+
|
|
||||||
+ } else if (rc != pcmk_ok) {
|
|
||||||
+ // Locked by existing process
|
|
||||||
+ return rc;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ fd = open(filename, O_CREAT | O_WRONLY | O_EXCL, 0644);
|
|
||||||
+ if (fd < 0) {
|
|
||||||
+ return -errno;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ snprintf(buf, sizeof(buf), "%*ld\n", LOCKSTRLEN - 1, mypid);
|
|
||||||
+ rc = write(fd, buf, LOCKSTRLEN);
|
|
||||||
+ close(fd);
|
|
||||||
+
|
|
||||||
+ if (rc != LOCKSTRLEN) {
|
|
||||||
+ crm_perror(LOG_ERR, "Incomplete write to %s", filename);
|
|
||||||
+ return -errno;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return crm_pidfile_inuse(filename, mypid, name);
|
|
||||||
+}
|
|
||||||
diff --git a/lib/common/utils.c b/lib/common/utils.c
|
|
||||||
index 582838e46..07ba1b7d1 100644
|
|
||||||
--- a/lib/common/utils.c
|
|
||||||
+++ b/lib/common/utils.c
|
|
||||||
@@ -681,168 +681,6 @@ crm_abort(const char *file, const char *function, int line,
|
|
||||||
crm_perror(LOG_ERR, "Cannot wait on forked child %d", pid);
|
|
||||||
}
|
|
||||||
|
|
||||||
-int
|
|
||||||
-crm_pid_active(long pid, const char *daemon)
|
|
||||||
-{
|
|
||||||
- static int have_proc_pid = 0;
|
|
||||||
-
|
|
||||||
- if(have_proc_pid == 0) {
|
|
||||||
- char proc_path[PATH_MAX], exe_path[PATH_MAX];
|
|
||||||
-
|
|
||||||
- /* check to make sure pid hasn't been reused by another process */
|
|
||||||
- snprintf(proc_path, sizeof(proc_path), "/proc/%lu/exe", (long unsigned int)getpid());
|
|
||||||
-
|
|
||||||
- have_proc_pid = 1;
|
|
||||||
- if(readlink(proc_path, exe_path, PATH_MAX - 1) < 0) {
|
|
||||||
- have_proc_pid = -1;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (pid <= 0) {
|
|
||||||
- return -1;
|
|
||||||
-
|
|
||||||
- } else if (kill(pid, 0) < 0 && errno == ESRCH) {
|
|
||||||
- return 0;
|
|
||||||
-
|
|
||||||
- } else if(daemon == NULL || have_proc_pid == -1) {
|
|
||||||
- return 1;
|
|
||||||
-
|
|
||||||
- } else {
|
|
||||||
- int rc = 0;
|
|
||||||
- char proc_path[PATH_MAX], exe_path[PATH_MAX], myexe_path[PATH_MAX];
|
|
||||||
-
|
|
||||||
- /* check to make sure pid hasn't been reused by another process */
|
|
||||||
- snprintf(proc_path, sizeof(proc_path), "/proc/%ld/exe", pid);
|
|
||||||
-
|
|
||||||
- rc = readlink(proc_path, exe_path, PATH_MAX - 1);
|
|
||||||
- if (rc < 0 && errno == EACCES) {
|
|
||||||
- crm_perror(LOG_INFO, "Could not read from %s", proc_path);
|
|
||||||
- return 1;
|
|
||||||
- } else if (rc < 0) {
|
|
||||||
- crm_perror(LOG_ERR, "Could not read from %s", proc_path);
|
|
||||||
- return 0;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
-
|
|
||||||
- exe_path[rc] = 0;
|
|
||||||
-
|
|
||||||
- if(daemon[0] != '/') {
|
|
||||||
- rc = snprintf(myexe_path, sizeof(proc_path), CRM_DAEMON_DIR"/%s", daemon);
|
|
||||||
- myexe_path[rc] = 0;
|
|
||||||
- } else {
|
|
||||||
- rc = snprintf(myexe_path, sizeof(proc_path), "%s", daemon);
|
|
||||||
- myexe_path[rc] = 0;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (strcmp(exe_path, myexe_path) == 0) {
|
|
||||||
- return 1;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- return 0;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-#define LOCKSTRLEN 11
|
|
||||||
-
|
|
||||||
-long
|
|
||||||
-crm_read_pidfile(const char *filename)
|
|
||||||
-{
|
|
||||||
- int fd;
|
|
||||||
- struct stat sbuf;
|
|
||||||
- long pid = -ENOENT;
|
|
||||||
- char buf[LOCKSTRLEN + 1];
|
|
||||||
-
|
|
||||||
- if ((fd = open(filename, O_RDONLY)) < 0) {
|
|
||||||
- goto bail;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (fstat(fd, &sbuf) >= 0 && sbuf.st_size < LOCKSTRLEN) {
|
|
||||||
- sleep(2); /* if someone was about to create one,
|
|
||||||
- * give'm a sec to do so
|
|
||||||
- */
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (read(fd, buf, sizeof(buf)) < 1) {
|
|
||||||
- goto bail;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (sscanf(buf, "%ld", &pid) > 0) {
|
|
||||||
- if (pid <= 0) {
|
|
||||||
- pid = -ESRCH;
|
|
||||||
- } else {
|
|
||||||
- crm_trace("Got pid %lu from %s\n", pid, filename);
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- bail:
|
|
||||||
- if (fd >= 0) {
|
|
||||||
- close(fd);
|
|
||||||
- }
|
|
||||||
- return pid;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-long
|
|
||||||
-crm_pidfile_inuse(const char *filename, long mypid, const char *daemon)
|
|
||||||
-{
|
|
||||||
- long pid = crm_read_pidfile(filename);
|
|
||||||
-
|
|
||||||
- if (pid < 2) {
|
|
||||||
- /* Invalid pid */
|
|
||||||
- pid = -ENOENT;
|
|
||||||
- unlink(filename);
|
|
||||||
-
|
|
||||||
- } else if (mypid && pid == mypid) {
|
|
||||||
- /* In use by us */
|
|
||||||
- pid = pcmk_ok;
|
|
||||||
-
|
|
||||||
- } else if (crm_pid_active(pid, daemon) == FALSE) {
|
|
||||||
- /* Contains a stale value */
|
|
||||||
- unlink(filename);
|
|
||||||
- pid = -ENOENT;
|
|
||||||
-
|
|
||||||
- } else if (mypid && pid != mypid) {
|
|
||||||
- /* locked by existing process - give up */
|
|
||||||
- pid = -EEXIST;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- return pid;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-static int
|
|
||||||
-crm_lock_pidfile(const char *filename, const char *name)
|
|
||||||
-{
|
|
||||||
- long mypid = 0;
|
|
||||||
- int fd = 0, rc = 0;
|
|
||||||
- char buf[LOCKSTRLEN + 2];
|
|
||||||
-
|
|
||||||
- mypid = (unsigned long)getpid();
|
|
||||||
-
|
|
||||||
- rc = crm_pidfile_inuse(filename, 0, name);
|
|
||||||
- if (rc == -ENOENT) {
|
|
||||||
- /* exists but the process is not active */
|
|
||||||
-
|
|
||||||
- } else if (rc != pcmk_ok) {
|
|
||||||
- /* locked by existing process - give up */
|
|
||||||
- return rc;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if ((fd = open(filename, O_CREAT | O_WRONLY | O_EXCL, 0644)) < 0) {
|
|
||||||
- /* Hmmh, why did we fail? Anyway, nothing we can do about it */
|
|
||||||
- return -errno;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- snprintf(buf, sizeof(buf), "%*ld\n", LOCKSTRLEN - 1, mypid);
|
|
||||||
- rc = write(fd, buf, LOCKSTRLEN);
|
|
||||||
- close(fd);
|
|
||||||
-
|
|
||||||
- if (rc != LOCKSTRLEN) {
|
|
||||||
- crm_perror(LOG_ERR, "Incomplete write to %s", filename);
|
|
||||||
- return -errno;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- return crm_pidfile_inuse(filename, mypid, name);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
void
|
|
||||||
crm_make_daemon(const char *name, gboolean daemonize, const char *pidfile)
|
|
||||||
{
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
|||||||
From 07f7ab1d805b7508889c9298d2ee1b2a44836ab9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Mon, 9 Apr 2018 14:23:27 -0500
|
|
||||||
Subject: [PATCH 07/17] Refactor: libcrmcommon: shuffle some internal
|
|
||||||
declarations around
|
|
||||||
|
|
||||||
trying to keep all internal header stuff for libcrmcommon in
|
|
||||||
include/crm/common/internal.h
|
|
||||||
---
|
|
||||||
include/crm/common/internal.h | 17 +++++++++++++++++
|
|
||||||
include/crm_internal.h | 11 -----------
|
|
||||||
2 files changed, 17 insertions(+), 11 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/include/crm/common/internal.h b/include/crm/common/internal.h
|
|
||||||
index 064e983b6..4aa0c49c6 100644
|
|
||||||
--- a/include/crm/common/internal.h
|
|
||||||
+++ b/include/crm/common/internal.h
|
|
||||||
@@ -55,6 +55,23 @@ long crm_read_pidfile(const char *filename);
|
|
||||||
int crm_lock_pidfile(const char *filename, const char *name);
|
|
||||||
|
|
||||||
|
|
||||||
+/* interal functions related to resource operations (from operations.c) */
|
|
||||||
+
|
|
||||||
+char *generate_op_key(const char *rsc_id, const char *op_type,
|
|
||||||
+ guint interval_ms);
|
|
||||||
+char *generate_notify_key(const char *rsc_id, const char *notify_type,
|
|
||||||
+ const char *op_type);
|
|
||||||
+char *generate_transition_magic(const char *transition_key, int op_status,
|
|
||||||
+ int op_rc);
|
|
||||||
+char *generate_transition_key(int action, int transition_id, int target_rc,
|
|
||||||
+ const char *node);
|
|
||||||
+void filter_action_parameters(xmlNode *param_set, const char *version);
|
|
||||||
+xmlNode *create_operation_update(xmlNode *parent, lrmd_event_data_t *event,
|
|
||||||
+ const char *caller_version, int target_rc,
|
|
||||||
+ const char *node, const char *origin,
|
|
||||||
+ int level);
|
|
||||||
+
|
|
||||||
+
|
|
||||||
/* internal generic string functions (from strings.c) */
|
|
||||||
|
|
||||||
long long crm_int_helper(const char *text, char **end_text);
|
|
||||||
diff --git a/include/crm_internal.h b/include/crm_internal.h
|
|
||||||
index 78d947905..63dca974a 100644
|
|
||||||
--- a/include/crm_internal.h
|
|
||||||
+++ b/include/crm_internal.h
|
|
||||||
@@ -129,17 +129,6 @@ extern int node_score_yellow;
|
|
||||||
/* Assorted convenience functions */
|
|
||||||
void crm_make_daemon(const char *name, gboolean daemonize, const char *pidfile);
|
|
||||||
|
|
||||||
-/* from operations.c */
|
|
||||||
-char *generate_op_key(const char *rsc_id, const char *op_type, guint interval_ms);
|
|
||||||
-char *generate_notify_key(const char *rsc_id, const char *notify_type, const char *op_type);
|
|
||||||
-char *generate_transition_magic(const char *transition_key, int op_status, int op_rc);
|
|
||||||
-char *generate_transition_key(int action, int transition_id, int target_rc, const char *node);
|
|
||||||
-void filter_action_parameters(xmlNode *param_set, const char *version);
|
|
||||||
-xmlNode *create_operation_update(xmlNode *parent, lrmd_event_data_t *event,
|
|
||||||
- const char *caller_version, int target_rc,
|
|
||||||
- const char *node, const char *origin,
|
|
||||||
- int level);
|
|
||||||
-
|
|
||||||
// printf-style format to create operation ID from resource, action, interval
|
|
||||||
#define CRM_OP_FMT "%s_%s_%u"
|
|
||||||
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
From 720e8bc0524e436eefb8167bc3aff4b4d795f02c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Mon, 9 Apr 2018 15:20:01 -0500
|
|
||||||
Subject: [PATCH 08/17] High: crmd: delete resource from lrmd when appropriate
|
|
||||||
|
|
||||||
Regression introduced in e8802834 (2.0.0-rc2): a missing return value check
|
|
||||||
meant that crmd would always delete resource from its LRM state only, and
|
|
||||||
not from the lrmd itself. As a side effect, this also introduced a memory leak
|
|
||||||
when deleting a resource.
|
|
||||||
---
|
|
||||||
crmd/lrm.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/crmd/lrm.c b/crmd/lrm.c
|
|
||||||
index 7d4f05748..90300334d 100644
|
|
||||||
--- a/crmd/lrm.c
|
|
||||||
+++ b/crmd/lrm.c
|
|
||||||
@@ -1820,7 +1820,7 @@ do_lrm_invoke(long long action,
|
|
||||||
PCMK_OCF_CONNECTION_DIED);
|
|
||||||
return;
|
|
||||||
|
|
||||||
- } else if (!create_rsc) {
|
|
||||||
+ } else if ((rc < 0) && !create_rsc) {
|
|
||||||
/* Delete of malformed or nonexistent resource
|
|
||||||
* (deleting something that does not exist is a success)
|
|
||||||
*/
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
|||||||
From 621bea158d57dd5c2f9ccc1ebe2f5978d5b638b6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Mon, 9 Apr 2018 17:49:49 -0500
|
|
||||||
Subject: [PATCH 09/17] Test: cts-cli: update expected results for recent
|
|
||||||
changes
|
|
||||||
|
|
||||||
should have been done with 0a21e9ca3
|
|
||||||
---
|
|
||||||
cts/cli/regression.acls.exp | 10 +++++-----
|
|
||||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cts/cli/regression.acls.exp b/cts/cli/regression.acls.exp
|
|
||||||
index cc3163621..0bef6f447 100644
|
|
||||||
--- a/cts/cli/regression.acls.exp
|
|
||||||
+++ b/cts/cli/regression.acls.exp
|
|
||||||
@@ -1182,8 +1182,8 @@ Call failed: Permission denied
|
|
||||||
* Passed: cibadmin - bob: Replace - delete attribute (allow)
|
|
||||||
|
|
||||||
|
|
||||||
- !#!#!#!#! Upgrading to pacemaker-2.0 and retesting !#!#!#!#!
|
|
||||||
-=#=#=#= Begin test: root: Upgrade to pacemaker-2.0 =#=#=#=
|
|
||||||
+ !#!#!#!#! Upgrading to latest CIB schema and re-testing !#!#!#!#!
|
|
||||||
+=#=#=#= Begin test: root: Upgrade to latest CIB schema =#=#=#=
|
|
||||||
__xml_acl_post_process: Creation of acl_permission=observer-read-1 is allowed
|
|
||||||
__xml_acl_post_process: Creation of acl_permission=observer-write-1 is allowed
|
|
||||||
__xml_acl_post_process: Creation of acl_permission=observer-write-2 is allowed
|
|
||||||
@@ -1206,7 +1206,7 @@ __xml_acl_post_process: Creation of role=auto-betteridea is allowed
|
|
||||||
__xml_acl_post_process: Creation of acl_role=auto-betteridea is allowed
|
|
||||||
__xml_acl_post_process: Creation of acl_permission=betteridea-nothing is allowed
|
|
||||||
__xml_acl_post_process: Creation of acl_permission=betteridea-resources is allowed
|
|
||||||
-=#=#=#= Current cib after: root: Upgrade to pacemaker-2.0 =#=#=#=
|
|
||||||
+=#=#=#= Current cib after: root: Upgrade to latest CIB schema =#=#=#=
|
|
||||||
<cib epoch="2" num_updates="0" admin_epoch="1">
|
|
||||||
<configuration>
|
|
||||||
<crm_config>
|
|
||||||
@@ -1260,8 +1260,8 @@ __xml_acl_post_process: Creation of acl_permission=betteridea-resources is allow
|
|
||||||
</configuration>
|
|
||||||
<status/>
|
|
||||||
</cib>
|
|
||||||
-=#=#=#= End test: root: Upgrade to pacemaker-2.0 - OK (0) =#=#=#=
|
|
||||||
-* Passed: cibadmin - root: Upgrade to pacemaker-2.0
|
|
||||||
+=#=#=#= End test: root: Upgrade to latest CIB schema - OK (0) =#=#=#=
|
|
||||||
+* Passed: cibadmin - root: Upgrade to latest CIB schema
|
|
||||||
=#=#=#= Begin test: unknownguy: Query configuration =#=#=#=
|
|
||||||
Call failed: Permission denied
|
|
||||||
=#=#=#= End test: unknownguy: Query configuration - Insufficient privileges (4) =#=#=#=
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,106 +0,0 @@
|
|||||||
From ea62ae820b0fa71e5f582f844db21a79db268c1e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Mon, 9 Apr 2018 17:50:23 -0500
|
|
||||||
Subject: [PATCH 10/17] Test: cts-cli,cts-pengine: avoid sed -i
|
|
||||||
|
|
||||||
"sed -i" isn't POSIX, and its usage differs in GNU sed and BSD sed,
|
|
||||||
so avoid it in regression tests.
|
|
||||||
|
|
||||||
It should be handled similarly in other places where it remains, but this will
|
|
||||||
help get the BSD build working.
|
|
||||||
---
|
|
||||||
cts/cts-cli.in | 25 +++++++++----------------
|
|
||||||
cts/cts-pengine.in | 13 ++++++++++++-
|
|
||||||
2 files changed, 21 insertions(+), 17 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cts/cts-cli.in b/cts/cts-cli.in
|
|
||||||
index 365f4b10b..38045b944 100755
|
|
||||||
--- a/cts/cts-cli.in
|
|
||||||
+++ b/cts/cts-cli.in
|
|
||||||
@@ -433,18 +433,6 @@ function test_dates() {
|
|
||||||
test_assert $CRM_EX_OK 0
|
|
||||||
}
|
|
||||||
|
|
||||||
-function get_epoch() {
|
|
||||||
- CIB_user=root CIB_file=$1 CIB_shadow="" cibadmin -Q | head -n 1 | sed -e 's/.* epoch=\"\([0-9]*\).*/\1/'
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-function restore_epoch() {
|
|
||||||
- infile=$1; shift
|
|
||||||
- old=$1; shift
|
|
||||||
- new=$(get_epoch $infile)
|
|
||||||
-
|
|
||||||
- sed -i 's/epoch=.$old/epoch=\"$new/g' $infile
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
function test_acl_loop() {
|
|
||||||
local TMPXML="$1"
|
|
||||||
|
|
||||||
@@ -693,8 +681,11 @@ EOF
|
|
||||||
test_assert $CRM_EX_OK
|
|
||||||
|
|
||||||
SHADOWPATH="$(crm_shadow --file)"
|
|
||||||
- sed -i 's/epoch=.2/epoch=\"6/g' "$SHADOWPATH"
|
|
||||||
- sed -i 's/admin_epoch=.1/admin_epoch=\"0/g' "$SHADOWPATH"
|
|
||||||
+ # sed -i isn't portable :-(
|
|
||||||
+ cp -p "$SHADOWPATH" "${SHADOWPATH}.$$" # to keep permissions
|
|
||||||
+ sed -e 's/epoch=.2/epoch=\"6/g' -e 's/admin_epoch=.1/admin_epoch=\"0/g' \
|
|
||||||
+ "$SHADOWPATH" > "${SHADOWPATH}.$$"
|
|
||||||
+ mv -- "${SHADOWPATH}.$$" "$SHADOWPATH"
|
|
||||||
|
|
||||||
test_acl_loop "$TMPXML"
|
|
||||||
|
|
||||||
@@ -845,7 +836,8 @@ for t in $tests; do
|
|
||||||
eval TMPFILE_$t="$TMPFILE"
|
|
||||||
test_$t > "$TMPFILE"
|
|
||||||
|
|
||||||
- sed -i -e 's/cib-last-written.*>/>/'\
|
|
||||||
+ # sed -i isn't portable :-(
|
|
||||||
+ sed -e 's/cib-last-written.*>/>/'\
|
|
||||||
-e 's/ last-run=\"[0-9]*\"//'\
|
|
||||||
-e 's/crm_feature_set="[^"]*" //'\
|
|
||||||
-e 's/validate-with="[^"]*" //'\
|
|
||||||
@@ -859,7 +851,8 @@ for t in $tests; do
|
|
||||||
-e 's/schemas\.c:\([0-9][0-9]*\)/schemas.c:NNN/' \
|
|
||||||
-e 's/constraints\.:\([0-9][0-9]*\)/constraints.:NNN/' \
|
|
||||||
-e 's/\(validation ([0-9][0-9]* of \)[0-9][0-9]*\().*\)/\1X\2/' \
|
|
||||||
- "$TMPFILE"
|
|
||||||
+ "$TMPFILE" > "${TMPFILE}.$$"
|
|
||||||
+ mv -- "${TMPFILE}.$$" "$TMPFILE"
|
|
||||||
|
|
||||||
if [ $do_save -eq 1 ]; then
|
|
||||||
cp "$TMPFILE" $test_home/cli/regression.$t.exp
|
|
||||||
diff --git a/cts/cts-pengine.in b/cts/cts-pengine.in
|
|
||||||
index fb0952580..060708439 100644
|
|
||||||
--- a/cts/cts-pengine.in
|
|
||||||
+++ b/cts/cts-pengine.in
|
|
||||||
@@ -84,6 +84,17 @@ function show_test() {
|
|
||||||
printf " Test %-25s $*\n" "$name:"
|
|
||||||
}
|
|
||||||
|
|
||||||
+# Normalize policy engine output for comparison
|
|
||||||
+normalize() {
|
|
||||||
+ for NORMALIZE_FILE in "$@"; do
|
|
||||||
+ # sed -i is not portable :-(
|
|
||||||
+ sed -e 's/crm_feature_set="[^"]*"//' \
|
|
||||||
+ -e 's/batch-limit="[0-9]*"//' \
|
|
||||||
+ "$NORMALIZE_FILE" > "${NORMALIZE_FILE}.$$"
|
|
||||||
+ mv -- "${NORMALIZE_FILE}.$$" "$NORMALIZE_FILE"
|
|
||||||
+ done
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
info "Test home is:\t$test_home"
|
|
||||||
|
|
||||||
create_mode="false"
|
|
||||||
@@ -332,7 +343,7 @@ do_test() {
|
|
||||||
rm -f $dot_output
|
|
||||||
fi
|
|
||||||
|
|
||||||
- sed -i -e 's/crm_feature_set="[^"]*"//' -e 's/batch-limit="[0-9]*"//' $expected $output
|
|
||||||
+ normalize "$expected" "$output"
|
|
||||||
diff $diff_opts $expected $output >/dev/null
|
|
||||||
rc2=$?
|
|
||||||
if [ $rc2 -ne 0 ]; then
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,171 +0,0 @@
|
|||||||
From 560281f7479d3526fd974a0c21c09ae930151df1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Tue, 10 Apr 2018 10:43:35 -0500
|
|
||||||
Subject: [PATCH 11/17] Build: tools: only link against necessary libraries
|
|
||||||
|
|
||||||
COMMONLIBS was not
|
|
||||||
---
|
|
||||||
tools/Makefile.am | 103 ++++++++++++++++++++++------------------------
|
|
||||||
1 file changed, 50 insertions(+), 53 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/tools/Makefile.am b/tools/Makefile.am
|
|
||||||
index f1cc92ed2..24b1d8bdd 100644
|
|
||||||
--- a/tools/Makefile.am
|
|
||||||
+++ b/tools/Makefile.am
|
|
||||||
@@ -1,19 +1,8 @@
|
|
||||||
#
|
|
||||||
-# Copyright (C) 2004-2009 Andrew Beekhof
|
|
||||||
+# Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
#
|
|
||||||
-# 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.
|
|
||||||
+# This source code is licensed under the GNU General Public License version 2
|
|
||||||
+# or later (GPLv2+) WITHOUT ANY WARRANTY.
|
|
||||||
#
|
|
||||||
include $(top_srcdir)/Makefile.common
|
|
||||||
|
|
||||||
@@ -21,11 +10,6 @@ if BUILD_SYSTEMD
|
|
||||||
systemdunit_DATA = crm_mon.service
|
|
||||||
endif
|
|
||||||
|
|
||||||
-COMMONLIBS = \
|
|
||||||
- $(top_builddir)/lib/common/libcrmcommon.la \
|
|
||||||
- $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
- $(CURSESLIBS) $(CLUSTERLIBS)
|
|
||||||
-
|
|
||||||
noinst_HEADERS = crm_resource.h fake_transition.h
|
|
||||||
|
|
||||||
pcmkdir = $(datadir)/$(PACKAGE)
|
|
||||||
@@ -52,71 +36,84 @@ endif
|
|
||||||
MAN8DEPS = crm_attribute crm_node
|
|
||||||
|
|
||||||
crmadmin_SOURCES = crmadmin.c
|
|
||||||
-crmadmin_LDADD = $(top_builddir)/lib/pengine/libpe_status.la \
|
|
||||||
- $(COMMONLIBS) $(CLUSTERLIBS)
|
|
||||||
+crmadmin_LDADD = $(top_builddir)/lib/pengine/libpe_status.la \
|
|
||||||
+ $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
+ $(top_builddir)/lib/common/libcrmcommon.la \
|
|
||||||
+ $(CLUSTERLIBS)
|
|
||||||
|
|
||||||
crm_error_SOURCES = crm_error.c
|
|
||||||
-crm_error_LDADD = $(COMMONLIBS)
|
|
||||||
+crm_error_LDADD = $(top_builddir)/lib/common/libcrmcommon.la
|
|
||||||
|
|
||||||
cibadmin_SOURCES = cibadmin.c
|
|
||||||
-cibadmin_LDADD = $(COMMONLIBS)
|
|
||||||
+cibadmin_LDADD = $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
+ $(top_builddir)/lib/common/libcrmcommon.la
|
|
||||||
|
|
||||||
crm_shadow_SOURCES = cib_shadow.c
|
|
||||||
-crm_shadow_LDADD = $(COMMONLIBS)
|
|
||||||
+crm_shadow_LDADD = $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
+ $(top_builddir)/lib/common/libcrmcommon.la
|
|
||||||
|
|
||||||
crm_node_SOURCES = crm_node.c
|
|
||||||
-crm_node_LDADD = $(top_builddir)/lib/cluster/libcrmcluster.la \
|
|
||||||
- $(COMMONLIBS) $(CLUSTERLIBS)
|
|
||||||
+crm_node_LDADD = $(top_builddir)/lib/cluster/libcrmcluster.la \
|
|
||||||
+ $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
+ $(top_builddir)/lib/common/libcrmcommon.la \
|
|
||||||
+ $(CLUSTERLIBS)
|
|
||||||
|
|
||||||
crm_simulate_SOURCES = crm_simulate.c fake_transition.c
|
|
||||||
crm_simulate_CFLAGS = -I$(top_srcdir)/pengine
|
|
||||||
|
|
||||||
-crm_simulate_LDADD = $(top_builddir)/lib/pengine/libpe_status.la \
|
|
||||||
- $(top_builddir)/pengine/libpengine.la \
|
|
||||||
- $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
- $(top_builddir)/lib/lrmd/liblrmd.la \
|
|
||||||
- $(top_builddir)/lib/transition/libtransitioner.la \
|
|
||||||
- $(COMMONLIBS)
|
|
||||||
+crm_simulate_LDADD = $(top_builddir)/lib/pengine/libpe_status.la \
|
|
||||||
+ $(top_builddir)/pengine/libpengine.la \
|
|
||||||
+ $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
+ $(top_builddir)/lib/lrmd/liblrmd.la \
|
|
||||||
+ $(top_builddir)/lib/transition/libtransitioner.la \
|
|
||||||
+ $(top_builddir)/lib/common/libcrmcommon.la
|
|
||||||
|
|
||||||
crm_diff_SOURCES = crm_diff.c
|
|
||||||
-crm_diff_LDADD = $(COMMONLIBS)
|
|
||||||
+crm_diff_LDADD = $(top_builddir)/lib/common/libcrmcommon.la
|
|
||||||
|
|
||||||
crm_mon_SOURCES = crm_mon.c
|
|
||||||
-crm_mon_LDADD = $(top_builddir)/lib/pengine/libpe_status.la \
|
|
||||||
- $(top_builddir)/lib/fencing/libstonithd.la \
|
|
||||||
- $(top_builddir)/pengine/libpengine.la \
|
|
||||||
- $(COMMONLIBS)
|
|
||||||
+crm_mon_LDADD = $(top_builddir)/lib/pengine/libpe_status.la \
|
|
||||||
+ $(top_builddir)/lib/fencing/libstonithd.la \
|
|
||||||
+ $(top_builddir)/pengine/libpengine.la \
|
|
||||||
+ $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
+ $(top_builddir)/lib/common/libcrmcommon.la \
|
|
||||||
+ $(CURSESLIBS)
|
|
||||||
|
|
||||||
# Arguments could be made that this should live in crm/pengine
|
|
||||||
crm_verify_SOURCES = crm_verify.c
|
|
||||||
crm_verify_LDADD = $(top_builddir)/lib/pengine/libpe_status.la \
|
|
||||||
- $(top_builddir)/pengine/libpengine.la \
|
|
||||||
- $(COMMONLIBS)
|
|
||||||
+ $(top_builddir)/pengine/libpengine.la \
|
|
||||||
+ $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
+ $(top_builddir)/lib/common/libcrmcommon.la
|
|
||||||
|
|
||||||
crm_attribute_SOURCES = crm_attribute.c
|
|
||||||
-crm_attribute_LDADD = $(top_builddir)/lib/cluster/libcrmcluster.la $(COMMONLIBS)
|
|
||||||
+crm_attribute_LDADD = $(top_builddir)/lib/cluster/libcrmcluster.la \
|
|
||||||
+ $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
+ $(top_builddir)/lib/common/libcrmcommon.la
|
|
||||||
|
|
||||||
crm_resource_SOURCES = crm_resource.c crm_resource_ban.c crm_resource_runtime.c crm_resource_print.c fake_transition.c
|
|
||||||
crm_resource_CFLAGS = -I$(top_srcdir)/pengine
|
|
||||||
-crm_resource_LDADD = $(top_builddir)/lib/pengine/libpe_rules.la \
|
|
||||||
- $(top_builddir)/lib/lrmd/liblrmd.la \
|
|
||||||
- $(top_builddir)/lib/services/libcrmservice.la \
|
|
||||||
- $(top_builddir)/lib/pengine/libpe_status.la \
|
|
||||||
- $(top_builddir)/pengine/libpengine.la \
|
|
||||||
- $(top_builddir)/lib/transition/libtransitioner.la \
|
|
||||||
- $(COMMONLIBS)
|
|
||||||
+crm_resource_LDADD = $(top_builddir)/lib/pengine/libpe_rules.la \
|
|
||||||
+ $(top_builddir)/lib/lrmd/liblrmd.la \
|
|
||||||
+ $(top_builddir)/lib/services/libcrmservice.la \
|
|
||||||
+ $(top_builddir)/lib/pengine/libpe_status.la \
|
|
||||||
+ $(top_builddir)/pengine/libpengine.la \
|
|
||||||
+ $(top_builddir)/lib/transition/libtransitioner.la \
|
|
||||||
+ $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
+ $(top_builddir)/lib/common/libcrmcommon.la
|
|
||||||
|
|
||||||
iso8601_SOURCES = test.iso8601.c
|
|
||||||
-iso8601_LDADD = $(COMMONLIBS)
|
|
||||||
+iso8601_LDADD = $(top_builddir)/lib/common/libcrmcommon.la
|
|
||||||
|
|
||||||
attrd_updater_SOURCES = attrd_updater.c
|
|
||||||
-attrd_updater_LDADD = $(COMMONLIBS)
|
|
||||||
+attrd_updater_LDADD = $(top_builddir)/lib/common/libcrmcommon.la
|
|
||||||
|
|
||||||
crm_ticket_SOURCES = crm_ticket.c
|
|
||||||
-crm_ticket_LDADD = $(top_builddir)/lib/pengine/libpe_rules.la \
|
|
||||||
- $(top_builddir)/lib/pengine/libpe_status.la \
|
|
||||||
- $(top_builddir)/pengine/libpengine.la \
|
|
||||||
- $(COMMONLIBS)
|
|
||||||
+crm_ticket_LDADD = $(top_builddir)/lib/pengine/libpe_rules.la \
|
|
||||||
+ $(top_builddir)/lib/pengine/libpe_status.la \
|
|
||||||
+ $(top_builddir)/pengine/libpengine.la \
|
|
||||||
+ $(top_builddir)/lib/cib/libcib.la \
|
|
||||||
+ $(top_builddir)/lib/common/libcrmcommon.la
|
|
||||||
|
|
||||||
if BUILD_SERVICELOG
|
|
||||||
notifyServicelogEvent_SOURCES = notifyServicelogEvent.c
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,268 +0,0 @@
|
|||||||
From b8745b20b966076f1218d9a3c476ec7537330122 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Tue, 10 Apr 2018 12:25:25 -0500
|
|
||||||
Subject: [PATCH 12/17] Low: fencing: free dynamic memory at stonithd shutdown
|
|
||||||
|
|
||||||
No serious effect since it's shutting down anyway, but clean up for the sake of
|
|
||||||
completeness, and making memory analysis happy
|
|
||||||
---
|
|
||||||
fencing/commands.c | 59 +++++++++++++++++++++++++++++++++++++++++-----
|
|
||||||
fencing/internal.h | 11 +++++----
|
|
||||||
fencing/main.c | 34 +++++++++-----------------
|
|
||||||
fencing/remote.c | 29 +++++++++++------------
|
|
||||||
4 files changed, 85 insertions(+), 48 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/fencing/commands.c b/fencing/commands.c
|
|
||||||
index 809be518c..fe624da7d 100644
|
|
||||||
--- a/fencing/commands.c
|
|
||||||
+++ b/fencing/commands.c
|
|
||||||
@@ -485,7 +485,7 @@ schedule_stonith_command(async_command_t * cmd, stonith_device_t * device)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-void
|
|
||||||
+static void
|
|
||||||
free_device(gpointer data)
|
|
||||||
{
|
|
||||||
GListPtr gIter = NULL;
|
|
||||||
@@ -514,6 +514,23 @@ free_device(gpointer data)
|
|
||||||
free(device);
|
|
||||||
}
|
|
||||||
|
|
||||||
+void free_device_list()
|
|
||||||
+{
|
|
||||||
+ if (device_list != NULL) {
|
|
||||||
+ g_hash_table_destroy(device_list);
|
|
||||||
+ device_list = NULL;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+init_device_list()
|
|
||||||
+{
|
|
||||||
+ if (device_list == NULL) {
|
|
||||||
+ device_list = g_hash_table_new_full(crm_str_hash, g_str_equal, NULL,
|
|
||||||
+ free_device);
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static GHashTable *
|
|
||||||
build_port_aliases(const char *hostmap, GListPtr * targets)
|
|
||||||
{
|
|
||||||
@@ -670,16 +687,28 @@ parse_host_list(const char *hosts)
|
|
||||||
|
|
||||||
GHashTable *metadata_cache = NULL;
|
|
||||||
|
|
||||||
+void
|
|
||||||
+free_metadata_cache() {
|
|
||||||
+ if (metadata_cache != NULL) {
|
|
||||||
+ g_hash_table_destroy(metadata_cache);
|
|
||||||
+ metadata_cache = NULL;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static void
|
|
||||||
+init_metadata_cache() {
|
|
||||||
+ if (metadata_cache == NULL) {
|
|
||||||
+ metadata_cache = crm_str_table_new();
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static xmlNode *
|
|
||||||
get_agent_metadata(const char *agent)
|
|
||||||
{
|
|
||||||
xmlNode *xml = NULL;
|
|
||||||
char *buffer = NULL;
|
|
||||||
|
|
||||||
- if(metadata_cache == NULL) {
|
|
||||||
- metadata_cache = crm_str_table_new();
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
+ init_metadata_cache();
|
|
||||||
buffer = g_hash_table_lookup(metadata_cache, agent);
|
|
||||||
if(safe_str_eq(agent, STONITH_WATCHDOG_AGENT)) {
|
|
||||||
return NULL;
|
|
||||||
@@ -1228,7 +1257,7 @@ count_active_levels(stonith_topology_t * tp)
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
-void
|
|
||||||
+static void
|
|
||||||
free_topology_entry(gpointer data)
|
|
||||||
{
|
|
||||||
stonith_topology_t *tp = data;
|
|
||||||
@@ -1247,6 +1276,24 @@ free_topology_entry(gpointer data)
|
|
||||||
free(tp);
|
|
||||||
}
|
|
||||||
|
|
||||||
+void
|
|
||||||
+free_topology_list()
|
|
||||||
+{
|
|
||||||
+ if (topology != NULL) {
|
|
||||||
+ g_hash_table_destroy(topology);
|
|
||||||
+ topology = NULL;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+init_topology_list()
|
|
||||||
+{
|
|
||||||
+ if (topology == NULL) {
|
|
||||||
+ topology = g_hash_table_new_full(crm_str_hash, g_str_equal, NULL,
|
|
||||||
+ free_topology_entry);
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
char *stonith_level_key(xmlNode *level, int mode)
|
|
||||||
{
|
|
||||||
if(mode == -1) {
|
|
||||||
diff --git a/fencing/internal.h b/fencing/internal.h
|
|
||||||
index 9687b63c4..34d82c901 100644
|
|
||||||
--- a/fencing/internal.h
|
|
||||||
+++ b/fencing/internal.h
|
|
||||||
@@ -177,6 +177,13 @@ typedef struct stonith_topology_s {
|
|
||||||
|
|
||||||
} stonith_topology_t;
|
|
||||||
|
|
||||||
+void init_device_list(void);
|
|
||||||
+void free_device_list(void);
|
|
||||||
+void init_topology_list(void);
|
|
||||||
+void free_topology_list(void);
|
|
||||||
+void free_remote_op_list(void);
|
|
||||||
+void free_metadata_cache(void);
|
|
||||||
+
|
|
||||||
long long get_stonith_flag(const char *name);
|
|
||||||
|
|
||||||
void stonith_command(crm_client_t * client, uint32_t id, uint32_t flags,
|
|
||||||
@@ -218,10 +225,6 @@ void *create_remote_stonith_op(const char *client, xmlNode * request, gboolean p
|
|
||||||
|
|
||||||
int stonith_fence_history(xmlNode * msg, xmlNode ** output);
|
|
||||||
|
|
||||||
-void free_device(gpointer data);
|
|
||||||
-
|
|
||||||
-void free_topology_entry(gpointer data);
|
|
||||||
-
|
|
||||||
bool fencing_peer_active(crm_node_t *peer);
|
|
||||||
|
|
||||||
int stonith_manual_ack(xmlNode * msg, remote_fencing_op_t * op);
|
|
||||||
diff --git a/fencing/main.c b/fencing/main.c
|
|
||||||
index 7f0dad581..888f9605e 100644
|
|
||||||
--- a/fencing/main.c
|
|
||||||
+++ b/fencing/main.c
|
|
||||||
@@ -1,19 +1,8 @@
|
|
||||||
/*
|
|
||||||
- * Copyright (C) 2009 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
+ * Copyright 2009-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
*
|
|
||||||
- * 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
+ * This source code is licensed under the GNU General Public License version 2
|
|
||||||
+ * or later (GPLv2+) WITHOUT ANY WARRANTY.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <crm_internal.h>
|
|
||||||
@@ -532,11 +521,8 @@ fencing_topology_init()
|
|
||||||
const char *xpath = "//" XML_TAG_FENCING_LEVEL;
|
|
||||||
|
|
||||||
crm_trace("Full topology refresh");
|
|
||||||
-
|
|
||||||
- if(topology) {
|
|
||||||
- g_hash_table_destroy(topology);
|
|
||||||
- topology = g_hash_table_new_full(crm_str_hash, g_str_equal, NULL, free_topology_entry);
|
|
||||||
- }
|
|
||||||
+ free_topology_list();
|
|
||||||
+ init_topology_list();
|
|
||||||
|
|
||||||
/* Grab everything */
|
|
||||||
xpathObj = xpath_search(local_cib, xpath);
|
|
||||||
@@ -1160,6 +1146,10 @@ stonith_cleanup(void)
|
|
||||||
|
|
||||||
crm_peer_destroy();
|
|
||||||
crm_client_cleanup();
|
|
||||||
+ free_remote_op_list();
|
|
||||||
+ free_topology_list();
|
|
||||||
+ free_device_list();
|
|
||||||
+ free_metadata_cache();
|
|
||||||
free(stonith_our_uname);
|
|
||||||
free_xml(local_cib);
|
|
||||||
}
|
|
||||||
@@ -1466,10 +1456,8 @@ main(int argc, char **argv)
|
|
||||||
stonith_our_uname = strdup("localhost");
|
|
||||||
}
|
|
||||||
|
|
||||||
-
|
|
||||||
- device_list = g_hash_table_new_full(crm_str_hash, g_str_equal, NULL, free_device);
|
|
||||||
-
|
|
||||||
- topology = g_hash_table_new_full(crm_str_hash, g_str_equal, NULL, free_topology_entry);
|
|
||||||
+ init_device_list();
|
|
||||||
+ init_topology_list();
|
|
||||||
|
|
||||||
if(stonith_watchdog_timeout_ms > 0) {
|
|
||||||
xmlNode *xml;
|
|
||||||
diff --git a/fencing/remote.c b/fencing/remote.c
|
|
||||||
index e1d1a5c66..a2b8bfb40 100644
|
|
||||||
--- a/fencing/remote.c
|
|
||||||
+++ b/fencing/remote.c
|
|
||||||
@@ -1,19 +1,8 @@
|
|
||||||
/*
|
|
||||||
- * Copyright (C) 2009 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
+ * Copyright 2009-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
*
|
|
||||||
- * 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
+ * This source code is licensed under the GNU General Public License version 2
|
|
||||||
+ * or later (GPLv2+) WITHOUT ANY WARRANTY.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <crm_internal.h>
|
|
||||||
@@ -82,7 +71,8 @@ typedef struct st_query_result_s {
|
|
||||||
GHashTable *devices;
|
|
||||||
} st_query_result_t;
|
|
||||||
|
|
||||||
-GHashTable *remote_op_list = NULL;
|
|
||||||
+static GHashTable *remote_op_list = NULL;
|
|
||||||
+
|
|
||||||
void call_remote_stonith(remote_fencing_op_t * op, st_query_result_t * peer);
|
|
||||||
static void remote_op_done(remote_fencing_op_t * op, xmlNode * data, int rc, int dup);
|
|
||||||
extern xmlNode *stonith_create_op(int call_id, const char *token, const char *op, xmlNode * data,
|
|
||||||
@@ -111,6 +101,15 @@ free_remote_query(gpointer data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+void
|
|
||||||
+free_remote_op_list()
|
|
||||||
+{
|
|
||||||
+ if (remote_op_list != NULL) {
|
|
||||||
+ g_hash_table_destroy(remote_op_list);
|
|
||||||
+ remote_op_list = NULL;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
struct peer_count_data {
|
|
||||||
const remote_fencing_op_t *op;
|
|
||||||
gboolean verified_only;
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
|||||||
From 13a7c5be972fbd5c00fa0ad3b832720c966e80cf Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Tue, 10 Apr 2018 15:19:11 -0500
|
|
||||||
Subject: [PATCH 13/17] Low: fencing: avoid memory leaks when freeing remote
|
|
||||||
operation
|
|
||||||
|
|
||||||
---
|
|
||||||
fencing/remote.c | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/fencing/remote.c b/fencing/remote.c
|
|
||||||
index a2b8bfb40..42ca9a7e8 100644
|
|
||||||
--- a/fencing/remote.c
|
|
||||||
+++ b/fencing/remote.c
|
|
||||||
@@ -237,6 +237,7 @@ free_remote_op(gpointer data)
|
|
||||||
|
|
||||||
free(op->id);
|
|
||||||
free(op->action);
|
|
||||||
+ free(op->delegate);
|
|
||||||
free(op->target);
|
|
||||||
free(op->client_id);
|
|
||||||
free(op->client_name);
|
|
||||||
@@ -254,6 +255,7 @@ free_remote_op(gpointer data)
|
|
||||||
op->devices_list = NULL;
|
|
||||||
}
|
|
||||||
g_list_free_full(op->automatic_list, free);
|
|
||||||
+ g_list_free(op->duplicates);
|
|
||||||
free(op);
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
From c900353052e3db556443694c3b9fb86d55d202a3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Tue, 10 Apr 2018 14:23:11 -0500
|
|
||||||
Subject: [PATCH 14/17] Low: libcrmcommon: fix memory leak in schema workaround
|
|
||||||
|
|
||||||
---
|
|
||||||
lib/common/schemas.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/lib/common/schemas.c b/lib/common/schemas.c
|
|
||||||
index c3fff1e79..9222acba0 100644
|
|
||||||
--- a/lib/common/schemas.c
|
|
||||||
+++ b/lib/common/schemas.c
|
|
||||||
@@ -684,7 +684,7 @@ apply_transformation(xmlNode *xml, const char *transform, gboolean to_logs)
|
|
||||||
#if PCMK_SCHEMAS_EMERGENCY_XSLT != 0
|
|
||||||
emergency_res = xsltSaveResultToString(&emergency_result,
|
|
||||||
&emergency_txt_len, res, xslt);
|
|
||||||
- free(res);
|
|
||||||
+ xmlFreeDoc(res);
|
|
||||||
CRM_CHECK(emergency_res == 0, goto cleanup);
|
|
||||||
out = string2xml((const char *) emergency_result);
|
|
||||||
free(emergency_result);
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
|||||||
From a70e665bea76d99ebb8809dd522dd2049c544fa7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Tue, 10 Apr 2018 15:16:25 -0500
|
|
||||||
Subject: [PATCH 15/17] Low: libcrmcommon: free signal triggers when cleaning
|
|
||||||
up mainloop
|
|
||||||
|
|
||||||
Not really necessary, but cleans up memory at exit better
|
|
||||||
---
|
|
||||||
lib/common/mainloop.c | 31 ++++++++++++++++++-------------
|
|
||||||
1 file changed, 18 insertions(+), 13 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/lib/common/mainloop.c b/lib/common/mainloop.c
|
|
||||||
index ba2f8d524..ce9f0ec3d 100644
|
|
||||||
--- a/lib/common/mainloop.c
|
|
||||||
+++ b/lib/common/mainloop.c
|
|
||||||
@@ -311,6 +311,17 @@ crm_signal(int sig, void (*dispatch) (int sig))
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static void
|
|
||||||
+mainloop_destroy_signal_entry(int sig)
|
|
||||||
+{
|
|
||||||
+ crm_signal_t *tmp = crm_signals[sig];
|
|
||||||
+
|
|
||||||
+ crm_signals[sig] = NULL;
|
|
||||||
+
|
|
||||||
+ crm_trace("Destroying signal %d", sig);
|
|
||||||
+ mainloop_destroy_trigger((crm_trigger_t *) tmp);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
gboolean
|
|
||||||
mainloop_add_signal(int sig, void (*dispatch) (int sig))
|
|
||||||
{
|
|
||||||
@@ -348,11 +359,7 @@ mainloop_add_signal(int sig, void (*dispatch) (int sig))
|
|
||||||
crm_signals[sig]->signal = sig;
|
|
||||||
|
|
||||||
if (crm_signal(sig, mainloop_signal_handler) == FALSE) {
|
|
||||||
- crm_signal_t *tmp = crm_signals[sig];
|
|
||||||
-
|
|
||||||
- crm_signals[sig] = NULL;
|
|
||||||
-
|
|
||||||
- mainloop_destroy_trigger((crm_trigger_t *) tmp);
|
|
||||||
+ mainloop_destroy_signal_entry(sig);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
#if 0
|
|
||||||
@@ -372,8 +379,6 @@ mainloop_add_signal(int sig, void (*dispatch) (int sig))
|
|
||||||
gboolean
|
|
||||||
mainloop_destroy_signal(int sig)
|
|
||||||
{
|
|
||||||
- crm_signal_t *tmp = NULL;
|
|
||||||
-
|
|
||||||
if (sig >= NSIG || sig < 0) {
|
|
||||||
crm_err("Signal %d is out of range", sig);
|
|
||||||
return FALSE;
|
|
||||||
@@ -385,11 +390,7 @@ mainloop_destroy_signal(int sig)
|
|
||||||
} else if (crm_signals[sig] == NULL) {
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- crm_trace("Destroying signal %d", sig);
|
|
||||||
- tmp = crm_signals[sig];
|
|
||||||
- crm_signals[sig] = NULL;
|
|
||||||
- mainloop_destroy_trigger((crm_trigger_t *) tmp);
|
|
||||||
+ mainloop_destroy_signal_entry(sig);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -398,9 +399,13 @@ static qb_array_t *gio_map = NULL;
|
|
||||||
void
|
|
||||||
mainloop_cleanup(void)
|
|
||||||
{
|
|
||||||
- if(gio_map) {
|
|
||||||
+ if (gio_map) {
|
|
||||||
qb_array_free(gio_map);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ for (int sig = 0; sig < NSIG; ++sig) {
|
|
||||||
+ mainloop_destroy_signal_entry(sig);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
|||||||
From 1f916d3007d3e15d8306283e97714f6d7bd82125 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Wed, 11 Apr 2018 09:14:13 -0500
|
|
||||||
Subject: [PATCH 16/17] Build: Makefile: build and clean (but not install) CTS
|
|
||||||
by default
|
|
||||||
|
|
||||||
---
|
|
||||||
Makefile.am | 25 ++++++++++++++++---------
|
|
||||||
1 file changed, 16 insertions(+), 9 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/Makefile.am b/Makefile.am
|
|
||||||
index f0f935dcf..4d5309a6e 100644
|
|
||||||
--- a/Makefile.am
|
|
||||||
+++ b/Makefile.am
|
|
||||||
@@ -23,8 +23,14 @@ EXTRA_DIST = autogen.sh m4/gnulib-cache.m4
|
|
||||||
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure DRF/config-h.in \
|
|
||||||
DRF/stamp-h.in libtool.m4 ltdl.m4
|
|
||||||
|
|
||||||
-CORE = replace include lib mcp attrd pengine cib crmd fencing lrmd tools xml
|
|
||||||
-SUBDIRS = $(CORE) extra doc
|
|
||||||
+# Only these will get installed with a plain "make install"
|
|
||||||
+CORE_INSTALL = replace include lib mcp \
|
|
||||||
+ attrd pengine cib crmd fencing lrmd tools xml
|
|
||||||
+
|
|
||||||
+# Only these will get built with a plain "make" or "make clean"
|
|
||||||
+CORE = $(CORE_INSTALL) cts
|
|
||||||
+
|
|
||||||
+SUBDIRS = $(CORE) doc extra
|
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/include
|
|
||||||
|
|
||||||
@@ -33,9 +39,6 @@ doc_DATA = README.markdown COPYING
|
|
||||||
licensedir = $(docdir)/licenses/
|
|
||||||
license_DATA = $(wildcard licenses/*)
|
|
||||||
|
|
||||||
-# Test components
|
|
||||||
-SUBDIRS += cts
|
|
||||||
-
|
|
||||||
# Scratch file for ad-hoc testing
|
|
||||||
noinst_PROGRAMS = scratch
|
|
||||||
nodist_scratch_SOURCES = scratch.c
|
|
||||||
@@ -45,15 +48,19 @@ scratch.c:
|
|
||||||
echo 'int main(void){}' >$@
|
|
||||||
|
|
||||||
core:
|
|
||||||
- @echo "Building only core components: $(CORE)"
|
|
||||||
+ @echo "Building only core components and tests: $(CORE)"
|
|
||||||
list='$(CORE)'; for subdir in $$list; do echo "Building $$subdir"; $(MAKE) -C $$subdir all || exit 1; done
|
|
||||||
|
|
||||||
core-install:
|
|
||||||
- @echo "Installing only core components: $(CORE)"
|
|
||||||
- list='$(CORE)'; for subdir in $$list; do echo "Installing $$subdir"; $(MAKE) -C $$subdir install || exit 1; done
|
|
||||||
+ @echo "Installing only core components: $(CORE_INSTALL)"
|
|
||||||
+ list='$(CORE_INSTALL)'; \
|
|
||||||
+ for subdir in $$list; do \
|
|
||||||
+ echo "Installing $$subdir"; \
|
|
||||||
+ $(MAKE) -C $$subdir install || exit 1; \
|
|
||||||
+ done
|
|
||||||
|
|
||||||
core-clean:
|
|
||||||
- @echo "Cleaning only core components: $(CORE)"
|
|
||||||
+ @echo "Cleaning only core components and tests: $(CORE)"
|
|
||||||
list='$(CORE)'; for subdir in $$list; do echo "Cleaning $$subdir"; $(MAKE) -C $$subdir clean || exit 1; done
|
|
||||||
|
|
||||||
install-exec-local:
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,196 +0,0 @@
|
|||||||
From 550a68817af8eaad45bfd001bba3782cba7e0d02 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ken Gaillot <kgaillot@redhat.com>
|
|
||||||
Date: Wed, 11 Apr 2018 10:35:31 -0500
|
|
||||||
Subject: [PATCH 17/17] Refactor: libcrmcommon: avoid "new" as variable name
|
|
||||||
|
|
||||||
confuses cppcheck
|
|
||||||
---
|
|
||||||
lib/common/xml.c | 69 +++++++++++++++++++++++++-----------------------
|
|
||||||
1 file changed, 36 insertions(+), 33 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/lib/common/xml.c b/lib/common/xml.c
|
|
||||||
index 7781d48a0..0bb64e5fb 100644
|
|
||||||
--- a/lib/common/xml.c
|
|
||||||
+++ b/lib/common/xml.c
|
|
||||||
@@ -4040,19 +4040,19 @@ apply_xml_diff(xmlNode *old_xml, xmlNode * diff, xmlNode **new_xml)
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
-__xml_diff_object(xmlNode * old, xmlNode * new)
|
|
||||||
+__xml_diff_object(xmlNode *old_xml, xmlNode *new_xml)
|
|
||||||
{
|
|
||||||
xmlNode *cIter = NULL;
|
|
||||||
xmlAttr *pIter = NULL;
|
|
||||||
|
|
||||||
- CRM_CHECK(new != NULL, return);
|
|
||||||
- if(old == NULL) {
|
|
||||||
- crm_node_created(new);
|
|
||||||
- __xml_acl_post_process(new); /* Check creation is allowed */
|
|
||||||
+ CRM_CHECK(new_xml != NULL, return);
|
|
||||||
+ if (old_xml == NULL) {
|
|
||||||
+ crm_node_created(new_xml);
|
|
||||||
+ __xml_acl_post_process(new_xml); // Check creation is allowed
|
|
||||||
return;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
- xml_private_t *p = new->_private;
|
|
||||||
+ xml_private_t *p = new_xml->_private;
|
|
||||||
|
|
||||||
if(p->flags & xpf_processed) {
|
|
||||||
/* Avoid re-comparing nodes */
|
|
||||||
@@ -4061,39 +4061,40 @@ __xml_diff_object(xmlNode * old, xmlNode * new)
|
|
||||||
p->flags |= xpf_processed;
|
|
||||||
}
|
|
||||||
|
|
||||||
- for (pIter = crm_first_attr(new); pIter != NULL; pIter = pIter->next) {
|
|
||||||
+ for (pIter = crm_first_attr(new_xml); pIter != NULL; pIter = pIter->next) {
|
|
||||||
xml_private_t *p = pIter->_private;
|
|
||||||
|
|
||||||
/* Assume everything was just created and take it from there */
|
|
||||||
p->flags |= xpf_created;
|
|
||||||
}
|
|
||||||
|
|
||||||
- for (pIter = crm_first_attr(old); pIter != NULL; ) {
|
|
||||||
+ for (pIter = crm_first_attr(old_xml); pIter != NULL; ) {
|
|
||||||
xmlAttr *prop = pIter;
|
|
||||||
xml_private_t *p = NULL;
|
|
||||||
const char *name = (const char *)pIter->name;
|
|
||||||
- const char *old_value = crm_element_value(old, name);
|
|
||||||
- xmlAttr *exists = xmlHasProp(new, pIter->name);
|
|
||||||
+ const char *old_value = crm_element_value(old_xml, name);
|
|
||||||
+ xmlAttr *exists = xmlHasProp(new_xml, pIter->name);
|
|
||||||
|
|
||||||
pIter = pIter->next;
|
|
||||||
if(exists == NULL) {
|
|
||||||
- p = new->doc->_private;
|
|
||||||
+ p = new_xml->doc->_private;
|
|
||||||
|
|
||||||
/* Prevent the dirty flag being set recursively upwards */
|
|
||||||
clear_bit(p->flags, xpf_tracking);
|
|
||||||
- exists = xmlSetProp(new, (const xmlChar *)name, (const xmlChar *)old_value);
|
|
||||||
+ exists = xmlSetProp(new_xml, (const xmlChar *) name,
|
|
||||||
+ (const xmlChar *) old_value);
|
|
||||||
set_bit(p->flags, xpf_tracking);
|
|
||||||
|
|
||||||
p = exists->_private;
|
|
||||||
p->flags = 0;
|
|
||||||
|
|
||||||
- crm_trace("Lost %s@%s=%s", old->name, name, old_value);
|
|
||||||
- xml_remove_prop(new, name);
|
|
||||||
+ crm_trace("Lost %s@%s=%s", old_xml->name, name, old_value);
|
|
||||||
+ xml_remove_prop(new_xml, name);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
int p_new = __xml_offset((xmlNode*)exists);
|
|
||||||
int p_old = __xml_offset((xmlNode*)prop);
|
|
||||||
- const char *value = crm_element_value(new, name);
|
|
||||||
+ const char *value = crm_element_value(new_xml, name);
|
|
||||||
|
|
||||||
p = exists->_private;
|
|
||||||
p->flags = (p->flags & ~xpf_created);
|
|
||||||
@@ -4102,16 +4103,18 @@ __xml_diff_object(xmlNode * old, xmlNode * new)
|
|
||||||
/* Restore the original value, so we can call crm_xml_add(),
|
|
||||||
* which checks ACLs
|
|
||||||
*/
|
|
||||||
- char *vcopy = crm_element_value_copy(new, name);
|
|
||||||
+ char *vcopy = crm_element_value_copy(new_xml, name);
|
|
||||||
|
|
||||||
- crm_trace("Modified %s@%s %s->%s", old->name, name, old_value, vcopy);
|
|
||||||
- xmlSetProp(new, prop->name, (const xmlChar *)old_value);
|
|
||||||
- crm_xml_add(new, name, vcopy);
|
|
||||||
+ crm_trace("Modified %s@%s %s->%s",
|
|
||||||
+ old_xml->name, name, old_value, vcopy);
|
|
||||||
+ xmlSetProp(new_xml, prop->name, (const xmlChar *) old_value);
|
|
||||||
+ crm_xml_add(new_xml, name, vcopy);
|
|
||||||
free(vcopy);
|
|
||||||
|
|
||||||
} else if(p_old != p_new) {
|
|
||||||
- crm_info("Moved %s@%s (%d -> %d)", old->name, name, p_old, p_new);
|
|
||||||
- __xml_node_dirty(new);
|
|
||||||
+ crm_info("Moved %s@%s (%d -> %d)",
|
|
||||||
+ old_xml->name, name, p_old, p_new);
|
|
||||||
+ __xml_node_dirty(new_xml);
|
|
||||||
p->flags |= xpf_dirty|xpf_moved;
|
|
||||||
|
|
||||||
if(p_old > p_new) {
|
|
||||||
@@ -4126,21 +4129,21 @@ __xml_diff_object(xmlNode * old, xmlNode * new)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- for (pIter = crm_first_attr(new); pIter != NULL; ) {
|
|
||||||
+ for (pIter = crm_first_attr(new_xml); pIter != NULL; ) {
|
|
||||||
xmlAttr *prop = pIter;
|
|
||||||
xml_private_t *p = pIter->_private;
|
|
||||||
|
|
||||||
pIter = pIter->next;
|
|
||||||
if(is_set(p->flags, xpf_created)) {
|
|
||||||
char *name = strdup((const char *)prop->name);
|
|
||||||
- char *value = crm_element_value_copy(new, name);
|
|
||||||
+ char *value = crm_element_value_copy(new_xml, name);
|
|
||||||
|
|
||||||
- crm_trace("Created %s@%s=%s", new->name, name, value);
|
|
||||||
+ crm_trace("Created %s@%s=%s", new_xml->name, name, value);
|
|
||||||
/* Remove plus create won't work as it will modify the relative attribute ordering */
|
|
||||||
- if(__xml_acl_check(new, name, xpf_acl_write)) {
|
|
||||||
+ if (__xml_acl_check(new_xml, name, xpf_acl_write)) {
|
|
||||||
crm_attr_dirty(prop);
|
|
||||||
} else {
|
|
||||||
- xmlUnsetProp(new, prop->name); /* Remove - change not allowed */
|
|
||||||
+ xmlUnsetProp(new_xml, prop->name); /* Remove - change not allowed */
|
|
||||||
}
|
|
||||||
|
|
||||||
free(value);
|
|
||||||
@@ -4148,9 +4151,9 @@ __xml_diff_object(xmlNode * old, xmlNode * new)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- for (cIter = __xml_first_child(old); cIter != NULL; ) {
|
|
||||||
+ for (cIter = __xml_first_child(old_xml); cIter != NULL; ) {
|
|
||||||
xmlNode *old_child = cIter;
|
|
||||||
- xmlNode *new_child = find_element(new, cIter, TRUE);
|
|
||||||
+ xmlNode *new_child = find_element(new_xml, cIter, TRUE);
|
|
||||||
|
|
||||||
cIter = __xml_next(cIter);
|
|
||||||
if(new_child) {
|
|
||||||
@@ -4158,7 +4161,7 @@ __xml_diff_object(xmlNode * old, xmlNode * new)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
/* Create then free (which will check the acls if necessary) */
|
|
||||||
- xmlNode *candidate = add_node_copy(new, old_child);
|
|
||||||
+ xmlNode *candidate = add_node_copy(new_xml, old_child);
|
|
||||||
xmlNode *top = xmlDocGetRootElement(candidate->doc);
|
|
||||||
|
|
||||||
__xml_node_clean(candidate);
|
|
||||||
@@ -4166,7 +4169,7 @@ __xml_diff_object(xmlNode * old, xmlNode * new)
|
|
||||||
/* Record the old position */
|
|
||||||
free_xml_with_position(candidate, __xml_offset(old_child));
|
|
||||||
|
|
||||||
- if (find_element(new, old_child, TRUE) == NULL) {
|
|
||||||
+ if (find_element(new_xml, old_child, TRUE) == NULL) {
|
|
||||||
xml_private_t *p = old_child->_private;
|
|
||||||
|
|
||||||
p->flags |= xpf_skip;
|
|
||||||
@@ -4174,9 +4177,9 @@ __xml_diff_object(xmlNode * old, xmlNode * new)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- for (cIter = __xml_first_child(new); cIter != NULL; ) {
|
|
||||||
+ for (cIter = __xml_first_child(new_xml); cIter != NULL; ) {
|
|
||||||
xmlNode *new_child = cIter;
|
|
||||||
- xmlNode *old_child = find_element(old, cIter, TRUE);
|
|
||||||
+ xmlNode *old_child = find_element(old_xml, cIter, TRUE);
|
|
||||||
|
|
||||||
cIter = __xml_next(cIter);
|
|
||||||
if(old_child == NULL) {
|
|
||||||
@@ -4194,7 +4197,7 @@ __xml_diff_object(xmlNode * old, xmlNode * new)
|
|
||||||
|
|
||||||
crm_info("%s.%s moved from %d to %d",
|
|
||||||
new_child->name, ID(new_child), p_old, p_new);
|
|
||||||
- __xml_node_dirty(new);
|
|
||||||
+ __xml_node_dirty(new_xml);
|
|
||||||
p->flags |= xpf_moved;
|
|
||||||
|
|
||||||
if(p_old > p_new) {
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
|||||||
From 889c0cdc0c592a7dee860bb6310a54bc8d33264e Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= <jpokorny@redhat.com>
|
|
||||||
Date: Wed, 11 Apr 2018 16:49:40 +0200
|
|
||||||
Subject: [PATCH] Tests: cts-cli: fix thinko leading to system-wide shadow
|
|
||||||
files
|
|
||||||
|
|
||||||
In particular, building RPM package and triggering %check lead
|
|
||||||
to cts-cli trying to work with shadow copies located under
|
|
||||||
/var/lib/pacemaker/cib -- and failing because that path doesn't
|
|
||||||
exist at that time (unless the buildroot is already spoiled).
|
|
||||||
This change was unintentionally brought with 1d0d0eff2 commit.
|
|
||||||
|
|
||||||
Note that "mktemp" is not reliably portable (not POSIX'd),
|
|
||||||
but there were other occurrences already.
|
|
||||||
---
|
|
||||||
cts/cts-cli.in | 12 +++++++++++-
|
|
||||||
1 file changed, 11 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/cts/cts-cli.in b/cts/cts-cli.in
|
|
||||||
index 33580ebac..75751c662 100755
|
|
||||||
--- a/cts/cts-cli.in
|
|
||||||
+++ b/cts/cts-cli.in
|
|
||||||
@@ -11,6 +11,7 @@ Options:
|
|
||||||
|
|
||||||
: ${shadow=cts-cli}
|
|
||||||
test_home="$(dirname $(readlink -e $0))"
|
|
||||||
+shadow_dir=$(mktemp -td cts-cli.shadow.XXXXXXXXXX)
|
|
||||||
num_errors=0
|
|
||||||
num_passed=0
|
|
||||||
GREP_OPTIONS=
|
|
||||||
@@ -73,6 +74,7 @@ function test_assert() {
|
|
||||||
function test_tools() {
|
|
||||||
local TMPXML=$(mktemp --tmpdir cts-cli.tools.xml.XXXXXXXXXX)
|
|
||||||
local TMPORIG=$(mktemp --tmpdir cts-cli.tools.existing.xml.XXXXXXXXXX)
|
|
||||||
+ export CIB_shadow_dir="${shadow_dir}"
|
|
||||||
|
|
||||||
$VALGRIND_CMD crm_shadow --batch --force --create-empty $shadow 2>&1
|
|
||||||
export CIB_shadow=$shadow
|
|
||||||
@@ -370,6 +372,7 @@ function test_tools() {
|
|
||||||
cmd="crm_resource -r test-primitive --meta -d is-managed"
|
|
||||||
test_assert $CRM_EX_OK
|
|
||||||
|
|
||||||
+ unset CIB_shadow_dir
|
|
||||||
rm -f "$TMPXML" "$TMPORIG"
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -614,7 +617,7 @@ function test_acl_loop() {
|
|
||||||
function test_acls() {
|
|
||||||
local SHADOWPATH
|
|
||||||
local TMPXML=$(mktemp --tmpdir cts-cli.acls.xml.XXXXXXXXXX)
|
|
||||||
-
|
|
||||||
+ export CIB_shadow_dir="${shadow_dir}"
|
|
||||||
|
|
||||||
$VALGRIND_CMD crm_shadow --batch --force --create-empty $shadow --validate-with pacemaker-1.3 2>&1
|
|
||||||
export CIB_shadow=$shadow
|
|
||||||
@@ -681,12 +684,15 @@ EOF
|
|
||||||
sed -i 's/admin_epoch=.1/admin_epoch=\"0/g' "$SHADOWPATH"
|
|
||||||
|
|
||||||
test_acl_loop "$TMPXML"
|
|
||||||
+
|
|
||||||
+ unset CIB_shadow_dir
|
|
||||||
rm -f "$TMPXML"
|
|
||||||
}
|
|
||||||
|
|
||||||
function test_validity() {
|
|
||||||
local TMPGOOD=$(mktemp --tmpdir cts-cli.validity.good.xml.XXXXXXXXXX)
|
|
||||||
local TMPBAD=$(mktemp --tmpdir cts-cli.validity.bad.xml.XXXXXXXXXX)
|
|
||||||
+ export CIB_shadow_dir="${shadow_dir}"
|
|
||||||
|
|
||||||
$VALGRIND_CMD crm_shadow --batch --force --create-empty $shadow --validate-with pacemaker-1.2 2>&1
|
|
||||||
export CIB_shadow=$shadow
|
|
||||||
@@ -752,6 +758,7 @@ function test_validity() {
|
|
||||||
cmd="crm_simulate -x $TMPBAD -S"
|
|
||||||
test_assert $CRM_EX_OK 0
|
|
||||||
|
|
||||||
+ unset CIB_shadow_dir
|
|
||||||
rm -f "$TMPGOOD" "$TMPBAD"
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -845,6 +852,9 @@ for t in $tests; do
|
|
||||||
cp "$TMPFILE" $test_home/cli/regression.$t.exp
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
+
|
|
||||||
+rm -f "${shadow_dir}/*"
|
|
||||||
+rmdir "${shadow_dir}"
|
|
||||||
|
|
||||||
failed=0
|
|
||||||
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
From 86a0b616d6363ff1a6f42454a5d4988266fc585d Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= <jpokorny@redhat.com>
|
|
||||||
Date: Thu, 12 Apr 2018 15:02:03 +0200
|
|
||||||
Subject: [PATCH] Build: cts: fix autoconf variable substitution in the shebang
|
|
||||||
|
|
||||||
Rectifies 5f3708020.
|
|
||||||
---
|
|
||||||
cts/cts.in | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/cts/cts.in b/cts/cts.in
|
|
||||||
index 9ff107c66..93ac1d3a3 100755
|
|
||||||
--- a/cts/cts.in
|
|
||||||
+++ b/cts/cts.in
|
|
||||||
@@ -1,4 +1,4 @@
|
|
||||||
-#!@BASH_PATH
|
|
||||||
+#!@BASH_PATH@
|
|
||||||
#
|
|
||||||
# Copyright 2012-2018 Andrew Beekhof <andrew@beekhof.net>
|
|
||||||
#
|
|
||||||
--
|
|
||||||
2.17.0
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
--- a/lib/common/remote.c.orig 2015-10-20 23:05:53.601054078 +0200
|
|
||||||
+++ b/lib/common/remote.c 2015-10-20 23:08:06.128302567 +0200
|
|
||||||
@@ -173,8 +173,10 @@
|
|
||||||
|
|
||||||
gnutls_init(session, type);
|
|
||||||
# ifdef HAVE_GNUTLS_PRIORITY_SET_DIRECT
|
|
||||||
+/* https://fedoraproject.org/wiki/Packaging:CryptoPolicies */
|
|
||||||
+ gnutls_priority_set_direct(*session, "@SYSTEM", NULL);
|
|
||||||
/* http://www.manpagez.com/info/gnutls/gnutls-2.10.4/gnutls_81.php#Echo-Server-with-anonymous-authentication */
|
|
||||||
- gnutls_priority_set_direct(*session, "NORMAL:+ANON-DH", NULL);
|
|
||||||
+/* gnutls_priority_set_direct(*session, "NORMAL:+ANON-DH", NULL); */
|
|
||||||
/* gnutls_priority_set_direct (*session, "NONE:+VERS-TLS-ALL:+CIPHER-ALL:+MAC-ALL:+SIGN-ALL:+COMP-ALL:+ANON-DH", NULL); */
|
|
||||||
# else
|
|
||||||
gnutls_set_default_priority(*session);
|
|
104
pacemaker.spec
104
pacemaker.spec
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
## Upstream commit (or git tag, such as "Pacemaker-" plus the
|
## Upstream commit (or git tag, such as "Pacemaker-" plus the
|
||||||
## {pcmkversion} macro for an official release) to use for this package
|
## {pcmkversion} macro for an official release) to use for this package
|
||||||
%global commit Pacemaker-2.0.0-rc2
|
%global commit Pacemaker-2.0.0-rc3
|
||||||
## Since git v2.11, the extent of abbreviation is autoscaled by default
|
## Since git v2.11, the extent of abbreviation is autoscaled by default
|
||||||
## (used to be constant of 7), so we need to convey it for non-tags, too.
|
## (used to be constant of 7), so we need to convey it for non-tags, too.
|
||||||
%global commit_abbrev 9
|
%global commit_abbrev 9
|
||||||
@ -64,6 +64,10 @@
|
|||||||
%define py_site %{?python3_sitelib}%{!?python3_sitelib:%(
|
%define py_site %{?python3_sitelib}%{!?python3_sitelib:%(
|
||||||
python3 -c 'from distutils.sysconfig import get_python_lib as gpl; print(gpl(1))' 2>/dev/null)}
|
python3 -c 'from distutils.sysconfig import get_python_lib as gpl; print(gpl(1))' 2>/dev/null)}
|
||||||
|
|
||||||
|
## Base GnuTLS cipher priorities (presumably only the initial, required keyword)
|
||||||
|
## overridable with "rpmbuild --define 'pcmk_gnutls_priorities PRIORITY-SPEC'"
|
||||||
|
%define gnutls_priorities %{?pcmk_gnutls_priorities}%{!?pcmk_gnutls_priorities:@SYSTEM}
|
||||||
|
|
||||||
|
|
||||||
# Define conditionals so that "rpmbuild --with <feature>" and
|
# Define conditionals so that "rpmbuild --with <feature>" and
|
||||||
# "rpmbuild --without <feature>" can enable and disable specific features
|
# "rpmbuild --without <feature>" can enable and disable specific features
|
||||||
@ -89,6 +93,9 @@
|
|||||||
## Add option to turn off hardening of libraries and daemon executables
|
## Add option to turn off hardening of libraries and daemon executables
|
||||||
%bcond_without hardening
|
%bcond_without hardening
|
||||||
|
|
||||||
|
## Add option to disable links for legacy daemon names
|
||||||
|
%bcond_without legacy_links
|
||||||
|
|
||||||
|
|
||||||
# Keep sane profiling data if requested
|
# Keep sane profiling data if requested
|
||||||
%if %{with profiling}
|
%if %{with profiling}
|
||||||
@ -128,28 +135,7 @@ Group: System Environment/Daemons
|
|||||||
Source0: https://github.com/%{github_owner}/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
|
Source0: https://github.com/%{github_owner}/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
|
||||||
Source1: https://github.com/%{github_owner}/%{nagios_name}/archive/%{nagios_hash}/%{nagios_name}-%{nagios_hash}.tar.gz
|
Source1: https://github.com/%{github_owner}/%{nagios_name}/archive/%{nagios_hash}/%{nagios_name}-%{nagios_hash}.tar.gz
|
||||||
# ---
|
# ---
|
||||||
Patch0: 0001-Fix-rhbz-1565187-Ensure-failures-that-cause-fencing-.patch
|
# patches go here
|
||||||
Patch1: 0002-Test-rhbz-1565187-Ensure-failures-that-cause-fencing.patch
|
|
||||||
Patch2: 0003-Test-cts-pengine-create_mode-is-now-controlled-by-up.patch
|
|
||||||
Patch3: 0004-Build-cts-update-scripts-to-use-new-BASH_PATH-subsit.patch
|
|
||||||
# reordered due to how rebases where done
|
|
||||||
Patch4: 0018-Tests-cts-cli-fix-thinko-leading-to-system-wide-shad.patch
|
|
||||||
Patch5: 0005-Test-cts-don-t-use-readlink-e-unless-supported.patch
|
|
||||||
Patch6: 0006-Refactor-libcrmcommon-move-PID-functions-to-own-file.patch
|
|
||||||
Patch7: 0007-Refactor-libcrmcommon-shuffle-some-internal-declarat.patch
|
|
||||||
Patch8: 0008-High-crmd-delete-resource-from-lrmd-when-appropriate.patch
|
|
||||||
Patch9: 0009-Test-cts-cli-update-expected-results-for-recent-chan.patch
|
|
||||||
Patch10: 0010-Test-cts-cli-cts-pengine-avoid-sed-i.patch
|
|
||||||
Patch11: 0011-Build-tools-only-link-against-necessary-libraries.patch
|
|
||||||
Patch12: 0012-Low-fencing-free-dynamic-memory-at-stonithd-shutdown.patch
|
|
||||||
Patch13: 0013-Low-fencing-avoid-memory-leaks-when-freeing-remote-o.patch
|
|
||||||
Patch14: 0014-Low-libcrmcommon-fix-memory-leak-in-schema-workaroun.patch
|
|
||||||
Patch15: 0015-Low-libcrmcommon-free-signal-triggers-when-cleaning-.patch
|
|
||||||
Patch16: 0016-Build-Makefile-build-and-clean-but-not-install-CTS-b.patch
|
|
||||||
Patch17: 0017-Refactor-libcrmcommon-avoid-new-as-variable-name.patch
|
|
||||||
Patch18: 0019-Build-cts-fix-autoconf-variable-substitution-in-the-.patch
|
|
||||||
# keep following commented out for now
|
|
||||||
#Patch100: bz1179335-system-wide-crypto-policies.patch
|
|
||||||
|
|
||||||
Provides: pcmk-cluster-manager
|
Provides: pcmk-cluster-manager
|
||||||
Requires: resource-agents
|
Requires: resource-agents
|
||||||
@ -196,7 +182,7 @@ BuildRequires: asciidoc inkscape publican
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
# git-style patch application
|
# git-style patch application
|
||||||
BuildRequires: git
|
#BuildRequires: git
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Pacemaker is an advanced, scalable High-Availability cluster resource
|
Pacemaker is an advanced, scalable High-Availability cluster resource
|
||||||
@ -321,6 +307,7 @@ manager.
|
|||||||
License: GPLv3
|
License: GPLv3
|
||||||
Summary: Pacemaker Nagios Metadata
|
Summary: Pacemaker Nagios Metadata
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
|
BuildArch: noarch
|
||||||
# NOTE below are the plugins this metadata uses.
|
# NOTE below are the plugins this metadata uses.
|
||||||
Requires: nagios-plugins-http
|
Requires: nagios-plugins-http
|
||||||
Requires: nagios-plugins-ldap
|
Requires: nagios-plugins-ldap
|
||||||
@ -335,9 +322,9 @@ monitor resources.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -a 1 -n %{name}-%{commit}
|
%setup -q -a 1 -n %{name}-%{commit}
|
||||||
%global __scm git_am
|
#global __scm git_am
|
||||||
%__scm_setup_git
|
#__scm_setup_git
|
||||||
%autopatch -p1
|
#autopatch -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
@ -361,11 +348,13 @@ export LDFLAGS_HARDENED_LIB="%{?_hardening_ldflags}"
|
|||||||
./autogen.sh
|
./autogen.sh
|
||||||
|
|
||||||
%{configure} \
|
%{configure} \
|
||||||
|
%{?python_path: PYTHON=%{python_path}} \
|
||||||
|
%{!?with_hardening: --disable-hardening} \
|
||||||
|
%{!?with_legacy_links: --disable-legacy-links} \
|
||||||
%{?with_profiling: --with-profiling} \
|
%{?with_profiling: --with-profiling} \
|
||||||
%{?with_coverage: --with-coverage} \
|
%{?with_coverage: --with-coverage} \
|
||||||
%{!?with_doc: --with-brand=} \
|
%{!?with_doc: --with-brand=} \
|
||||||
%{!?with_hardening: --disable-hardening} \
|
%{?gnutls_priorities: --with-gnutls-priorities="%{gnutls_priorities}"} \
|
||||||
%{?python_path: PYTHON=%{python_path}} \
|
|
||||||
--with-initdir=%{_initrddir} \
|
--with-initdir=%{_initrddir} \
|
||||||
--localstatedir=%{_var} \
|
--localstatedir=%{_var} \
|
||||||
--with-version=%{version}-%{release} \
|
--with-version=%{version}-%{release} \
|
||||||
@ -376,7 +365,7 @@ export LDFLAGS_HARDENED_LIB="%{?_hardening_ldflags}"
|
|||||||
make %{_smp_mflags} V=1 all
|
make %{_smp_mflags} V=1 all
|
||||||
|
|
||||||
%check
|
%check
|
||||||
{ cts/cts-pengine --run one-or-more-unrunnable-instances \
|
{ cts/cts-scheduler --run one-or-more-unrunnable-instances \
|
||||||
&& cts/cts-cli \
|
&& cts/cts-cli \
|
||||||
&& touch .CHECKED
|
&& touch .CHECKED
|
||||||
} 2>&1 | sed 's/[fF]ail/faiil/g' # prevent false positives in rpmlint
|
} 2>&1 | sed 's/[fF]ail/faiil/g' # prevent false positives in rpmlint
|
||||||
@ -386,7 +375,7 @@ make %{_smp_mflags} V=1 all
|
|||||||
make DESTDIR=%{buildroot} docdir=%{pcmk_docdir} V=1 install
|
make DESTDIR=%{buildroot} docdir=%{pcmk_docdir} V=1 install
|
||||||
|
|
||||||
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
|
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
|
||||||
install -m 644 mcp/pacemaker.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/pacemaker
|
install -m 644 daemons/pacemakerd/pacemaker.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/pacemaker
|
||||||
install -m 644 tools/crm_mon.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/crm_mon
|
install -m 644 tools/crm_mon.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/crm_mon
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_datadir}/pacemaker/nagios/plugins-metadata
|
mkdir -p %{buildroot}%{_datadir}/pacemaker/nagios/plugins-metadata
|
||||||
@ -405,7 +394,6 @@ find %{buildroot} -name '*.a' -type f -print0 | xargs -0 rm -f
|
|||||||
find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f
|
find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f
|
||||||
|
|
||||||
# Do not package these either
|
# Do not package these either
|
||||||
rm -f %{buildroot}/%{_libdir}/service_crm.so
|
|
||||||
rm -f %{buildroot}/%{_sbindir}/fence_legacy
|
rm -f %{buildroot}/%{_sbindir}/fence_legacy
|
||||||
rm -f %{buildroot}/%{_mandir}/man8/fence_legacy.*
|
rm -f %{buildroot}/%{_mandir}/man8/fence_legacy.*
|
||||||
find %{buildroot} -name 'o2cb*' -type f -print0 | xargs -0 rm -f
|
find %{buildroot} -name 'o2cb*' -type f -print0 | xargs -0 rm -f
|
||||||
@ -477,6 +465,15 @@ fi
|
|||||||
%postun cli
|
%postun cli
|
||||||
%systemd_postun_with_restart crm_mon.service
|
%systemd_postun_with_restart crm_mon.service
|
||||||
|
|
||||||
|
%post cts
|
||||||
|
%systemd_post pacemaker-cts-dummyd@.service
|
||||||
|
|
||||||
|
%preun cts
|
||||||
|
%systemd_preun pacemaker-cts-dummyd@.service
|
||||||
|
|
||||||
|
%postun cts
|
||||||
|
%systemd_postun_with_restart pacemaker-cts-dummyd@.service
|
||||||
|
|
||||||
%pre libs
|
%pre libs
|
||||||
# XXX keep an eye on https://fedoraproject.org/wiki/Changes/SystemdSysusers
|
# XXX keep an eye on https://fedoraproject.org/wiki/Changes/SystemdSysusers
|
||||||
# reopened recently:
|
# reopened recently:
|
||||||
@ -497,8 +494,11 @@ exit 0
|
|||||||
|
|
||||||
%exclude %{_datadir}/pacemaker/nagios/plugins-metadata/*
|
%exclude %{_datadir}/pacemaker/nagios/plugins-metadata/*
|
||||||
|
|
||||||
%exclude %{_libexecdir}/pacemaker/lrmd_test
|
%exclude %{_libexecdir}/pacemaker/cts-exec-helper
|
||||||
|
%exclude %{_sbindir}/pacemaker-remoted
|
||||||
|
%if %{with legacy_links}
|
||||||
%exclude %{_sbindir}/pacemaker_remoted
|
%exclude %{_sbindir}/pacemaker_remoted
|
||||||
|
%endif
|
||||||
%{_libexecdir}/pacemaker/*
|
%{_libexecdir}/pacemaker/*
|
||||||
|
|
||||||
%{_sbindir}/crm_attribute
|
%{_sbindir}/crm_attribute
|
||||||
@ -506,9 +506,9 @@ exit 0
|
|||||||
%{_sbindir}/crm_node
|
%{_sbindir}/crm_node
|
||||||
%{_sbindir}/stonith_admin
|
%{_sbindir}/stonith_admin
|
||||||
|
|
||||||
%doc %{_mandir}/man7/crmd.*
|
%doc %{_mandir}/man7/pacemaker-controld.*
|
||||||
%doc %{_mandir}/man7/pengine.*
|
%doc %{_mandir}/man7/pacemaker-schedulerd.*
|
||||||
%doc %{_mandir}/man7/stonithd.*
|
%doc %{_mandir}/man7/pacemaker-fenced.*
|
||||||
%doc %{_mandir}/man7/ocf_pacemaker_controld.*
|
%doc %{_mandir}/man7/ocf_pacemaker_controld.*
|
||||||
%doc %{_mandir}/man7/ocf_pacemaker_remote.*
|
%doc %{_mandir}/man7/ocf_pacemaker_remote.*
|
||||||
%doc %{_mandir}/man8/crm_attribute.*
|
%doc %{_mandir}/man8/crm_attribute.*
|
||||||
@ -554,7 +554,7 @@ exit 0
|
|||||||
%exclude %{_datadir}/pacemaker/tests
|
%exclude %{_datadir}/pacemaker/tests
|
||||||
%{_datadir}/pacemaker
|
%{_datadir}/pacemaker
|
||||||
%{_datadir}/snmp/mibs/PCMK-MIB.txt
|
%{_datadir}/snmp/mibs/PCMK-MIB.txt
|
||||||
%{_libexecdir}/pacemaker/lrmd_test
|
%{_libexecdir}/pacemaker/cts-exec-helper
|
||||||
|
|
||||||
%exclude /usr/lib/ocf/resource.d/pacemaker/controld
|
%exclude /usr/lib/ocf/resource.d/pacemaker/controld
|
||||||
%exclude /usr/lib/ocf/resource.d/pacemaker/o2cb
|
%exclude /usr/lib/ocf/resource.d/pacemaker/o2cb
|
||||||
@ -565,9 +565,9 @@ exit 0
|
|||||||
/usr/lib/ocf/resource.d/pacemaker
|
/usr/lib/ocf/resource.d/pacemaker
|
||||||
|
|
||||||
%doc %{_mandir}/man7/*
|
%doc %{_mandir}/man7/*
|
||||||
%exclude %{_mandir}/man7/crmd.*
|
%exclude %{_mandir}/man7/pacemaker-controld.*
|
||||||
%exclude %{_mandir}/man7/pengine.*
|
%exclude %{_mandir}/man7/pacemaker-schedulerd.*
|
||||||
%exclude %{_mandir}/man7/stonithd.*
|
%exclude %{_mandir}/man7/pacemaker-fenced.*
|
||||||
%exclude %{_mandir}/man7/ocf_pacemaker_controld.*
|
%exclude %{_mandir}/man7/ocf_pacemaker_controld.*
|
||||||
%exclude %{_mandir}/man7/ocf_pacemaker_o2cb.*
|
%exclude %{_mandir}/man7/ocf_pacemaker_o2cb.*
|
||||||
%exclude %{_mandir}/man7/ocf_pacemaker_remote.*
|
%exclude %{_mandir}/man7/ocf_pacemaker_remote.*
|
||||||
@ -577,7 +577,7 @@ exit 0
|
|||||||
%exclude %{_mandir}/man8/crm_master.*
|
%exclude %{_mandir}/man8/crm_master.*
|
||||||
%exclude %{_mandir}/man8/fence_legacy.*
|
%exclude %{_mandir}/man8/fence_legacy.*
|
||||||
%exclude %{_mandir}/man8/pacemakerd.*
|
%exclude %{_mandir}/man8/pacemakerd.*
|
||||||
%exclude %{_mandir}/man8/pacemaker_remoted.*
|
%exclude %{_mandir}/man8/pacemaker-remoted.*
|
||||||
%exclude %{_mandir}/man8/stonith_admin.*
|
%exclude %{_mandir}/man8/stonith_admin.*
|
||||||
|
|
||||||
%license licenses/GPLv2
|
%license licenses/GPLv2
|
||||||
@ -618,8 +618,11 @@ exit 0
|
|||||||
%ghost %dir %{_localstatedir}/lib/rpm-state/%{name}
|
%ghost %dir %{_localstatedir}/lib/rpm-state/%{name}
|
||||||
%{_unitdir}/pacemaker_remote.service
|
%{_unitdir}/pacemaker_remote.service
|
||||||
|
|
||||||
|
%{_sbindir}/pacemaker-remoted
|
||||||
|
%if %{with legacy_links}
|
||||||
%{_sbindir}/pacemaker_remoted
|
%{_sbindir}/pacemaker_remoted
|
||||||
%{_mandir}/man8/pacemaker_remoted.*
|
%endif
|
||||||
|
%{_mandir}/man8/pacemaker-remoted.*
|
||||||
%license licenses/GPLv2
|
%license licenses/GPLv2
|
||||||
%doc COPYING
|
%doc COPYING
|
||||||
%doc ChangeLog
|
%doc ChangeLog
|
||||||
@ -631,6 +634,7 @@ exit 0
|
|||||||
%files cts
|
%files cts
|
||||||
%{py_site}/cts
|
%{py_site}/cts
|
||||||
%{_datadir}/pacemaker/tests
|
%{_datadir}/pacemaker/tests
|
||||||
|
%{_unitdir}/pacemaker-cts-dummyd@.service
|
||||||
%license licenses/GPLv2
|
%license licenses/GPLv2
|
||||||
%doc COPYING
|
%doc COPYING
|
||||||
%doc ChangeLog
|
%doc ChangeLog
|
||||||
@ -652,6 +656,22 @@ exit 0
|
|||||||
%license %{nagios_name}-%{nagios_hash}/COPYING
|
%license %{nagios_name}-%{nagios_hash}/COPYING
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed May 02 2018 Jan Pokorný <jpokorny+rpm-pacemaker@redhat.com> - 2.0.0-0.1.rc3
|
||||||
|
- Update for new upstream tarball for release candidate: Pacemaker-2.0.0-rc3,
|
||||||
|
for full details, see included ChangeLog file or
|
||||||
|
https://github.com/ClusterLabs/pacemaker/releases/tag/Pacemaker-2.0.0-rc3
|
||||||
|
- Adapt spec file more akin to upstream version including:
|
||||||
|
. new --without legacy_links conditional (c8a7e5225)
|
||||||
|
. reflect name change of the auxiliary daemons
|
||||||
|
(e4f4a0d64, db5536e40, e2fdc2bac + 9ecbfea1c, 038c465e2 + ed8ce4055a)
|
||||||
|
. new dummy systemd service for -cts (bf0a22812)
|
||||||
|
. honor system-wide crypto policies once for all, via package-build-time
|
||||||
|
configurable "pcmk_gnutls_priorities" defaulting to @SYSTEM as prescribed
|
||||||
|
in https://fedoraproject.org/wiki/Packaging:CryptoPolicies
|
||||||
|
(based on b3dfce1d3)
|
||||||
|
- Adapt spec file akin to current packaging guidelines including:
|
||||||
|
. make -nagios-plugins-metadata package noarch
|
||||||
|
|
||||||
* Mon Apr 09 2018 Jan Pokorný <jpokorny+rpm-pacemaker@redhat.com> - 2.0.0-0.1.rc2
|
* Mon Apr 09 2018 Jan Pokorný <jpokorny+rpm-pacemaker@redhat.com> - 2.0.0-0.1.rc2
|
||||||
- Update for new upstream tarball for release candidate: Pacemaker-2.0.0-rc2,
|
- Update for new upstream tarball for release candidate: Pacemaker-2.0.0-rc2,
|
||||||
for full details, see included ChangeLog file or
|
for full details, see included ChangeLog file or
|
||||||
|
2
sources
2
sources
@ -1,2 +1,2 @@
|
|||||||
SHA512 (pacemaker-2.0.0-rc2.tar.gz) = f090f5bbe547c016f088d771d1969aaa771de417262786c493b5d6b39369e04655e29325084f7c1d481e0eaec64ffbab2b9ae6a74970bd61f5ec7fca0814d93c
|
SHA512 (pacemaker-2.0.0-rc3.tar.gz) = 4dee3c58d0f2d90c0133ff9c101bfcf563df41d64f5669a72163d85bb6a6db4d70709fd8f08cc07a37dc2e2a77cca133f99104cb67dae57daa354e9174e91c0f
|
||||||
SHA512 (nagios-agents-metadata-105ab8a7b2c16b9a29cf1c1596b80136eeef332b.tar.gz) = 11ddeb48a4929e7642b6dfa9c7962aa1d7a1af1c569830f55ed6cd6773abac13377317327bc1db8411c8077884f83f81cc54d746c834b63a99fa6dc219b5caad
|
SHA512 (nagios-agents-metadata-105ab8a7b2c16b9a29cf1c1596b80136eeef332b.tar.gz) = 11ddeb48a4929e7642b6dfa9c7962aa1d7a1af1c569830f55ed6cd6773abac13377317327bc1db8411c8077884f83f81cc54d746c834b63a99fa6dc219b5caad
|
||||||
|
Loading…
Reference in New Issue
Block a user