Sync from SUSE:SLFO:Main drbd-utils revision 76ef10cac2e74ddd77cfc36722b04756

This commit is contained in:
Adrian Schröter 2024-05-03 12:13:33 +02:00
commit 4f0a6f477a
15 changed files with 2710 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

View File

@ -0,0 +1,11 @@
diff -Naur drbd-utils-9.0.0+git.98b6340c.orig/scripts/global_common.conf drbd-utils-9.0.0+git.98b6340c/scripts/global_common.conf
--- drbd-utils-9.0.0+git.98b6340c.orig/scripts/global_common.conf 2017-06-07 16:04:14.063680274 +0800
+++ drbd-utils-9.0.0+git.98b6340c/scripts/global_common.conf 2017-06-07 16:04:45.519644428 +0800
@@ -42,6 +42,7 @@
# RECOMMENDED for three or more storage nodes with DRBD 9:
# quorum majority;
+ quorum off;
# on-no-quorum suspend-io | io-error;
}

View File

@ -0,0 +1,138 @@
From 8a28be74bc6efa93931c957e54c01abb18b984fe Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars.ellenberg@linbit.com>
Date: Wed, 12 Jan 2022 13:50:35 +0100
Subject: [PATCH] crm-fence-peer: fix timeout with Pacemaker 2.1: milli seconds
vs seconds
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
crmadmin timeout was in milli seconds for <= 2.0.x,
but became a TIMESPEC with default seconds in >= 2.1.
Up to 2.0.4, atoi() was used, which effectively ignores "trailing garbage",
so we could get away with always appending "ms".
But with 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
"Cannot parse integer value “200ms” for --timeout" :-|
So grep the help message for "timeout.*milliseconds",
and if not present, append an explicit "ms" unit.
Also tolerate both ": ok" (2.1) and " (ok)" (older)
when matching the output string of crmadmin -S.
---
scripts/crm-fence-peer.9.sh | 24 +++++++++++++++++++++---
scripts/crm-fence-peer.sh | 24 +++++++++++++++++++++---
2 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/scripts/crm-fence-peer.9.sh b/scripts/crm-fence-peer.9.sh
index 36590bd8..c943bf9f 100755
--- a/scripts/crm-fence-peer.9.sh
+++ b/scripts/crm-fence-peer.9.sh
@@ -392,6 +392,20 @@ check_cluster_properties()
crm_is_not_false ${stonith_enabled:-} && stonith_enabled=true || stonith_enabled=false
}
+setup_crm_timeout_unit_ms()
+{
+ # crmadmin timeout was in ms for <= 2.0.x,
+ # but became a TIMESPEC in >= 2.1.
+ # Up to 2.0.4, atoi() was used, which effectively ignores "trailing
+ # garbage", so we could get away with always appending "ms", but with
+ # 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
+ # "Cannot parse integer value “200ms” for --timeout" :-|
+ if crmadmin --help 2>&1 | grep -q -e "--timeout=.*in milliseconds"; then
+ crm_timeout_unit_ms=""
+ else
+ crm_timeout_unit_ms="ms"
+ fi
+}
#
# In case this is a two-node cluster (still common with
@@ -737,6 +751,7 @@ drbd_peer_fencing()
local startup_fencing stonith_enabled
check_cluster_properties
+ setup_crm_timeout_unit_ms
if ! $had_constraint_on_entry ; then
@@ -1075,14 +1090,17 @@ _check_peer_node_reachable()
# it is obviously reachable.
#
# Do this only after we have been able to reach a DC above.
- # Note: crmadmin timeout is in milli-seconds, and defaults to 30000 (30 seconds).
+ # Note: crmadmin timeout defaults to 30 seconds.
+ #
# Our variable $cibtimeout should be in deci-seconds (see above)
# (unless you use a very old version of pacemaker, so don't do that).
# Convert deci-seconds to milli-seconds, and double it.
+ # See also setup_crm_timeout_unit_ms() above.
+ #
if [[ $crmd = "online" ]] ; then
local out
- if out=$( crmadmin -t $(( cibtimeout * 200 )) -S $DRBD_PEER ) \
- && [[ $out = *"(ok)" ]]; then
+ if out=$( crmadmin -t $(( cibtimeout * 200 ))$crm_timeout_unit_ms -S $DRBD_PEER ) \
+ && [[ $out = *@(": ok"|" (ok)") ]]; then
peer_state="reachable"
return
fi
diff --git a/scripts/crm-fence-peer.sh b/scripts/crm-fence-peer.sh
index cb5deded..96786734 100755
--- a/scripts/crm-fence-peer.sh
+++ b/scripts/crm-fence-peer.sh
@@ -244,6 +244,20 @@ check_cluster_properties()
crm_is_not_false $stonith_enabled && stonith_enabled=true || stonith_enabled=false
}
+setup_crm_timeout_unit_ms()
+{
+ # crmadmin timeout was in ms for <= 2.0.x,
+ # but became a TIMESPEC in >= 2.1.
+ # Up to 2.0.4, atoi() was used, which effectively ignores "trailing
+ # garbage", so we could get away with always appending "ms", but with
+ # 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
+ # "Cannot parse integer value “200ms” for --timeout" :-|
+ if crmadmin --help 2>&1 | grep -q -e "--timeout=.*in milliseconds"; then
+ crm_timeout_unit_ms=""
+ else
+ crm_timeout_unit_ms="ms"
+ fi
+}
#
# In case this is a two-node cluster (still common with
@@ -426,6 +440,7 @@ drbd_peer_fencing()
local startup_fencing stonith_enabled
check_cluster_properties
+ setup_crm_timeout_unit_ms
if [[ -z $have_constraint ]] ; then
# try to place it.
@@ -718,14 +733,17 @@ check_peer_node_reachable()
# it is obviously reachable.
#
# Do this only after we have been able to reach a DC above.
- # Note: crmadmin timeout is in milli-seconds, and defaults to 30000 (30 seconds).
+ # Note: crmadmin timeout defaults to 30 seconds.
+ #
# Our variable $cibtimeout should be in deci-seconds (see above)
# (unless you use a very old version of pacemaker, so don't do that).
# Convert deci-seconds to milli-seconds, and double it.
+ # See also setup_crm_timeout_unit_ms() above.
+ #
if [[ $crmd = "online" ]] ; then
local out
- if out=$( crmadmin -t $(( cibtimeout * 200 )) -S $DRBD_PEER ) \
- && [[ $out = *"(ok)" ]]; then
+ if out=$( crmadmin -t $(( cibtimeout * 200 ))$crm_timeout_unit_ms -S $DRBD_PEER ) \
+ && [[ $out = *@(": ok"|" (ok)") ]]; then
peer_state="reachable"
return
fi
--
2.40.0

View File

@ -0,0 +1,90 @@
From 68d1e4242f165917bc2c787d9df0fe41251e05e6 Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars.ellenberg@linbit.com>
Date: Wed, 12 Jan 2022 13:50:35 +0100
Subject: [PATCH] crm-fence-peer: fix timeout with Pacemaker 2.0.5: milli
seconds vs seconds
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Addendum to 8a28be74bc6efa93931c957e54c01abb18b984fe
Commit message of the above cited here:
> crmadmin timeout was in milli seconds for <= 2.0.x,
> but became a TIMESPEC with default seconds in >= 2.1.
>
> Up to 2.0.4, atoi() was used, which effectively ignores "trailing garbage",
> so we could get away with always appending "ms".
> But with 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
> "Cannot parse integer value “200ms” for --timeout" :-|
>
> So grep the help message for "timeout.*milliseconds",
> and if not present, append an explicit "ms" unit.
And this is where I got it wrong :-(
somewhere later they re-organised the help text
so now I would need to parse --help-all.
Instead try to actually call "crmadmin -t 100ms --version".
If that works, it apparently understands (or ignores)
the "ms" unit.
---
scripts/crm-fence-peer.9.sh | 14 +++++++++++---
scripts/crm-fence-peer.sh | 14 +++++++++++---
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/scripts/crm-fence-peer.9.sh b/scripts/crm-fence-peer.9.sh
index c943bf9f..fc8d2bc3 100755
--- a/scripts/crm-fence-peer.9.sh
+++ b/scripts/crm-fence-peer.9.sh
@@ -400,10 +400,18 @@ setup_crm_timeout_unit_ms()
# garbage", so we could get away with always appending "ms", but with
# 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
# "Cannot parse integer value “200ms” for --timeout" :-|
- if crmadmin --help 2>&1 | grep -q -e "--timeout=.*in milliseconds"; then
- crm_timeout_unit_ms=""
- else
+ # Can not parse the help text reliably, because they changed content
+ # and organisation of the help text between 2.0.4 and 2.0.5.
+ # Just try using ms unit, and see if it fails.
+ if crmadmin -t 100ms --version &> /dev/null; then
+ # this is either a recent version that actually understands ms
+ # as part of the TIMESPEC, or a version that still uses atoi().
crm_timeout_unit_ms="ms"
+ else
+ # this one likely failed with
+ # crmadmin: Cannot parse integer value “100ms” for -t
+ # (>= 2.0.5, < 2.1)
+ crm_timeout_unit_ms=""
fi
}
diff --git a/scripts/crm-fence-peer.sh b/scripts/crm-fence-peer.sh
index 96786734..b0e4e0f1 100755
--- a/scripts/crm-fence-peer.sh
+++ b/scripts/crm-fence-peer.sh
@@ -252,10 +252,18 @@ setup_crm_timeout_unit_ms()
# garbage", so we could get away with always appending "ms", but with
# 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
# "Cannot parse integer value “200ms” for --timeout" :-|
- if crmadmin --help 2>&1 | grep -q -e "--timeout=.*in milliseconds"; then
- crm_timeout_unit_ms=""
- else
+ # Can not parse the help text reliably, because they changed content
+ # and organisation of the help text between 2.0.4 and 2.0.5.
+ # Just try using ms unit, and see if it fails.
+ if crmadmin -t 100ms --version &> /dev/null; then
+ # this is either a recent version that actually understands ms
+ # as part of the TIMESPEC, or a version that still uses atoi().
crm_timeout_unit_ms="ms"
+ else
+ # this one likely failed with
+ # crmadmin: Cannot parse integer value “100ms” for -t
+ # (>= 2.0.5, < 2.1)
+ crm_timeout_unit_ms=""
fi
}
--
2.40.0

23
_service Normal file
View File

@ -0,0 +1,23 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="url">https://github.com/LINBIT/drbd-utils.git</param>
<param name="scm">git</param>
<param name="filename">drbd-utils</param>
<!--
build service using release drbd-utils atm.
<param name="version">9.19.0</param>
Using release tarball instead of git since need buildtag.c/h
-->
<param name="versionformat">9.19.0+git.%h</param>
<param name="revision">master</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*drbd-utils*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version" mode="disabled">
<param name="basename">drbd-utils</param>
</service>
</services>

BIN
drbd-utils-9.19.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

1940
drbd-utils.changes Normal file

File diff suppressed because it is too large Load Diff

1
drbd-utils.rpmlintrc Normal file
View File

@ -0,0 +1 @@
addFilter("missing-call-to-setgroups-before-setuid /usr/sbin/drbdmon")

239
drbd-utils.spec Normal file
View File

@ -0,0 +1,239 @@
#
# spec file for package drbd-utils
#
# 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/
#
%define services drbd.service drbd-lvchange@.service drbd-promote@.service drbd-reconfigure-suspend-or-error@.service drbd-services@.target drbd-wait-promotable@.service drbd@.service drbd@.target ocf.ra@.service
%if 0%{?suse_version} < 1550
# for SLEs
%define sbindir /sbin
# see bsc#1203220 & usrmerge_move_lib_to_prefix_lib.patch for %{libdir}
%define libdir /usr/lib
%else
# for opensuse
%define sbindir %{_sbindir}
%define libdir %{_prefix}/lib
%endif
%bcond_without drbdmon
# Man pages are included in the released tarball.
# Only need po4a to build man from git source code
%bcond_without prebuiltman
Name: drbd-utils
Version: 9.19.0
Release: 0
Summary: Distributed Replicated Block Device
License: GPL-2.0-or-later
Group: Productivity/Clustering/HA
URL: https://linbit.com/linbit-software-download-page-for-linstor-and-drbd-linux-driver/
# tarball might be available at https://pkg.linbit.com/downloads/drbd/utils/drbd-utils-%{name}.tar.gz
Source: %{name}-%{version}.tar.gz
Source100: %{name}.rpmlintrc
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch1: init-script-fixes.diff
Patch2: usrmerge_move_lib_to_prefix_lib.patch
Patch3: fence-after-pacemaker-down.patch
# PATCH-SUSE-FIX: Disable quorum in default configuration (bsc#1032142)
Patch4: 0001-Disable-quorum-in-default-configuration-bsc-1032142.patch
Patch5: move_fencing_from_disk_to_net_in_example.patch
Patch6: pie-fix.patch
Patch7: 0001-crm-fence-peer-fix-timeout-with-Pacemaker-2.1-milli-.patch
Patch8: 0002-crm-fence-peer-fix-timeout-with-Pacemaker-2.0.5-mill.patch
Patch99: rpmlint-build-error.patch
Provides: drbd-bash-completion = %{version}
Provides: drbd-pacemaker = %{version}
Provides: drbd-udev = %{version}
Obsoletes: drbd-bash-completion < %{version}
Obsoletes: drbd-pacemaker < %{version}
Obsoletes: drbd-udev < %{version}
# drbd-utils first splict from drbd-8.4.5(only driver)
# and suse let drbd driver goes in-kernel
# Provides: drbd = 8.4.5
# Obsoletes: drbd < 8.4.5
%ifarch %{ix86} x86_64
Provides: drbd-xen = %{version}
Obsoletes: drbd-xen < %{version}
%endif
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: docbook-xsl-stylesheets
BuildRequires: flex
BuildRequires: gcc
BuildRequires: glibc-devel
BuildRequires: libxslt
BuildRequires: make
BuildRequires: pkgconfig
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(udev)
%if %{with drbdmon}
BuildRequires: gcc-c++
%endif
%if %{without prebuiltman}
BuildRequires: po4a
%endif
Provides: drbd-control
Provides: drbdsetup
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Drbd is a distributed replicated block device. It mirrors a block
device over the network to another machine. Think of it as networked
raid 1. It is a building block for setting up clusters.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch99 -p1
%build
export WANT_DRBD_REPRODUCIBLE_BUILD=1
./autogen.sh
PATH=/sbin:$PATH ./configure \
--with-udev \
--with-distro=suse \
--without-heartbeat \
--with-pacemaker \
--with-xen \
--with-bashcompletion \
--with-initscripttype=systemd \
--with-systemdunitdir=%{_prefix}/lib/systemd/system \
%if 0%{?suse_version} < 1550
--sbindir=/sbin \
%else
--sbindir=%{_sbindir} \
%endif
--prefix=%{_prefix} \
--localstatedir=%{_localstatedir} \
--mandir=%{_mandir} \
--sysconfdir=%{_sysconfdir} \
--datarootdir=%{_datadir} \
--datadir=%{_datadir} \
--libdir=%{_prefix}/lib \
--exec_prefix=%{_prefix}/lib \
%{?with_drbdmon: --with-drbdmon} \
%{?with_prebuiltman: --with-prebuiltman} \
--with-tmpfilesdir=%{_tmpfilesdir}
%make_build OPTFLAGS="%{optflags}"
%install
%make_install
%ifnarch %{ix86} x86_64
rm -rf %{buildroot}%{_sysconfdir}/xen
%endif
rm -rf %{buildroot}%{libdir}/drbd/crm-*fence-peer.sh # bsc#1204276
%pre
%service_add_pre %{services}
%post
%tmpfiles_create %{_tmpfilesdir}/drbd.conf
%service_add_post %{services}
#May also overlap the $MAN_LINK in documentation/v9/Makefile.in
for f in drbd drbdadm drbdmeta drbdsetup; do
ln -sf $f-9.0.8.gz %{_mandir}/man8/$f.8.gz
ln -sf $f-9.0.8.gz %{_mandir}/ja/man8/$f.8.gz
done
ln -sf drbd.conf-9.0.5.gz %{_mandir}/man5/drbd.conf.5.gz
ln -sf drbd.conf-9.0.5.gz %{_mandir}/ja/man5/drbd.conf.5.gz
%if %{with drbdmon}
ln -sf drbdmon-9.0.8.gz %{_mandir}/man8/drbdmon.8.gz
ln -sf drbdmon-9.0.8.gz %{_mandir}/ja/man8/drbdmon.8.gz
%endif
%preun
%service_del_preun %{services}
%postun
%service_del_postun %{services}
%if 0%{?suse_version} < 1550
if [ -d /lib/drbd ]; then
rm -rf /lib/drbd.rpmmoved
mv /lib/drbd /lib/drbd.rpmmoved
elif [ ! -e %{libdir}/drbd ] && [ -L /lib/drbd ]; then
rm /lib/drbd
fi
%endif
%posttrans
%if 0%{?suse_version} < 1550
if [ ! -e /lib/drbd ]; then
ln -sf %{libdir}/drbd /lib/drbd
fi
%endif
%files -n drbd-utils
%config(noreplace) %{_sysconfdir}/drbd.conf
%config(noreplace) %{_sysconfdir}/drbd.d/global_common.conf
%config(noreplace) %{_sysconfdir}/multipath/conf.d/drbd.conf
%{_datadir}/bash-completion/completions/drbdadm
%{_tmpfilesdir}/drbd.conf
%{_mandir}/man5/drbd.*
%{_mandir}/man8/drbd*
%{_mandir}/man7/ocf*
%{_mandir}/man7/drbd*
%{_mandir}/ja/man5/drbd.*
%{_mandir}/ja/man8/drbd*
%license COPYING
%doc README.md
%doc ChangeLog
%doc scripts/drbd.conf.example
%dir %{_sysconfdir}/drbd.d
%dir %{_sysconfdir}/multipath
%dir %{_sysconfdir}/multipath/conf.d
%{libdir}/drbd
%{sbindir}/drbdadm
%{sbindir}/drbdsetup
%{sbindir}/drbdmeta
%if %{with drbdmon}
%{sbindir}/drbdmon
%endif
%ifarch %{ix86} x86_64
%dir %attr(700,root,root) %{_sysconfdir}/xen
%dir %{_sysconfdir}/xen/scripts
%attr(755,root,root) %{_sysconfdir}/xen/scripts/block-drbd
%endif
%{_prefix}/lib/ocf/resource.d/linbit/drbd
%{_prefix}/lib/ocf/resource.d/linbit/drbd-attr
%{_prefix}/lib/ocf/resource.d/linbit/drbd.shellfuncs.sh
%{_udevrulesdir}/65-drbd.rules
%{_unitdir}/drbd.service
%{_unitdir}/drbd-lvchange@.service
%{_unitdir}/drbd-promote@.service
%{_unitdir}/drbd-reconfigure-suspend-or-error@.service
%{_unitdir}/drbd-services@.target
%{_unitdir}/drbd-wait-promotable@.service
%{_unitdir}/drbd@.service
%{_unitdir}/drbd@.target
%{_unitdir}/ocf.ra@.service
%dir %{_prefix}/lib/ocf
%dir %{_prefix}/lib/ocf/resource.d
%dir %{_prefix}/lib/ocf/resource.d/linbit
%dir %{_localstatedir}/lib/drbd
%changelog

View File

@ -0,0 +1,29 @@
diff -Naur drbd-utils-8.9.6.orig/scripts/crm-fence-peer.sh drbd-utils-8.9.6/scripts/crm-fence-peer.sh
--- drbd-utils-8.9.6.orig/scripts/crm-fence-peer.sh 2016-03-14 15:54:38.701360775 +0800
+++ drbd-utils-8.9.6/scripts/crm-fence-peer.sh 2016-03-14 16:00:06.333338664 +0800
@@ -531,6 +531,25 @@
[[ $crmd = "banned" ]] && will_fence=true
if [[ ${expected-down} = "down" && $in_ccm = "false" && $crmd != "online" ]]; then
: "pacemaker considers this as clean down"
+ elif [[ $crmd/$join/$expected = "offline/down/down" ]] ; then
+ # Check if pacemaker is simply shutdown, but membership/quorum is
+ # possibly still established (corosync2/cman)
+ # 1.1.11 will set expected="down" on a clean shutdown too
+ # Look for "shutdown" transient node attribute
+ local node_attributes=$(set +x; echo "$cib_xml" |
+ awk "/<node_state [^\n]*uname=\"$DRBD_PEER\"/,/<\/instance_attributes>/"|
+ grep -F -e "<nvpair ")
+ if [ -n "${node_attributes}" ] ; then
+ local shut_down=$(set +x; echo "$node_attributes" |
+ awk '/ name="shutdown"/ {if (match($0, /value=\"([[:digit:]]+)\"/, values)) {print values[1]} }')
+ if [ -n "${shut_down}" ] ; then
+ : "pacemaker considers this as clean down"
+ else
+ will_fence=true
+ fi
+ else
+ will_fence=true
+ fi
elif [[ $in_ccm = false ]] || [[ $crmd != "online" ]]; then
will_fence=true
fi

38
init-script-fixes.diff Normal file
View File

@ -0,0 +1,38 @@
diff -Naur drbd-utils-8.9.9.orig/scripts/drbd drbd-utils-8.9.9/scripts/drbd
--- drbd-utils-8.9.9.orig/scripts/drbd 2016-10-24 17:37:12.893292307 +0800
+++ drbd-utils-8.9.9/scripts/drbd 2016-10-24 17:38:56.728938286 +0800
@@ -9,14 +9,14 @@
#
### BEGIN INIT INFO
# Provides: drbd
-# Required-Start: $local_fs $network $syslog
-# Required-Stop: $local_fs $network $syslog
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $network $syslog
# Should-Start: sshd multipathd
# Should-Stop: sshd multipathd
# Default-Start:
# Default-Stop: 0 1 6
-# X-Start-Before: heartbeat corosync
-# X-Stop-After: heartbeat corosync
+# X-Start-Before: pacemaker corosync
+# X-Stop-After: pacemaker corosync
# X-Interactive: true
# Short-Description: Control DRBD resources.
# Description: Control all DRBD resources.
@@ -184,7 +184,6 @@
done
done
- [ -d /var/lock/subsys ] && touch /var/lock/subsys/drbd # for RedHat
run_hook start_before-wait
$DRBDADM wait-con-int # User interruptible version of wait-connect all
run_hook start
@@ -256,7 +255,6 @@
fi
done
run_hook stop
- [ -f /var/lock/subsys/drbd ] && rm /var/lock/subsys/drbd
log_end_msg 0
;;
status)

View File

@ -0,0 +1,25 @@
diff -Naur drbd-utils-9.0.0.orig/scripts/global_common.conf drbd-utils-9.0.0/scripts/global_common.conf
--- drbd-utils-9.0.0.orig/scripts/global_common.conf 2017-10-16 17:02:55.715528259 +0800
+++ drbd-utils-9.0.0/scripts/global_common.conf 2017-10-16 17:07:49.755636558 +0800
@@ -47,10 +47,10 @@
}
disk {
- # size on-io-error fencing disk-barrier disk-flushes
+ # on-io-error disk-barrier disk-flushes
# disk-drain md-flushes resync-rate resync-after al-extents
- # c-plan-ahead c-delay-target c-fill-target c-max-rate
- # c-min-rate disk-timeout
+ # c-plan-ahead c-delay-target c-fill-target c-max-rate
+ # c-min-rate disk-timeout
}
net {
@@ -60,6 +60,6 @@
# after-sb-1pri after-sb-2pri always-asbp rr-conflict
# ping-timeout data-integrity-alg tcp-cork on-congestion
# congestion-fill congestion-extents csums-alg verify-alg
- # use-rle
+ # use-rle fencing
}
}

13
pie-fix.patch Normal file
View File

@ -0,0 +1,13 @@
Index: drbd-utils-9.14.0/user/drbdmon/Makefile.in
===================================================================
--- drbd-utils-9.14.0.orig/user/drbdmon/Makefile.in
+++ drbd-utils-9.14.0/user/drbdmon/Makefile.in
@@ -1,6 +1,7 @@
CXXFLAGS=-std=c++11 -I. -I../shared -Icppdsaext/src -Wall -Werror --pedantic-errors -fPIC -O2 \
-Wsign-compare -Wpointer-arith -Wswitch-default -Wswitch-enum -Wtype-limits \
--Wmissing-declarations -Wshadow
+-Wmissing-declarations -Wshadow \
+-pie
CXX = @CXX@
LIBS = @LIBS@

69
rpmlint-build-error.patch Normal file
View File

@ -0,0 +1,69 @@
Fix rpmlint Errors:
1. non-executable-script /usr/lib/ocf/resource.d/linbit/drbd.shellfuncs.sh 644 /bin/bash
2. filelist-forbidden-bashcomp-userdirs /etc/bash_completion.d/drbdadm.sh
3. dir-or-file-in-run /run/drbd
diff -Naur drbd-utils-9.19.0.orig/scripts/drbdadm.bash_completion drbd-utils-9.19.0/scripts/drbdadm.bash_completion
--- drbd-utils-9.19.0.orig/scripts/drbdadm.bash_completion 2021-10-11 18:44:02.906467704 +0800
+++ drbd-utils-9.19.0/scripts/drbdadm.bash_completion 2021-10-11 18:48:24.653422443 +0800
@@ -1,5 +1,5 @@
#
-# /etc/bash_completion.d/drbdadm
+# /usr/share/bash-completion/completions/drbdadm
#
# Bash completion for the DRBD top-level management application, drbdadm.
#
diff -Naur drbd-utils-9.19.0.orig/scripts/Makefile.in drbd-utils-9.19.0/scripts/Makefile.in
--- drbd-utils-9.19.0.orig/scripts/Makefile.in 2021-10-11 18:44:02.906467704 +0800
+++ drbd-utils-9.19.0/scripts/Makefile.in 2021-10-11 18:51:21.716712860 +0800
@@ -147,7 +147,7 @@
mkdir -p $(DESTDIR)/usr/lib/ocf/resource.d/linbit
install -m 755 drbd.ocf $(DESTDIR)/usr/lib/ocf/resource.d/linbit/drbd
install -m 755 drbd-attr $(DESTDIR)/usr/lib/ocf/resource.d/linbit/drbd-attr
- install -m 644 drbd.shellfuncs.sh $(DESTDIR)/usr/lib/ocf/resource.d/linbit/
+ install -m 755 drbd.shellfuncs.sh $(DESTDIR)/usr/lib/ocf/resource.d/linbit/
endif
install-rgmanager:
@@ -173,8 +173,8 @@
install-bashcompletion:
ifeq ($(WITH_BASHCOMPLETION),yes)
- mkdir -p $(DESTDIR)$(sysconfdir)/bash_completion.d
- install -m 644 drbdadm.bash_completion $(DESTDIR)$(sysconfdir)/bash_completion.d/drbdadm$(BASH_COMPLETION_SUFFIX)
+ mkdir -p $(DESTDIR)$(datadir)/bash-completion/completions
+ install -m 644 drbdadm.bash_completion $(DESTDIR)$(datadir)/bash-completion/completions/drbdadm
endif
clean:
@@ -195,7 +195,7 @@
rm -f $(DESTDIR)$(sysconfdir)/ha.d/resource.d/drbddisk
rm -f $(DESTDIR)$(sysconfdir)/ha.d/resource.d/drbdupper
rm -f $(DESTDIR)$(sysconfdir)/xen/scripts/block-drbd
- rm -f $(DESTDIR)$(sysconfdir)/bash_completion.d/drbdadm$(BASH_COMPLETION_SUFFIX)
+ rm -f $(DESTDIR)$(datadir)/bash-completion/completions/drbdadm
! test -L $(DESTDIR)/sbin/rcdrbd || rm $(DESTDIR)/sbin/rcdrbd
.PHONY: install uninstall clean distclean
diff -Naur drbd-utils-9.19.0.orig/user/v84/Makefile.in drbd-utils-9.19.0/user/v84/Makefile.in
--- drbd-utils-9.19.0.orig/user/v84/Makefile.in 2021-10-11 18:44:02.918467657 +0800
+++ drbd-utils-9.19.0/user/v84/Makefile.in 2021-10-13 11:39:05.662316197 +0800
@@ -108,7 +108,6 @@
install:
ifeq ($(WITH_84_SUPPORT),yes)
install -d $(DESTDIR)$(localstatedir)/lib/drbd
- install -d $(DESTDIR)$(localstatedir)/run/drbd
install -d $(DESTDIR)$(localstatedir)/lock
install -d $(DESTDIR)/lib/drbd/
if getent group haclient > /dev/null 2> /dev/null ; then \
diff -Naur drbd-utils-9.19.0.orig/user/v9/Makefile.in drbd-utils-9.19.0/user/v9/Makefile.in
--- drbd-utils-9.19.0.orig/user/v9/Makefile.in 2021-10-11 18:44:02.918467657 +0800
+++ drbd-utils-9.19.0/user/v9/Makefile.in 2021-10-13 11:38:48.462390954 +0800
@@ -143,7 +143,6 @@
install:
install -d $(DESTDIR)$(sbindir)
install -d $(DESTDIR)$(localstatedir)/lib/drbd
- install -d $(DESTDIR)$(localstatedir)/run/drbd
install -d $(DESTDIR)$(localstatedir)/lock
if getent group haclient > /dev/null 2> /dev/null ; then \
install -g haclient -m 4750 drbdsetup $(DESTDIR)$(sbindir) ; \

View File

@ -0,0 +1,68 @@
https://en.opensuse.org/openSUSE:Usr_merge
diff -Naur drbd-utils-9.19.0.orig/scripts/Makefile.in drbd-utils-9.19.0/scripts/Makefile.in
--- drbd-utils-9.19.0.orig/scripts/Makefile.in 2021-10-11 17:59:20.189282860 +0800
+++ drbd-utils-9.19.0/scripts/Makefile.in 2021-10-11 18:01:25.988786913 +0800
@@ -39,6 +39,7 @@
UDEV_RULE_SUFFIX = @UDEV_RULE_SUFFIX@
INITDIR = @INITDIR@
LIBDIR = @prefix@/lib/@PACKAGE_TARNAME@
+LIBSCRIPTDIR = @prefix@/lib/@PACKAGE_TARNAME@/scripts
LN_S = @LN_S@
# features enabled or disabled by configure
@@ -87,11 +88,11 @@
install -d $(DESTDIR)$(systemdunitdir)
install -m 644 drbd.service $(DESTDIR)$(systemdunitdir)/
install -m 644 $(SYSTEMD_TEMPLATES) $(DESTDIR)$(systemdunitdir)/
- install -d $(DESTDIR)/lib/drbd/scripts
- install -m 755 drbd $(DESTDIR)/lib/drbd/scripts
- install -m 755 drbd-service-shim.sh $(DESTDIR)/lib/drbd/scripts
- install -m 755 drbd-wait-promotable.sh $(DESTDIR)/lib/drbd/scripts
- install -m 755 ocf.ra.wrapper.sh $(DESTDIR)/lib/drbd/scripts
+ install -d $(DESTDIR)$(LIBSCRIPTDIR)
+ install -m 755 drbd $(DESTDIR)$(LIBSCRIPTDIR)
+ install -m 755 drbd-service-shim.sh $(DESTDIR)$(LIBSCRIPTDIR)
+ install -m 755 drbd-wait-promotable.sh $(DESTDIR)$(LIBSCRIPTDIR)
+ install -m 755 ocf.ra.wrapper.sh $(DESTDIR)$(LIBSCRIPTDIR)
install -d $(DESTDIR)$(tmpfilesdir)/
install -m 444 drbd.tmpfiles.conf $(DESTDIR)$(tmpfilesdir)/drbd.conf
endif
diff -Naur drbd-utils-9.19.0.orig/user/v83/Makefile.in drbd-utils-9.19.0/user/v83/Makefile.in
--- drbd-utils-9.19.0.orig/user/v83/Makefile.in 2021-10-11 17:59:20.217282750 +0800
+++ drbd-utils-9.19.0/user/v83/Makefile.in 2021-10-11 18:07:39.967312613 +0800
@@ -98,11 +98,11 @@
install -d $(DESTDIR)$(localstatedir)/lock
install -d $(DESTDIR)/lib/drbd/
if getent group haclient > /dev/null 2> /dev/null ; then \
- install -g haclient -m 4750 drbdsetup-83 $(DESTDIR)/lib/drbd/ ; \
- install -m 755 drbdadm-83 $(DESTDIR)/lib/drbd/ ; \
+ install -g haclient -m 4750 drbdsetup-83 $(DESTDIR)$(LIBDIR) ; \
+ install -m 755 drbdadm-83 $(DESTDIR)$(LIBDIR) ; \
else \
- install -m 755 drbdsetup-83 $(DESTDIR)/lib/drbd/ ; \
- install -m 755 drbdadm-83 $(DESTDIR)/lib/drbd/ ; \
+ install -m 755 drbdsetup-83 $(DESTDIR)$(LIBDIR) ; \
+ install -m 755 drbdadm-83 $(DESTDIR)$(LIBDIR) ; \
fi
endif
diff -Naur drbd-utils-9.19.0.orig/user/v84/Makefile.in drbd-utils-9.19.0/user/v84/Makefile.in
--- drbd-utils-9.19.0.orig/user/v84/Makefile.in 2021-10-11 17:59:20.221282734 +0800
+++ drbd-utils-9.19.0/user/v84/Makefile.in 2021-10-11 18:07:39.967312613 +0800
@@ -112,11 +112,11 @@
install -d $(DESTDIR)$(localstatedir)/lock
install -d $(DESTDIR)/lib/drbd/
if getent group haclient > /dev/null 2> /dev/null ; then \
- install -g haclient -m 4750 drbdsetup-84 $(DESTDIR)/lib/drbd/ ; \
- install -m 755 drbdadm-84 $(DESTDIR)/lib/drbd/ ; \
+ install -g haclient -m 4750 drbdsetup-84 $(DESTDIR)$(LIBDIR) ; \
+ install -m 755 drbdadm-84 $(DESTDIR)$(LIBDIR) ; \
else \
- install -m 755 drbdsetup-84 $(DESTDIR)/lib/drbd/ ; \
- install -m 755 drbdadm-84 $(DESTDIR)/lib/drbd/ ; \
+ install -m 755 drbdsetup-84 $(DESTDIR)$(LIBDIR) ; \
+ install -m 755 drbdadm-84 $(DESTDIR)$(LIBDIR) ; \
fi
endif