import sbd-1.5.0-2.el8

This commit is contained in:
CentOS Sources 2021-08-24 22:40:54 +00:00 committed by Andrew Lukoshko
parent fee5780e55
commit 12e3c64c86
8 changed files with 309 additions and 46 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/sbd-bfeee963f7363720da91a018045ca6746d822ba0.tar.gz
SOURCES/sbd-d7f447d689da52897e190114c448d1129f3c5f72.tar.gz

View File

@ -1 +1 @@
e68c21479e24b1660731125391ed8473e361bb95 SOURCES/sbd-bfeee963f7363720da91a018045ca6746d822ba0.tar.gz
7506baf3940101bc1472036cb6d5e05d7f0cb92c SOURCES/sbd-d7f447d689da52897e190114c448d1129f3c5f72.tar.gz

View File

@ -0,0 +1,41 @@
From 956f3558d4b619fb19eaa040614dfaf9a226d514 Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
Date: Mon, 28 Jun 2021 17:37:44 +0200
Subject: [PATCH] Build: Fix: correctly derive package version from git
---
Makefile.am | 4 ++--
sbd.spec | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index e614754..5d53c4c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,8 +73,8 @@ spec:
sed -i 's/global\ build_counter.*/global\ build_counter\ $(COUNT)/' $(distdir)/$(PACKAGE).spec; \
echo $(COUNT) > $(BUILD_COUNTER); \
fi
- if [ -n $(COMMIT_COUNTER) ]; then \
- sed -i 's/global\ commit_counter.*/global\ commit_counter\ $(COMMIT_COUNTER)-1/' $(distdir)/$(PACKAGE).spec; \
+ if [ -n "$(COMMIT_COUNTER)" ]; then \
+ sed -i 's/global\ commit_counter.*/global\ commit_counter\ $(COMMIT_COUNTER)/' $(distdir)/$(PACKAGE).spec; \
fi
srpm: export spec
diff --git a/sbd.spec b/sbd.spec
index 776e48b..0498db1 100644
--- a/sbd.spec
+++ b/sbd.spec
@@ -20,7 +20,7 @@
%global modified %(echo %{longcommit}-|cut -f2 -d-)
%global github_owner Clusterlabs
%global commit_counter 0
-%global build_counter 1
+%global build_counter 0
%global buildnum %(expr %{commit_counter} + %{build_counter})
%ifarch s390x s390
--
1.8.3.1

View File

@ -1,36 +0,0 @@
From 542bf70c701083df032eb22cf59f4027ee88e60f Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
Date: Thu, 28 Jan 2021 21:46:11 +0100
Subject: [PATCH] Doc: adapt description of startup/shutdown sync with
pacemaker
now that the default is configurable at compile-time
---
src/sbd.sysconfig.in | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/sbd.sysconfig.in b/src/sbd.sysconfig.in
index 15cd66a..f49d780 100644
--- a/src/sbd.sysconfig.in
+++ b/src/sbd.sysconfig.in
@@ -114,9 +114,14 @@ SBD_MOVE_TO_ROOT_CGROUP=auto
# On shutdown pacemakerd is going to wait in a state where it
# has cleanly shutdown resources till sbd fetches that state.
#
-# Default is 'no' to prevent pacemaker from waiting for a
-# ping that will never come when working together with an sbd
-# version that doesn't support the feature.
+# The default is set when building SBD and Pacemaker from source.
+# Going for 'no' is safer if it can't be assured that SBD and
+# Pacemaker installed do both support the synchronization feature.
+# When going with 'yes' - also using package dependencies to
+# assure SBD & Pacemaker both support the synchronization
+# feature and are assuming the same default - an SBD configuration
+# inherited via an upgrade doesn't have to be altered to still
+# benefit from the new feature.
#
SBD_SYNC_RESOURCE_STARTUP=@SBD_SYNC_RESOURCE_STARTUP_SYSCONFIG@
--
1.8.3.1

View File

@ -0,0 +1,43 @@
From 8438c244cc2066fbe9c598a6392e8935cf017d97 Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Fri, 25 Jun 2021 15:02:14 +0200
Subject: [PATCH] Refactor: sbd-inquisitor: functionize striping leading spaces
of an option value
---
src/sbd-inquisitor.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/sbd-inquisitor.c b/src/sbd-inquisitor.c
index 4fec2fd..53ddfa3 100644
--- a/src/sbd-inquisitor.c
+++ b/src/sbd-inquisitor.c
@@ -40,9 +40,8 @@ bool sync_resource_startup = false;
int parse_device_line(const char *line);
static const char *
-get_env_option(const char *option)
+sanitize_option_value(const char *value)
{
- const char *value = getenv(option);
size_t max = 0;
size_t lpc = 0;
@@ -61,6 +60,14 @@ get_env_option(const char *option)
return (strlen(value + lpc) > 0 ? (value + lpc) : NULL);
}
+static const char *
+get_env_option(const char *option)
+{
+ const char *value = getenv(option);
+
+ return sanitize_option_value(value);
+}
+
static int
recruit_servant(const char *devname, pid_t pid)
{
--
1.8.3.1

View File

@ -0,0 +1,29 @@
From c1bb2a4d8c8ec66c72da3ec080f23b1f858a66af Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Mon, 28 Jun 2021 13:35:56 +0200
Subject: [PATCH] Log: sbd-inquisitor: tell the actual watchdog device
specified with `-w`
---
src/sbd-inquisitor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sbd-inquisitor.c b/src/sbd-inquisitor.c
index 53ddfa3..2cf09ac 100644
--- a/src/sbd-inquisitor.c
+++ b/src/sbd-inquisitor.c
@@ -1042,10 +1042,10 @@ int main(int argc, char **argv, char **envp)
W_count++;
break;
case 'w':
- cl_log(LOG_NOTICE, "Using watchdog device '%s'", watchdogdev);
free(watchdogdev);
watchdogdev = strdup(optarg);
watchdogdev_is_default = false;
+ cl_log(LOG_NOTICE, "Using watchdog device '%s'", watchdogdev);
break;
case 'd':
#if SUPPORT_SHARED_DISK
--
1.8.3.1

View File

@ -0,0 +1,146 @@
From 1c72cf23561deeb69b04891f3fc4d0613f73fbb0 Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Fri, 25 Jun 2021 15:21:38 +0200
Subject: [PATCH] Fix: sbd-inquisitor: tolerate and strip any leading spaces of
command line option values
Somehow an user's own monitoring agent doesn't well parse an SBD_DEVICE
setting with spaces between the device names:
SBD_DEVICE="/dev/<a>; /dev/<b>; /dev/<c>"
And eventually it calls an sbd command:
`sbd list -d " /dev/<b>"`
-- A space is prefixed to the device name which is quoted.
Of course it could be easily fixed in the setting or their agent. But
OTOH, sbd'd better tolerate and strip any leading spaces of command line
option values.
---
src/sbd-inquisitor.c | 41 +++++++++++++++++++++++++----------------
1 file changed, 25 insertions(+), 16 deletions(-)
diff --git a/src/sbd-inquisitor.c b/src/sbd-inquisitor.c
index 2cf09ac..944a353 100644
--- a/src/sbd-inquisitor.c
+++ b/src/sbd-inquisitor.c
@@ -999,6 +999,15 @@ int main(int argc, char **argv, char **envp)
}
while ((c = getopt(argc, argv, "czC:DPRTWZhvw:d:n:p:1:2:3:4:5:t:I:F:S:s:r:")) != -1) {
+ /* Call it before checking optarg for NULL to make coverity happy */
+ const char *sanitized_optarg = sanitize_option_value(optarg);
+
+ if (optarg && sanitized_optarg == NULL) {
+ fprintf(stderr, "Invalid value \"%s\" for option -%c\n", optarg, c);
+ exit_status = -2;
+ goto out;
+ }
+
switch (c) {
case 'D':
break;
@@ -1011,11 +1020,11 @@ int main(int argc, char **argv, char **envp)
cl_log(LOG_INFO, "Realtime mode deactivated.");
break;
case 'S':
- start_mode = atoi(optarg);
+ start_mode = atoi(sanitized_optarg);
cl_log(LOG_INFO, "Start mode set to: %d", (int)start_mode);
break;
case 's':
- timeout_startup = atoi(optarg);
+ timeout_startup = atoi(sanitized_optarg);
cl_log(LOG_INFO, "Start timeout set to: %d", (int)timeout_startup);
break;
case 'v':
@@ -1043,13 +1052,13 @@ int main(int argc, char **argv, char **envp)
break;
case 'w':
free(watchdogdev);
- watchdogdev = strdup(optarg);
+ watchdogdev = strdup(sanitized_optarg);
watchdogdev_is_default = false;
cl_log(LOG_NOTICE, "Using watchdog device '%s'", watchdogdev);
break;
case 'd':
#if SUPPORT_SHARED_DISK
- if (recruit_servant(optarg, 0) != 0) {
+ if (recruit_servant(sanitized_optarg, 0) != 0) {
fprintf(stderr, "Invalid device: %s\n", optarg);
exit_status = -1;
goto out;
@@ -1070,48 +1079,48 @@ int main(int argc, char **argv, char **envp)
disk_priority = 0;
break;
case 'n':
- local_uname = strdup(optarg);
+ local_uname = strdup(sanitized_optarg);
cl_log(LOG_INFO, "Overriding local hostname to %s", local_uname);
break;
case 'p':
- pidfile = strdup(optarg);
+ pidfile = strdup(sanitized_optarg);
cl_log(LOG_INFO, "pidfile set to %s", pidfile);
break;
case 'C':
- timeout_watchdog_crashdump = atoi(optarg);
+ timeout_watchdog_crashdump = atoi(sanitized_optarg);
cl_log(LOG_INFO, "Setting crashdump watchdog timeout to %d",
(int)timeout_watchdog_crashdump);
break;
case '1':
- timeout_watchdog = atoi(optarg);
+ timeout_watchdog = atoi(sanitized_optarg);
break;
case '2':
- timeout_allocate = atoi(optarg);
+ timeout_allocate = atoi(sanitized_optarg);
break;
case '3':
- timeout_loop = atoi(optarg);
+ timeout_loop = atoi(sanitized_optarg);
break;
case '4':
- timeout_msgwait = atoi(optarg);
+ timeout_msgwait = atoi(sanitized_optarg);
break;
case '5':
- timeout_watchdog_warn = atoi(optarg);
+ timeout_watchdog_warn = atoi(sanitized_optarg);
do_calculate_timeout_watchdog_warn = false;
cl_log(LOG_INFO, "Setting latency warning to %d",
(int)timeout_watchdog_warn);
break;
case 't':
- servant_restart_interval = atoi(optarg);
+ servant_restart_interval = atoi(sanitized_optarg);
cl_log(LOG_INFO, "Setting servant restart interval to %d",
(int)servant_restart_interval);
break;
case 'I':
- timeout_io = atoi(optarg);
+ timeout_io = atoi(sanitized_optarg);
cl_log(LOG_INFO, "Setting IO timeout to %d",
(int)timeout_io);
break;
case 'F':
- servant_restart_count = atoi(optarg);
+ servant_restart_count = atoi(sanitized_optarg);
cl_log(LOG_INFO, "Servant restart count set to %d",
(int)servant_restart_count);
break;
@@ -1119,7 +1128,7 @@ int main(int argc, char **argv, char **envp)
if (timeout_action) {
free(timeout_action);
}
- timeout_action = strdup(optarg);
+ timeout_action = strdup(sanitized_optarg);
break;
case 'h':
usage();
--
1.8.3.1

View File

@ -15,7 +15,9 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%global commit bfeee963f7363720da91a018045ca6746d822ba0
%global longcommit d7f447d689da52897e190114c448d1129f3c5f72
%global shortcommit %(echo %{longcommit}|cut -c1-8)
%global modified %(echo %{longcommit}-|cut -f2 -d-)
%global github_owner Clusterlabs
%global buildnum 2
@ -26,18 +28,35 @@
%global watchdog_timeout_default 5
%endif
%global sync_resource_startup_default yes
%global sync_resource_startup_sysconfig yes
# Be careful with sync_resource_startup_default
# being enabled. This configuration has
# to be in sync with configuration in pacemaker
# where it is called sbd_sync - assure by e.g.
# mutual rpm dependencies.
%bcond_without sync_resource_startup_default
# Syncing enabled per default will lead to
# syncing enabled on upgrade without adaption
# of the config.
# Setting can still be overruled via sysconfig.
# The setting in the config-template packaged
# will follow the default if below is is left
# empty. But it is possible to have the setting
# in the config-template deviate from the default
# by setting below to an explicit 'yes' or 'no'.
%global sync_resource_startup_sysconfig ""
Name: sbd
Summary: Storage-based death
License: GPLv2+
Group: System Environment/Daemons
Version: 1.4.2
Version: 1.5.0
Release: %{buildnum}%{?dist}
Url: https://github.com/%{github_owner}/%{name}
Source0: https://github.com/%{github_owner}/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz
Patch1: 0001-Doc-adapt-description-of-startup-shutdown-sync.patch
Source0: https://github.com/%{github_owner}/%{name}/archive/%{longcommit}/%{name}-%{longcommit}.tar.gz
Patch0: 0001-Build-Fix-correctly-derive-package-version-from-git.patch
Patch1: 0002-Refactor-sbd-inquisitor-functionize-striping-leading.patch
Patch2: 0003-Log-sbd-inquisitor-tell-the-actual-watchdog-device-s.patch
Patch3: 0004-Fix-sbd-inquisitor-tolerate-and-strip-any-leading-sp.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf
BuildRequires: automake
@ -67,6 +86,9 @@ ExclusiveArch: i686 x86_64 s390x ppc64le aarch64
This package contains the storage-based death functionality.
Available rpmbuild rebuild options:
--with(out) : sync_resource_startup_default
%package tests
Summary: Storage-based death environment for regression tests
License: GPLv2+
@ -79,7 +101,7 @@ regression-testing sbd.
###########################################################
%prep
%autosetup -n %{name}-%{commit} -p1
%autosetup -n %{name}-%{longcommit} -p1
###########################################################
@ -87,7 +109,7 @@ regression-testing sbd.
./autogen.sh
export CFLAGS="$RPM_OPT_FLAGS -Wall -Werror"
%configure --with-watchdog-timeout-default=%{watchdog_timeout_default} \
--with-sync-resource-startup-default=%{sync_resource_startup_default} \
--with-sync-resource-startup-default=%{?with_sync_resource_startup_default:yes}%{!?with_sync_resource_startup_default:no} \
--with-sync-resource-startup-sysconfig=%{sync_resource_startup_sysconfig}
make %{?_smp_mflags}
@ -163,6 +185,24 @@ fi
%{_libdir}/libsbdtestbed*
%changelog
* Wed Aug 18 2021 Klaus Wenninger <kwenning@redhat.com> - 1.5.0-2
- reverted watchdog_timeout_default to 5s
(slipped in via an unreleased change on 8.4.0 branch)
Resolves: rhbz#1980797
* Mon Jul 19 2021 Klaus Wenninger <kwenning@redhat.com> - 1.5.0-1
- rebase to upstream v1.5.0
- sync with c9s & fedora
Resolves: rhbz#1980797
* Mon Feb 1 2021 Klaus Wenninger <kwenning@redhat.com> - 1.4.2-3
- change the default for SBD_WATCHDOG_TIMEOUT to 10s
s390(x) stays at 15s as before
Resolves: rhbz#1922143
* Thu Jan 28 2021 Klaus Wenninger <kwenning@redhat.com> - 1.4.2-2
- update SBD_SYNC_RESOURCE_STARTUP description for
configurable default