Sync from SUSE:SLFO:Main pacemaker revision ce702f3c27a469e4cb26c2dd03742af1

This commit is contained in:
Adrian Schröter 2024-05-03 17:38:16 +02:00
commit 53cc6c27bf
18 changed files with 10758 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

24
_service Normal file
View File

@ -0,0 +1,24 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://github.com/ClusterLabs/pacemaker.git</param>
<param name="package-meta">no</param>
<param name="exclude">.git</param>
<!--
To update to a new release, change "revision" to the desired
git commit hash and bump "version" if necessary
<param name="version">2.1.7</param>
-->
<param name="versionformat">2.1.7+%cd.%h</param>
<param name="revision">Pacemaker-2.1.7</param>
<param name="changesgenerate">enable</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*pacemaker*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled"/>
</services>

8
_servicedata Normal file
View File

@ -0,0 +1,8 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://github.com/ClusterLabs/pacemaker.git</param>
<param name="changesrevision">022ae2d5fa54b0b213595be31a90424f021f5b71</param>
</service>
<service name="tar_scm">
<param name="url">https://github.com/ClusterLabs/pacemaker.git</param>
<param name="changesrevision">0f7f88312f7a1ccedee60bf768aba79ee13d41e0</param></service></servicedata>

View File

@ -0,0 +1,26 @@
From d26a6ad01bd046e318dd3ca4512bcf09f8bf9568 Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Fri, 29 Jan 2021 13:32:23 +0100
Subject: [PATCH] Log: pacemakerd: downgrade the warning about
SBD_SYNC_RESOURCE_STARTUP to notice
---
daemons/pacemakerd/pacemakerd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemons/pacemakerd/pacemakerd.c b/daemons/pacemakerd/pacemakerd.c
index 509b0f824..157df72ad 100644
--- a/daemons/pacemakerd/pacemakerd.c
+++ b/daemons/pacemakerd/pacemakerd.c
@@ -1325,7 +1325,7 @@ main(int argc, char **argv)
startup_trigger = mainloop_add_trigger(G_PRIORITY_HIGH, init_children_processes, NULL);
} else {
if (running_with_sbd) {
- crm_warn("Enabling SBD_SYNC_RESOURCE_STARTUP would (if supported "
+ crm_notice("Enabling SBD_SYNC_RESOURCE_STARTUP would (if supported "
"by your SBD version) improve reliability of "
"interworking between SBD & pacemaker.");
}
--
2.26.2

View File

@ -0,0 +1,100 @@
commit 1e01228825eb8d4449edfbb1a1fa0c38fab4d5e6
Author: Gao,Yan <ygao@suse.com>
Date: Thu Sep 6 15:14:58 2012 +0800
Medium: stonith: Expose IDs of stonith resources to stonith agents through "$CRM_meta_st_device_id" environment variable
Index: pacemaker-2.1.4+20220928.4690461db/daemons/fenced/fenced_commands.c
===================================================================
--- pacemaker-2.1.4+20220928.4690461db.orig/daemons/fenced/fenced_commands.c
+++ pacemaker-2.1.4+20220928.4690461db/daemons/fenced/fenced_commands.c
@@ -1096,6 +1096,7 @@ build_device_from_xml(xmlNode *dev)
(const char *) device->on_target_actions->str);
}
+ g_hash_table_insert(device->params, strdup(CRM_META "_" F_STONITH_DEVICE), strdup(device->id));
device->work = mainloop_add_trigger(G_PRIORITY_HIGH, stonith_device_dispatch, device);
/* TODO: Hook up priority */
Index: pacemaker-2.1.4+20220928.4690461db/lib/fencing/st_actions.c
===================================================================
--- pacemaker-2.1.4+20220928.4690461db.orig/lib/fencing/st_actions.c
+++ pacemaker-2.1.4+20220928.4690461db/lib/fencing/st_actions.c
@@ -31,6 +31,7 @@ struct stonith_action_s {
char *agent;
char *action;
GHashTable *args;
+ char *dev_id;
int timeout;
bool async;
void *userdata;
@@ -226,6 +227,7 @@ stonith__destroy_action(stonith_action_t
services_action_free(action->svc_action);
}
pcmk__reset_result(&(action->result));
+ free(action->dev_id);
free(action);
}
}
@@ -286,6 +288,8 @@ stonith__action_create(const char *agent
if (device_args) {
char buffer[512];
const char *value = NULL;
+ const char *st_dev_id_key = CRM_META "_" F_STONITH_DEVICE;
+ const char *st_dev_id_value = NULL;
snprintf(buffer, sizeof(buffer), "pcmk_%s_retries", action_name);
value = g_hash_table_lookup(device_args, buffer);
@@ -293,6 +297,11 @@ stonith__action_create(const char *agent
if (value) {
action->max_retries = atoi(value);
}
+
+ st_dev_id_value = g_hash_table_lookup(device_args, st_dev_id_key);
+ if (st_dev_id_value) {
+ action->dev_id = strdup(st_dev_id_value);
+ }
}
return action;
@@ -630,6 +639,10 @@ internal_stonith_action_execute(stonith_
SVC_ACTION_NON_BLOCKED,
"SVC_ACTION_NON_BLOCKED");
+ if (action->dev_id) {
+ svc_action->rsc = strdup(action->dev_id);
+ }
+
/* keep retries from executing out of control and free previous results */
if (is_retry) {
pcmk__reset_result(&(action->result));
Index: pacemaker-2.1.4+20220928.4690461db/lib/services/services_linux.c
===================================================================
--- pacemaker-2.1.4+20220928.4690461db.orig/lib/services/services_linux.c
+++ pacemaker-2.1.4+20220928.4690461db/lib/services/services_linux.c
@@ -29,6 +29,9 @@
#include "crm/services.h"
#include "crm/services_internal.h"
+#include "crm/stonith-ng.h"
+#include "crm/fencing/internal.h"
+
#include "services_private.h"
static void close_pipe(int fildes[]);
@@ -406,6 +409,15 @@ static void
add_action_env_vars(const svc_action_t *op)
{
void (*env_setter)(gpointer, gpointer, gpointer) = NULL;
+
+ if (pcmk__str_eq(op->standard, PCMK_RESOURCE_CLASS_STONITH, pcmk__str_casei)
+ && pcmk__str_eq(op->agent, "fence_legacy", pcmk__str_casei)
+ && op->rsc != NULL) {
+ const char *st_dev_id_key = CRM_META "_" F_STONITH_DEVICE;
+
+ setenv(st_dev_id_key, op->rsc, 1);
+ }
+
if (op->agent == NULL) {
env_setter = set_alert_env; /* we deal with alert handler */

View File

@ -0,0 +1,45 @@
commit b802c689cdad03a185c5c6689741e2a4db8d5924
Author: Gao,Yan <ygao@suse.com>
Date: Thu Mar 14 09:41:53 2013 +0800
Log: Change some messages to notice level (bnc#806256)
Index: pacemaker-2.1.6+20230821.d00694366/daemons/controld/controld_membership.c
===================================================================
--- pacemaker-2.1.6+20230821.d00694366.orig/daemons/controld/controld_membership.c
+++ pacemaker-2.1.6+20230821.d00694366/daemons/controld/controld_membership.c
@@ -435,7 +435,7 @@ crm_update_quorum(gboolean quorum, gbool
crm_xml_add_int(update, XML_ATTR_HAVE_QUORUM, quorum);
crm_xml_add(update, XML_ATTR_DC_UUID, controld_globals.our_uuid);
- crm_debug("Updating quorum status to %s", pcmk__btoa(quorum));
+ crm_notice("Updating quorum status to %s", pcmk__btoa(quorum));
controld_update_cib(XML_TAG_CIB, update, cib_scope_local,
cib_quorum_update_complete);
free_xml(update);
Index: pacemaker-2.1.6+20230821.d00694366/daemons/controld/controld_transition.c
===================================================================
--- pacemaker-2.1.6+20230821.d00694366.orig/daemons/controld/controld_transition.c
+++ pacemaker-2.1.6+20230821.d00694366/daemons/controld/controld_transition.c
@@ -171,7 +171,7 @@ do_te_invoke(long long action,
CRM_CHECK(controld_globals.transition_graph != NULL,
controld_globals.transition_graph = create_blank_graph();
return);
- crm_info("Processing graph %d (ref=%s) derived from %s",
+ crm_notice("Processing graph %d (ref=%s) derived from %s",
controld_globals.transition_graph->id, ref, graph_input);
te_reset_job_counts();
Index: pacemaker-2.1.6+20230821.d00694366/daemons/fenced/fenced_remote.c
===================================================================
--- pacemaker-2.1.6+20230821.d00694366.orig/daemons/fenced/fenced_remote.c
+++ pacemaker-2.1.6+20230821.d00694366/daemons/fenced/fenced_remote.c
@@ -695,7 +695,7 @@ remote_op_timeout_one(gpointer userdata)
static void
finalize_timed_out_op(remote_fencing_op_t *op, const char *reason)
{
- crm_debug("Action '%s' targeting %s for client %s timed out "
+ crm_notice("Action '%s' targeting %s for client %s timed out "
CRM_XS " id=%.8s",
op->action, op->target, op->client_name, op->id);

View File

@ -0,0 +1,32 @@
commit 907b91e7154d57f091af547aa2179e1433bc69eb
Author: Gao,Yan <ygao@suse.com>
Date: Thu Apr 18 16:00:02 2013 +0800
Log: fencing: Drop the severity of the messages on registering a stonith device
Index: pacemaker-2.1.6+20231030.66cc0f083/daemons/fenced/fenced_commands.c
===================================================================
--- pacemaker-2.1.6+20231030.66cc0f083.orig/daemons/fenced/fenced_commands.c
+++ pacemaker-2.1.6+20231030.66cc0f083/daemons/fenced/fenced_commands.c
@@ -1465,7 +1465,7 @@ stonith_device_register(xmlNode *dev, gb
g_hash_table_replace(device_list, device->id, device);
ndevices = g_hash_table_size(device_list);
- crm_notice("Added '%s' to device list (%d active device%s)",
+ crm_info("Added '%s' to device list (%d active device%s)",
device->id, ndevices, pcmk__plural_s(ndevices));
}
Index: pacemaker-2.1.6+20231030.66cc0f083/daemons/fenced/fenced_cib.c
===================================================================
--- pacemaker-2.1.6+20231030.66cc0f083.orig/daemons/fenced/fenced_cib.c
+++ pacemaker-2.1.6+20231030.66cc0f083/daemons/fenced/fenced_cib.c
@@ -618,7 +618,7 @@ update_cib_cache_cb(const char *event, x
break;
case -pcmk_err_diff_resync:
case -pcmk_err_diff_failed:
- crm_notice("[%s] Patch aborted: %s (%d)", event, pcmk_strerror(rc), rc);
+ crm_info("[%s] Patch aborted: %s (%d)", event, pcmk_strerror(rc), rc);
free_xml(local_cib);
local_cib = NULL;
break;

View File

@ -0,0 +1,22 @@
Index: pacemaker-2.1.6+20230821.d00694366/daemons/execd/execd_commands.c
===================================================================
--- pacemaker-2.1.6+20230821.d00694366.orig/daemons/execd/execd_commands.c
+++ pacemaker-2.1.6+20230821.d00694366/daemons/execd/execd_commands.c
@@ -210,7 +210,7 @@ action_matches(const lrmd_cmd_t *cmd, co
static void
log_finished(const lrmd_cmd_t *cmd, int exec_time_ms, int queue_time_ms)
{
- int log_level = LOG_INFO;
+ int log_level = LOG_NOTICE;
GString *str = g_string_sized_new(100); // reasonable starting size
if (pcmk__str_eq(cmd->action, PCMK_ACTION_MONITOR, pcmk__str_casei)) {
@@ -251,7 +251,7 @@ log_finished(const lrmd_cmd_t *cmd, int
static void
log_execute(lrmd_cmd_t * cmd)
{
- int log_level = LOG_INFO;
+ int log_level = LOG_NOTICE;
if (pcmk__str_eq(cmd->action, PCMK_ACTION_MONITOR, pcmk__str_casei)) {
log_level = LOG_DEBUG;

View File

@ -0,0 +1,21 @@
commit c199dc320b4faa01c19df68a9f2566465f5afa2c
Author: Gao,Yan <ygao@suse.com>
Date: Mon Jun 13 17:26:27 2016 +0200
Fix: controld: Prevent unwanted self-fencing if "stateful_merge_wait" state of dlm is not available
Index: pacemaker-2.0.2+20190725.4b4fea3eb/agents/ocf/controld.in
===================================================================
--- pacemaker-2.0.2+20190725.4b4fea3eb.orig/agents/ocf/controld.in
+++ pacemaker-2.0.2+20190725.4b4fea3eb/agents/ocf/controld.in
@@ -226,10 +226,6 @@ controld_monitor() {
if [ -n "$smw" ] && [ $smw -eq 1 ]; then
ocf_log err "DLM status is: stateful_merge_wait"
CM_RC=$OCF_ERR_GENERIC
- elif [ -z "$smw" ] && dlm_tool ls | grep -q "wait fencing" && \
- ! stonith_admin -H '*' --output-as xml | grep -q "extended-status=\"pending\""; then
- ocf_log err "DLM status is: wait fencing"
- CM_RC=$OCF_ERR_GENERIC
else
CM_RC=$OCF_SUCCESS
fi

View File

@ -0,0 +1,20 @@
Index: pacemaker-2.1.6+20231030.66cc0f083/python/pacemaker/_cts/audits.py
===================================================================
--- pacemaker-2.1.6+20231030.66cc0f083.orig/python/pacemaker/_cts/audits.py
+++ pacemaker-2.1.6+20231030.66cc0f083/python/pacemaker/_cts/audits.py
@@ -80,13 +80,9 @@ class LogAudit(ClusterAudit):
for node in nodes:
if self._cm.env["have_systemd"]:
- (rc, _) = self._cm.rsh(node, "systemctl stop systemd-journald.socket")
+ (rc, _) = self._cm.rsh(node, "systemctl restart systemd-journald.socket")
if rc != 0:
- self._cm.log("ERROR: Cannot stop 'systemd-journald' on %s" % node)
-
- (rc, _) = self._cm.rsh(node, "systemctl start systemd-journald.service")
- if rc != 0:
- self._cm.log("ERROR: Cannot start 'systemd-journald' on %s" % node)
+ self._cm.log("ERROR: Cannot restart 'systemd-journald' on %s" % node)
(rc, _) = self._cm.rsh(node, "service %s restart" % self._cm.env["syslogd"])
if rc != 0:

23
crm_report.in Normal file
View File

@ -0,0 +1,23 @@
#!/bin/sh
#
# Copyright (C) 2007 Dejan Muhamedagic <dmuhamedagic@suse.com>
# Copyright (C) 2015 Kristoffer Gronlund <kgronlund@suse.com>
# Copyright (C) 2015 Gao,Yan <ygao@suse.com>
#
# Replaced with crm report
PARENT_COMMAND="$(ps -o comm= $PPID)"
PROG="$(basename "$0")"
die() {
echo "$PROG: $*"
exit 1
}
[ "$(basename "$PARENT_COMMAND")" = "crm" ] && die "called itself in a loop, aborting"
if which crm > /dev/null 2>&1; then
crm report "$@"
elif [ -x /usr/sbin/crm ]; then
/usr/sbin/crm report "$@"
else
#die "crm_report has been deprecated: Please install crmsh, which replaces it"
/usr/sbin/crm_report.pacemaker "$@"
fi

BIN
pacemaker-2.1.7+20231219.0f7f88312.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,17 @@
Index: pacemaker-2.1.4+20220825.b676a8701/configure.ac
===================================================================
--- pacemaker-2.1.4+20220825.b676a8701.orig/configure.ac
+++ pacemaker-2.1.4+20220825.b676a8701/configure.ac
@@ -1778,10 +1778,10 @@ dnl otherwise none of both
[
AC_DEFINE([HAVE_FORMAT_NONLITERAL], [],
[gcc can complain about nonliterals in format])
- EXTRA_FLAGS="$EXTRA_FLAGS -Wformat=2 -Wformat-nonliteral"
+ EXTRA_FLAGS="$EXTRA_FLAGS -Wformat=2 -Wformat-nonliteral -Wno-format-signedness"
],
[test x"$gcc_format_nonliteral" = x"yes"],
- [EXTRA_FLAGS="$EXTRA_FLAGS -Wformat=2"])
+ [EXTRA_FLAGS="$EXTRA_FLAGS -Wformat=2 -Wno-format-signedness"])
# Additional warnings it might be nice to enable one day
# -Wshadow

View File

@ -0,0 +1,13 @@
Index: pacemaker-2.1.5+20230309.a4b0ea1b5/python/pacemaker/_cts/patterns.py
===================================================================
--- pacemaker-2.1.5+20230309.a4b0ea1b5.orig/python/pacemaker/_cts/patterns.py
+++ pacemaker-2.1.5+20230309.a4b0ea1b5/python/pacemaker/_cts/patterns.py
@@ -135,7 +135,7 @@ class Corosync2Patterns(BasePatterns):
self._name = "crm-corosync"
self._commands.update({
- "StartCmd" : "service corosync start && service pacemaker start",
+ "StartCmd" : "service pacemaker start",
"StopCmd" : "service pacemaker stop; [ ! -e /usr/sbin/pacemaker-remoted ] || service pacemaker_remote stop; service corosync stop",
"EpochCmd" : "crm_node -e",

View File

@ -0,0 +1,19 @@
commit f813880dd1b6d1614393128a7f5f745437bea121
Author: Gao,Yan <ygao@suse.com>
Date: Wed Mar 27 22:03:56 2013 +0800
Build: lrmd: Change the default directory for nagios plugins
Index: pacemaker-2.1.4+20220720.3b57f9b58/configure.ac
===================================================================
--- pacemaker-2.1.4+20220720.3b57f9b58.orig/configure.ac
+++ pacemaker-2.1.4+20220720.3b57f9b58/configure.ac
@@ -1523,7 +1523,7 @@ AC_DEFINE_UNQUOTED([SUPPORT_NAGIOS], [$w
AM_CONDITIONAL([BUILD_NAGIOS], [test $with_nagios -eq $REQUIRED])
AS_IF([test x"$NAGIOS_PLUGIN_DIR" = x""],
- [NAGIOS_PLUGIN_DIR="${libexecdir}/nagios/plugins"])
+ [NAGIOS_PLUGIN_DIR="${prefix}/lib/nagios/plugins"])
AC_DEFINE_UNQUOTED(NAGIOS_PLUGIN_DIR, "$NAGIOS_PLUGIN_DIR", Directory for nagios plugins)
AC_SUBST(NAGIOS_PLUGIN_DIR)

9584
pacemaker.changes Normal file

File diff suppressed because it is too large Load Diff

4
pacemaker.rpmlintrc Normal file
View File

@ -0,0 +1,4 @@
addFilter("script-without-shebang /usr/share/pacemaker/.*\.rng")
addFilter("script-without-shebang /usr/share/pacemaker/.*\.dtd")
addFilter("script-without-shebang /usr/share/pacemaker/.*\.xsl")
addFilter("non-executable-script /usr/share/pacemaker/cts/")

774
pacemaker.spec Normal file
View File

@ -0,0 +1,774 @@
#
# spec file for package pacemaker
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# User-configurable globals and defines to control package behavior
# (these should not test {with X} values, which are declared later)
## User and group to use for nonprivileged services
%global uname hacluster
%global gname haclient
## Where to install Pacemaker documentation
%global pcmk_docdir %{_docdir}/%{name}
## Where bug reports should be submitted
## Leave bug_url undefined to use ClusterLabs default, others define it here
## What to use as the OCF resource agent root directory
%global ocf_root %{_prefix}/lib/ocf
# Define conditionals so that "rpmbuild --with <feature>" and
# "rpmbuild --without <feature>" can enable and disable specific features
## Add option to enable support for stonith/external fencing agents
%bcond_without stonithd
## Add option to enable support for storing sensitive information outside CIB
%bcond_without cibsecrets
## Add option to enable Native Language Support (experimental)
%bcond_with nls
## Add option to create binaries suitable for use with profiling tools
%bcond_with profiling
## Allow deprecated option to skip or enable documentation
%bcond_with doc
## Add option to default to start-up synchronization with SBD.
##
## If enabled, SBD *MUST* be built to default similarly, otherwise data
## corruption could occur. Building both Pacemaker and SBD to default
## to synchronization improves safety, without requiring higher-level tools
## to be aware of the setting or requiring users to modify configurations
## after upgrading to versions that support synchronization.
%if 0%{?suse_version} >= 1540 || 0%{?sle_version} >= 150400
%bcond_without sbd_sync
%else
%bcond_with sbd_sync
%endif
## Add option to turn off hardening of libraries and daemon executables
%bcond_with hardening
## Add option to disable links for legacy daemon names
%if 0%{?suse_version} < 1600
%bcond_without legacy_links
%else
%bcond_with legacy_links
%endif
# Define globals for convenient use later
%if 0%{?suse_version} >= 1560 || 0%{?sle_version} >= 150600
## 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}
%endif
%global hacluster_id 90
## Distro-specific configuration choices
### Use 2.0-style output when other distro packages don't support current output
%if 0%{?suse_version} < 1600
%global compat20 --enable-compat-2.0
%endif
### Default concurrent-fencing to true when distro prefers that
%if 0%{?suse_version} >= 1540 || 0%{?sle_version} >= 150400
%global concurrent_fencing --with-concurrent-fencing-default=true
%endif
### Default resource-stickiness to 1 when distro prefers that
%if 0%{?suse_version} >= 1540 || 0%{?sle_version} >= 150400
%global resource_stickiness --with-resource-stickiness-default=1
%endif
# Python-related definitions
## Prefer Python 3 definitions explicitly, in case 2 is also available
%global python_path %{__python3}
# Keep sane profiling data if requested
%if %{with profiling}
## Disable -debuginfo package and stripping binaries/libraries
%define debug_package %{nil}
%endif
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
%if 0%{?suse_version} < 1600
%define with_nagios 1
%else
%define with_nagios 0
%endif
%define enable_cluster_libs_pkg 0
%define enable_fatal_warnings 0
%define with_regression_tests 0
Name: pacemaker
Version: 2.1.7+20231219.0f7f88312
Release: 0
Summary: Scalable High-Availability cluster resource manager
# AGPL-3.0 licensed extra/clustermon.sh is not present in the binary
License: GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later
Group: Productivity/Clustering/HA
URL: https://www.clusterlabs.org/
Source0: %{name}-%{version}.tar.xz
Source1: crm_report.in
Source100: pacemaker.rpmlintrc
Patch1: bug-806256_pacemaker-log-level-notice.patch
Patch2: bug-728579_pacemaker-stonith-dev-id.patch
Patch3: pacemaker-nagios-plugin-dir.patch
Patch4: bug-812269_pacemaker-fencing-device-register-messages.patch
Patch5: pacemaker-Wno-format-signedness.patch
Patch6: bug-943295_pacemaker-lrmd-log-notice.patch
Patch7: bug-977201_pacemaker-controld-self-fencing.patch
Patch8: bug-995365_pacemaker-cts-restart-systemd-journald.patch
Patch9: pacemaker-cts-StartCmd.patch
Patch10: bsc#1180966-0001-Log-pacemakerd-downgrade-the-warning-about-SBD_SYNC_.patch
# Required basic build tools
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: coreutils
BuildRequires: fdupes
BuildRequires: findutils
BuildRequires: gcc
BuildRequires: gettext-tools >= 0.18
BuildRequires: grep
BuildRequires: help2man
BuildRequires: libtool
BuildRequires: make
BuildRequires: pam-devel
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: python3-setuptools
# Required for agent_config.h which specifies the correct scratch directory
BuildRequires: resource-agents
BuildRequires: sed
BuildRequires: pkgconfig(bzip2)
# Required for "make check"
BuildRequires: pkgconfig(cmocka) >= 1.1.0
BuildRequires: pkgconfig(corosync) >= 2.0.0
BuildRequires: pkgconfig(dbus-1)
# Required for core functionality
BuildRequires: pkgconfig(glib-2.0) >= 2.42
BuildRequires: pkgconfig(gnutls)
# Pacemaker requires a minimum libqb functionality
BuildRequires: pkgconfig(libqb) >= 0.17.0
BuildRequires: pkgconfig(libxml-2.0) >= 2.6.0
BuildRequires: pkgconfig(libxslt)
BuildRequires: pkgconfig(ncurses)
# Pacemaker requires a minimum Python functionality
BuildRequires: pkgconfig(python3)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(uuid)
Requires: %{name}-cli = %{version}-%{release}
%if %{enable_cluster_libs_pkg}
Requires: %{name}-cluster-libs = %{version}-%{release}
%endif
Requires: %{name}-libs = %{version}-%{release}
Requires: corosync >= 2.0.0
Requires: python3
Requires: python3-%{name} = %{version}-%{release}
Requires: resource-agents
Recommends: crmsh
Recommends: fence-agents
Recommends: libdlm
Recommends: sbd
Suggests: graphviz
Conflicts: heartbeat < 3.0
Conflicts: libheartbeat2 < 3.0.0
# Booth requires this
Provides: pacemaker-ticket-support = 2.0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires}
# Enables optional functionality
%if 0%{?suse_version} > 1100
BuildRequires: docbook-xsl-stylesheets
%else
BuildRequires: docbook-style-xsl
%endif
%if %{with stonithd}
%if 0%{?suse_version}
BuildRequires: cluster-glue-devel
%else
BuildRequires: cluster-glue-libs-devel
%endif
%endif
%if %{with doc}
BuildRequires: asciidoc
BuildRequires: inkscape
BuildRequires: python3-sphinx
%endif
%if %{with_regression_tests}
BuildRequires: procps
BuildRequires: python3-curses
BuildRequires: python3-xml
%endif
%description
Pacemaker is an advanced, scalable High-Availability cluster resource
manager.
It supports more than 16 node clusters with significant capabilities
for managing resources and dependencies.
It will run scripts at initialization, when machines go up or down,
when related resources fail and can be configured to periodically check
resource health.
%package cli
Summary: Command line tools for controlling Pacemaker clusters
Group: Productivity/Clustering/HA
Requires: %{name}-libs = %{version}-%{release}
Requires: logrotate
Requires: perl-TimeDate
Requires: procps
Requires: psmisc
Requires(post): coreutils
# For crm_report
Recommends: tar
Recommends: bzip2
%description cli
Pacemaker is an advanced, scalable High-Availability cluster resource
manager.
The %{name}-cli package contains command line tools that can be used
to query and control the cluster from machines that may, or may not,
be part of the cluster.
%package libs
Summary: Core Pacemaker libraries
Group: System/Libraries
Requires(pre): shadow
Requires: %{name}-schemas = %{version}-%{release}
# sbd 1.4.0+ supports the libpe_status API for pe_working_set_t
# sbd 1.4.2+ supports startup/shutdown handshake via pacemakerd-api
# and handshake defaults to enabled for rhel builds
# sbd 1.5.1+ handshake defaults to enabled with upstream sbd-release
# implicitly supports handshake defaults to enabled in this spec
Conflicts: sbd < 1.5.1
Provides: libpacemaker3 = %version-%release
Obsoletes: libpacemaker3 < %version-%release
%description libs
Pacemaker is an advanced, scalable High-Availability cluster resource
manager.
The %{name}-libs package contains shared libraries needed for cluster
nodes and those just running the CLI tools.
%package cluster-libs
Summary: Cluster Libraries used by Pacemaker
Group: System/Libraries
Requires: %{name}-libs = %{version}-%{release}
%description cluster-libs
Pacemaker is an advanced, scalable High-Availability cluster resource
manager.
The %{name}-cluster-libs package contains cluster-aware shared
libraries needed for nodes that will form part of the cluster nodes.
%package -n python3-%{name}
Summary: Python libraries for Pacemaker
Requires: %{name}-libs = %{version}-%{release}
Requires: python3
BuildArch: noarch
%description -n python3-%{name}
Pacemaker is an advanced, scalable High-Availability cluster resource
manager.
The python3-%{name} package contains a Python library that can be used
to interface with Pacemaker.
%package remote
Summary: Pacemaker remote executor daemon for non-cluster nodes
Group: Productivity/Clustering/HA
Requires: %{name}-cli = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Requires: resource-agents
%{?systemd_requires}
%description remote
Pacemaker is an advanced, scalable High-Availability cluster resource
manager.
The %{name}-remote package contains the Pacemaker Remote daemon
which is capable of extending pacemaker functionality to remote
nodes not running the full corosync/cluster stack.
%package devel
Summary: Pacemaker development package
Group: Development/Libraries/C and C++
Requires: %{name}-libs = %{version}-%{release}
Requires: libtool-ltdl-devel
Requires: pkgconfig
Requires: pkgconfig(bzip2)
Requires: pkgconfig(corosync) >= 2.0.0
Requires: pkgconfig(glib-2.0)
Requires: pkgconfig(libqb)
Requires: pkgconfig(libxml-2.0) >= 2.6.0
Requires: pkgconfig(libxslt)
Requires: pkgconfig(uuid)
%if %{enable_cluster_libs_pkg}
Requires: %{name}-cluster-libs = %{version}-%{release}
%endif
%if %{with_regression_tests}
# For the regression tests, we can run them only if all pacemaker
# packages are installed, so we pull that in here for the regression
# builds; this is supposed to be disabled for shipping code.
Requires: pacemaker
%endif
Provides: libpacemaker-devel = %version-%release
Obsoletes: libpacemaker-devel < %version-%release
%description devel
Pacemaker is an advanced, scalable High-Availability cluster resource
manager.
The %{name}-devel package contains headers and shared libraries
for developing tools for Pacemaker.
%package cts
Summary: Test framework for cluster-related technologies
Group: Productivity/Clustering/HA
Requires: %{name} = %{version}-%{release}
Requires: procps
Requires: psmisc
Requires: python3
Requires: python3-%{name} = %{version}-%{release}
Requires: python3-psutil
BuildArch: noarch
#Requires: python3-systemd
Recommends: python3-systemd
%description cts
Test framework for cluster-related technologies like Pacemaker
%package doc
Summary: Documentation for Pacemaker
Group: Productivity/Clustering/HA
BuildArch: noarch
%description doc
Documentation for Pacemaker.
Pacemaker is an advanced, scalable High-Availability cluster resource
manager.
%package schemas
Summary: Schemas and upgrade stylesheets for Pacemaker
Group: Productivity/Clustering/HA
BuildArch: noarch
%description schemas
Schemas and upgrade stylesheets for Pacemaker
Pacemaker is an advanced, scalable High-Availability cluster resource
manager
%prep
%autosetup -p1
%build
export systemdsystemunitdir=%{?_unitdir}%{!?_unitdir:no}
%if %{with hardening}
# prefer distro-provided hardening flags in case they are defined
# through _hardening_{c,ld}flags macros, configure script will
# use its own defaults otherwise; if such hardenings are completely
# undesired, rpmbuild using "--without hardening"
# (or "--define '_without_hardening 1'")
export CFLAGS_HARDENED_EXE="%{?_hardening_cflags}"
export CFLAGS_HARDENED_LIB="%{?_hardening_cflags}"
export LDFLAGS_HARDENED_EXE="%{?_hardening_ldflags}"
export LDFLAGS_HARDENED_LIB="%{?_hardening_ldflags}"
%endif
mkdir -p libltdl/config
autoreconf -fvi
%configure \
--docdir=%{_docdir}/%{name} \
--disable-silent-rules \
%if %{with_nagios}
--with-nagios=true \
%else
--with-nagios=false \
%endif
%if !%{enable_fatal_warnings}
--enable-fatal-warnings=no \
%endif
PYTHON=%{python_path} \
%{!?with_hardening: --disable-hardening} \
%{?with_legacy_links: --enable-legacy-links} \
%{?with_profiling: --with-profiling} \
%{?with_cibsecrets: --with-cibsecrets} \
%{?with_nls: --enable-nls} \
%{?with_sbd_sync: --with-sbd-sync-default="true"} \
%{?gnutls_priorities: --with-gnutls-priorities="%{gnutls_priorities}"} \
%{?bug_url: --with-bug-url=%{bug_url}} \
%{?ocf_root: --with-ocfdir=%{ocf_root}} \
%{?concurrent_fencing} \
%{?resource_stickiness} \
%{?compat20} \
--disable-static \
--with-initdir=%{_initddir} \
--with-runstatedir=%{_rundir} \
--localstatedir=%{_var} \
--with-version=%{version}-%{release}
make %{?_smp_mflags}
pushd python
%py3_build
popd
%install
%make_install
pushd python
%py3_install
popd
rm -fr %{buildroot}/etc/sysconfig
install -d -m755 %{buildroot}%{_fillupdir}
install -m 644 etc/sysconfig/pacemaker %{buildroot}%{_fillupdir}/sysconfig.pacemaker
install -m 644 etc/sysconfig/crm_mon %{buildroot}%{_fillupdir}/sysconfig.crm_mon
%if %{with nls}
%find_lang %{name}
%endif
# Don't package static libs
find %{buildroot} -type f -name "*.a" -delete -print
# Don't package libtool archives
find %{buildroot} -type f -name "*.la" -delete -print
ln -s service %{buildroot}%{_sbindir}/rcpacemaker
ln -s service %{buildroot}%{_sbindir}/rcpacemaker_remote
ln -s service %{buildroot}%{_sbindir}/rccrm_mon
mv %{buildroot}%{_sbindir}/crm_report %{buildroot}%{_sbindir}/crm_report.pacemaker
install -m 755 %{SOURCE1} %{buildroot}%{_sbindir}/crm_report
%if 0%{?suse_version} < 1600
ln -s ../heartbeat/NodeUtilization %{buildroot}%{ocf_root}/resource.d/pacemaker/
%endif
%fdupes -s %{buildroot}
%check
make %{_smp_mflags} check
# Prevent false positives in rpmlint
./cts/cts-regression -V scheduler cli 2>&1
%pre
%service_add_pre pacemaker.service
%post
%service_add_post pacemaker.service
%preun
%service_del_preun pacemaker.service
%postun
%service_del_postun pacemaker.service
%pre remote
%service_add_pre pacemaker_remote.service
%post remote
%service_add_post pacemaker_remote.service
%preun remote
%service_del_preun pacemaker_remote.service
%postun remote
%service_del_postun pacemaker_remote.service
%pre cli
%service_add_pre crm_mon.service
%post cli
if [ ! -e %{_sysconfdir}/sysconfig/pacemaker ]; then
%fillup_only -n pacemaker
fi
%service_add_post crm_mon.service
if [ ! -e %{_sysconfdir}/sysconfig/crm_mon ]; then
%fillup_only -n crm_mon
fi
if [ "$1" -eq "2" ]; then
# Package upgrade, not initial install:
# Move any pre-2.0 logs to new location to ensure they get rotated
{ mv -fbS.rpmsave %{_var}/log/pacemaker.log* %{_var}/log/pacemaker \
|| mv -f %{_var}/log/pacemaker.log* %{_var}/log/pacemaker
} >/dev/null 2>/dev/null || :
fi
%preun cli
%service_del_preun crm_mon.service
%postun cli
%service_del_postun crm_mon.service
%pre libs
getent group %{gname} >/dev/null || groupadd -r %{gname} -g %{hacluster_id}
getent passwd %{uname} >/dev/null || useradd -r -g %{gname} -u %{hacluster_id} -s /sbin/nologin -c "cluster user" %{uname}
exit 0
%if %{defined ldconfig_scriptlets}
%ldconfig_scriptlets libs
%ldconfig_scriptlets cluster-libs
%else
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%if %{enable_cluster_libs_pkg}
%post cluster-libs -p /sbin/ldconfig
%postun cluster-libs -p /sbin/ldconfig
%endif
%endif
%if %{with_regression_tests}
%post devel
if [ ! -e /tmp/.pcmk_regression_tests_ran ]; then
touch /tmp/.pcmk_regression_tests_ran
# Needed so that the shell doesn't get stuck on escape
# sequences
export TERM=dumb
%{_datadir}/pacemaker/tests/cts-cli || true
%{_datadir}/pacemaker/tests/cts-scheduler -V || true
fi
%endif
%files
%{_defaultdocdir}/%{name}/
%{_sbindir}/pacemakerd
%{_unitdir}/pacemaker.service
%{_sbindir}/rcpacemaker
%exclude %{_libexecdir}/pacemaker/cts-log-watcher
%exclude %{_libexecdir}/pacemaker/cts-support
%exclude %{_sbindir}/pacemaker-remoted
%exclude %{_sbindir}/pacemaker_remoted
%dir %{_libexecdir}/pacemaker
%{_libexecdir}/pacemaker/*
%if %{with stonithd}
%{_sbindir}/fence_legacy
%endif
%{_sbindir}/fence_watchdog
%{_mandir}/man7/pacemaker-controld.7%{ext_man}
%{_mandir}/man7/pacemaker-schedulerd.7%{ext_man}
%{_mandir}/man7/pacemaker-fenced.7%{ext_man}
%{_mandir}/man7/ocf_pacemaker_controld.7%{ext_man}
%{_mandir}/man7/ocf_pacemaker_o2cb.7%{ext_man}
%{_mandir}/man7/ocf_pacemaker_remote.7%{ext_man}
%if %{with stonithd}
%{_mandir}/man8/fence_legacy.8%{ext_man}
%endif
%{_mandir}/man8/fence_watchdog.8%{ext_man}
%{_mandir}/man8/pacemakerd.8%{ext_man}
%doc %{_datadir}/pacemaker/alerts
#%license licenses/GPLv2
%license COPYING
%doc ChangeLog
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/cib
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/pengine
%{ocf_root}/resource.d/pacemaker/controld
%{ocf_root}/resource.d/pacemaker/o2cb
%{ocf_root}/resource.d/pacemaker/remote
%files cli
%dir %attr (750, root, %{gname}) %{_sysconfdir}/pacemaker
%config(noreplace) %{_sysconfdir}/logrotate.d/pacemaker
%{_unitdir}/crm_mon.service
%{_sbindir}/rccrm_mon
%{_sbindir}/attrd_updater
%{_sbindir}/cibadmin
%if %{with cibsecrets}
%{_sbindir}/cibsecret
%endif
%{_sbindir}/crm_attribute
%{_sbindir}/crm_diff
%{_sbindir}/crm_error
%{_sbindir}/crm_failcount
%{_sbindir}/crm_master
%{_sbindir}/crm_mon
%{_sbindir}/crm_node
%{_sbindir}/crm_resource
%{_sbindir}/crm_rule
%{_sbindir}/crm_standby
%{_sbindir}/crm_verify
%{_sbindir}/crmadmin
%{_sbindir}/iso8601
%{_sbindir}/crm_shadow
%{_sbindir}/crm_simulate
%{_sbindir}/crm_report
%{_sbindir}/crm_report.pacemaker
%{_sbindir}/crm_ticket
%{_sbindir}/stonith_admin
# "dirname" is owned by -schemas, which is a prerequisite
%{_datadir}/pacemaker/report.collector
%{_datadir}/pacemaker/report.common
# XXX "dirname" is not owned by any prerequisite
%{_datadir}/snmp/mibs/PCMK-MIB.txt
%exclude %{ocf_root}/resource.d/pacemaker/controld
%exclude %{ocf_root}/resource.d/pacemaker/o2cb
%exclude %{ocf_root}/resource.d/pacemaker/remote
%dir %{ocf_root}
%dir %{ocf_root}/resource.d
%{ocf_root}/resource.d/pacemaker
%config(noreplace) %{_fillupdir}/sysconfig.pacemaker
%config(noreplace) %{_fillupdir}/sysconfig.crm_mon
%{_mandir}/man7/*pacemaker*
%exclude %{_mandir}/man7/pacemaker-controld.*
%exclude %{_mandir}/man7/pacemaker-schedulerd.*
%exclude %{_mandir}/man7/pacemaker-fenced.*
%exclude %{_mandir}/man7/ocf_pacemaker_controld.*
%exclude %{_mandir}/man7/ocf_pacemaker_o2cb.*
%exclude %{_mandir}/man7/ocf_pacemaker_remote.*
%{_mandir}/man8/crm*.8%{ext_man}
%{_mandir}/man8/attrd_updater.*
%{_mandir}/man8/cibadmin.*
%if %{with cibsecrets}
%{_mandir}/man8/cibsecret.*
%endif
%{_mandir}/man8/iso8601.*
%{_mandir}/man8/stonith_admin.*
#%license licenses/GPLv2
%license COPYING
%doc ChangeLog
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/blackbox
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/cores
%dir %attr (770, %{uname}, %{gname}) %{_var}/log/pacemaker
%dir %attr (770, %{uname}, %{gname}) %{_var}/log/pacemaker/bundles
%files libs %{?with_nls:-f %{name}.lang}
%{_libdir}/libcib.so.*
%{_libdir}/liblrmd.so.*
%{_libdir}/libcrmservice.so.*
%{_libdir}/libcrmcommon.so.*
%{_libdir}/libpe_status.so.*
%{_libdir}/libpe_rules.so.*
%{_libdir}/libpacemaker.so.*
%{_libdir}/libstonithd.so.*
#%license licenses/LGPLv2.1
%license COPYING
%doc ChangeLog
%if !%{enable_cluster_libs_pkg}
%{_libdir}/libcrmcluster.so.*
%endif
%if %{enable_cluster_libs_pkg}
%files cluster-libs
%{_libdir}/libcrmcluster.so.*
#%license licenses/LGPLv2.1
%license COPYING
%doc ChangeLog
%endif
%files -n python3-%{name}
%{python3_sitelib}/pacemaker/
%{python3_sitelib}/pacemaker-*.egg-info
%exclude %{python3_sitelib}/pacemaker/_cts/
#%license licenses/LGPLv2.1
%license COPYING
%doc ChangeLog
%files remote
%{_unitdir}/pacemaker_remote.service
%{_sbindir}/rcpacemaker_remote
%{_sbindir}/pacemaker-remoted
%{_sbindir}/pacemaker_remoted
%{_mandir}/man8/pacemaker-remoted.8%{ext_man}
#%license licenses/GPLv2
%license COPYING
%doc ChangeLog
%if %{with doc}
%files doc
%doc %{pcmk_docdir}
#%license licenses/CC-BY-SA-4.0
%endif
%files cts
%{python3_sitelib}/pacemaker/_cts/
%{_datadir}/pacemaker/tests
%{_libexecdir}/pacemaker/cts-log-watcher
%{_libexecdir}/pacemaker/cts-support
#%license licenses/GPLv2
%license COPYING
%doc ChangeLog
%files devel
%{_includedir}/pacemaker
%{_libdir}/libcib.so
%{_libdir}/liblrmd.so
%{_libdir}/libcrmservice.so
%{_libdir}/libcrmcommon.so
%{_libdir}/libpe_status.so
%{_libdir}/libpe_rules.so
%{_libdir}/libpacemaker.so
%{_libdir}/libstonithd.so
%{_libdir}/libcrmcluster.so
%{_libdir}/pkgconfig/*pacemaker*.pc
#%license licenses/LGPLv2.1
%license COPYING
%doc ChangeLog
%files schemas
#%license licenses/GPLv2
%dir %{_datadir}/pacemaker
%{_datadir}/pacemaker/*.rng
%{_datadir}/pacemaker/*.xsl
%{_datadir}/pacemaker/api
%{_datadir}/pacemaker/base
%{_datadir}/pkgconfig/pacemaker-schemas.pc
%changelog