diff --git a/SOURCES/bz1891883-ethmonitor-vlan-fix.patch b/SOURCES/bz1891883-ethmonitor-vlan-fix.patch new file mode 100644 index 0000000..ffe74d1 --- /dev/null +++ b/SOURCES/bz1891883-ethmonitor-vlan-fix.patch @@ -0,0 +1,25 @@ +From 7f7ca75100a846242ff1510fd9bcf299cd3d00eb Mon Sep 17 00:00:00 2001 +From: Aleksei Burlakov +Date: Mon, 26 Oct 2020 13:25:45 +0100 +Subject: [PATCH] ethmonitor: is_interface: RE matches vlan names + +Vlan names end not with : but are suffixed with the @devices-name +--- + heartbeat/ethmonitor | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/heartbeat/ethmonitor b/heartbeat/ethmonitor +index e791fbe9d..cf0321ab4 100755 +--- a/heartbeat/ethmonitor ++++ b/heartbeat/ethmonitor +@@ -230,8 +230,8 @@ is_interface() { + # + # List interfaces but exclude FreeS/WAN ipsecN virtual interfaces + # +- local iface=`$IP2UTIL -o -f inet addr show | grep " $1 " \ +- | cut -d ' ' -f2 | sort -u | grep -v '^ipsec[0-9][0-9]*$'` ++ local iface=`$IP2UTIL -o -f link addr show | grep -e " $1[:@]" \ ++ | cut -d ' ' -f2 | tr -d ':' | cut -d '@' -f1 | sort -u | grep -v '^ipsec[0-9][0-9]*$'` + [ "$iface" != "" ] + } + diff --git a/SOURCES/bz1902045-iface-vlan-vlan-not-unique.patch b/SOURCES/bz1902045-iface-vlan-vlan-not-unique.patch new file mode 100644 index 0000000..b8448cf --- /dev/null +++ b/SOURCES/bz1902045-iface-vlan-vlan-not-unique.patch @@ -0,0 +1,40 @@ +From 3dd051ed56418dc241417ea02e59db3982b7b92c Mon Sep 17 00:00:00 2001 +From: Oliver Freyermuth +Date: Thu, 26 Nov 2020 10:25:01 +0100 +Subject: [PATCH] heartbeat/iface-vlan: vlan_{interface,id} do not have to be + unique. + +Machines commonly have several vlan_id attached to one interface, +and may also have a vlan_id attached to several interfaces. + +vlan_name will still be unique, usual names are: +- bond_in.83@bond_in +- bond_in.84@bond_in + +fixes #1581 +--- + heartbeat/iface-vlan | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/heartbeat/iface-vlan b/heartbeat/iface-vlan +index cbe7e86da..d0481373c 100755 +--- a/heartbeat/iface-vlan ++++ b/heartbeat/iface-vlan +@@ -89,7 +89,7 @@ vlan_meta_data() { + + + +- ++ + + Define the interface where VLAN should be attached. + +@@ -99,7 +99,7 @@ vlan_meta_data() { + + + +- ++ + + Define the VLAN ID. It has to be a value between 0 and 4094. + diff --git a/SOURCES/bz1924363-nfsserver-error-check-unmount.patch b/SOURCES/bz1924363-nfsserver-error-check-unmount.patch new file mode 100644 index 0000000..e77e92d --- /dev/null +++ b/SOURCES/bz1924363-nfsserver-error-check-unmount.patch @@ -0,0 +1,57 @@ +From dc4fc6fb51481e62c763212129e7dbae4cb663fd Mon Sep 17 00:00:00 2001 +From: Reid Wahl +Date: Tue, 2 Feb 2021 17:55:40 -0800 +Subject: [PATCH] nfsserver: Error-check unbind_tree + +Fail to stop if unmounting rpcpipefs_dir or /var/lib/nfs fails. + +Resolves: RHBZ#1924363 + +Signed-off-by: Reid Wahl +--- + heartbeat/nfsserver | 23 ++++++++++++++++++++--- + 1 file changed, 20 insertions(+), 3 deletions(-) + +diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver +index 80d20676b..96b19abe3 100755 +--- a/heartbeat/nfsserver ++++ b/heartbeat/nfsserver +@@ -465,9 +465,20 @@ unbind_tree () + sleep 1 + i=$((i + 1)) + done ++ ++ if mount | grep -q " on $OCF_RESKEY_rpcpipefs_dir "; then ++ ocf_log err "Failed to unmount $OCF_RESKEY_rpcpipefs_dir" ++ return $OCF_ERR_GENERIC ++ fi ++ + if is_bound /var/lib/nfs; then +- umount /var/lib/nfs ++ if ! umount /var/lib/nfs; then ++ ocf_log err "Failed to unmount /var/lib/nfs" ++ return $OCF_ERR_GENERIC ++ fi + fi ++ ++ return $OCF_SUCCESS + } + + binary_status() +@@ -836,8 +847,14 @@ nfsserver_stop () + esac + + unbind_tree +- ocf_log info "NFS server stopped" +- return 0 ++ rc=$? ++ if [ "$rc" -ne $OCF_SUCCESS ]; then ++ ocf_exit_reason "Failed to unmount a bind mount" ++ else ++ ocf_log info "NFS server stopped" ++ fi ++ ++ return $rc + } + + nfsserver_validate () diff --git a/SOURCES/bz1932863-VirtualDomain-fix-pid-status.patch b/SOURCES/bz1932863-VirtualDomain-fix-pid-status.patch new file mode 100644 index 0000000..95f2f96 --- /dev/null +++ b/SOURCES/bz1932863-VirtualDomain-fix-pid-status.patch @@ -0,0 +1,31 @@ +From 500de79739cd39808fb48fa556c9b9b9fe2e8acd Mon Sep 17 00:00:00 2001 +From: Matthias Hensler +Date: Thu, 18 Feb 2021 12:49:49 +0100 +Subject: [PATCH] fix pid_status() for VirtualDomain on EL8 + +see https://github.com/ClusterLabs/resource-agents/issues/1613 +--- + heartbeat/VirtualDomain | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/heartbeat/VirtualDomain b/heartbeat/VirtualDomain +index eb41e3e22..f9cd21fc7 100755 +--- a/heartbeat/VirtualDomain ++++ b/heartbeat/VirtualDomain +@@ -421,14 +421,14 @@ pid_status() + case "$emulator" in + qemu-kvm|qemu-dm|qemu-system-*) + rc=$OCF_NOT_RUNNING +- ps awx | grep -E "[q]emu-(kvm|dm|system).*-name $DOMAIN_NAME " > /dev/null 2>&1 ++ ps awx | grep -E "[q]emu-(kvm|dm|system).*-name ($DOMAIN_NAME|[^ ]*guest=$DOMAIN_NAME(,[^ ]*)?) " > /dev/null 2>&1 + if [ $? -eq 0 ]; then + rc=$OCF_SUCCESS + fi + ;; + libvirt_lxc) + rc=$OCF_NOT_RUNNING +- ps awx | grep -E "[l]ibvirt_lxc.*-name $DOMAIN_NAME " > /dev/null 2>&1 ++ ps awx | grep -E "[l]ibvirt_lxc.*-name ($DOMAIN_NAME|[^ ]*guest=$DOMAIN_NAME(,[^ ]*)?) " > /dev/null 2>&1 + if [ $? -eq 0 ]; then + rc=$OCF_SUCCESS + fi diff --git a/SOURCES/bz1937142-azure-lb-redirect-to-avoid-nc-dying-EPIPE-error.patch b/SOURCES/bz1937142-azure-lb-redirect-to-avoid-nc-dying-EPIPE-error.patch deleted file mode 100644 index 699dc50..0000000 --- a/SOURCES/bz1937142-azure-lb-redirect-to-avoid-nc-dying-EPIPE-error.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 760680df771b6e2a9fbcd2f6d9862df4ec1a86de Mon Sep 17 00:00:00 2001 -From: Reid Wahl -Date: Tue, 9 Mar 2021 18:25:52 -0800 -Subject: [PATCH 1/2] azure-lb: Be quiet during stop operation - -Currently, it logs "kill () No such process" to stderr during stops. - -A stop operation is expected to run `kill -s 0 $pid` for a nonexistent -PID, so log that at debug level. - -A start or monitor operation's `kill -s 0 $pid` should always succeed, -so any output is unexpected and an error. - -Also remove "local" bashism. - -Signed-off-by: Reid Wahl ---- - heartbeat/azure-lb | 22 ++++++++++++++-------- - 1 file changed, 14 insertions(+), 8 deletions(-) - -diff --git a/heartbeat/azure-lb b/heartbeat/azure-lb -index 65a12235b..863132744 100755 ---- a/heartbeat/azure-lb -+++ b/heartbeat/azure-lb -@@ -93,12 +93,18 @@ getpid() { - - lb_monitor() { - if test -f "$pidfile"; then -- if pid=`getpid $pidfile` && [ "$pid" ] && kill -s 0 $pid; then -- return $OCF_SUCCESS -- else -- # pidfile w/o process means the process died -- return $OCF_ERR_GENERIC -+ [ "$__OCF_ACTION" = "stop" ] && level="debug" || level="err" -+ -+ if pid=$(getpid "$pidfile") && [ -n "$pid" ]; then -+ output=$(kill -s 0 "$pid" 2>&1) -+ mon_rc=$? -+ -+ [ -n "$output" ] && ocf_log "$level" "$output" -+ [ "$mon_rc" -eq 0 ] && return $OCF_SUCCESS - fi -+ -+ # pidfile w/o process means the process died -+ return $OCF_ERR_GENERIC - else - return $OCF_NOT_RUNNING - fi -@@ -131,7 +137,7 @@ lb_start() { - } - - lb_stop() { -- local rc=$OCF_SUCCESS -+ stop_rc=$OCF_SUCCESS - - if [ -n "$OCF_RESKEY_CRM_meta_timeout" ]; then - # Allow 2/3 of the action timeout for the orderly shutdown -@@ -160,7 +166,7 @@ lb_stop() { - while :; do - if ! lb_monitor; then - ocf_log warn "SIGKILL did the job." -- rc=$OCF_SUCCESS -+ stop_rc=$OCF_SUCCESS - break - fi - ocf_log info "The job still hasn't stopped yet. Waiting..." -@@ -168,7 +174,7 @@ lb_stop() { - done - fi - rm -f $pidfile -- return $rc -+ return $stop_rc - } - - lb_validate() { - -From 10f39e90d6b04c28752a4f9adc94dfc03d9d61b8 Mon Sep 17 00:00:00 2001 -From: Reid Wahl -Date: Tue, 9 Mar 2021 18:32:45 -0800 -Subject: [PATCH 2/2] azure-lb: Redirect stdout and stderr to /dev/null - -This fixes a regression introduced in commit d22700fc. - -When the nc listener process created by an azure-lb resource attempts to -write to stdout, it dies with an EPIPE error. - -This can happen when random/garbage input is sent to the nc listener, as -may happen during a port scan. For example, if the listener is on port -62000, and a client sends some text (e.g., `echo test | nc node1 -62000`), then the listener attempts to echo "test" to its stdout. This -fails with an EPIPE. - -Prior to commit d22700fc, all output was redirected to the pid file. -This caused its own problems, but it prevented this particular behavior. - -The fix is to redirect the listener's stdout and stderr to /dev/null. - -Resolves: RHBZ#1937142 -Resolves: RHBZ#1937151 - -Signed-off-by: Reid Wahl ---- - heartbeat/azure-lb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/heartbeat/azure-lb b/heartbeat/azure-lb -index 863132744..ade1b4577 100755 ---- a/heartbeat/azure-lb -+++ b/heartbeat/azure-lb -@@ -119,7 +119,7 @@ lb_start() { - if ! lb_monitor; then - ocf_log debug "Starting $process: $cmd" - # Execute the command as created above -- $cmd & -+ $cmd >/dev/null 2>&1 & - echo $! > $pidfile - if lb_monitor; then - ocf_log debug "$process: $cmd started successfully, calling monitor" diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec index 780504f..898a251 100644 --- a/SPECS/resource-agents.spec +++ b/SPECS/resource-agents.spec @@ -70,7 +70,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.1.1 -Release: 89%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 88%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} @@ -265,7 +265,10 @@ Patch173: bz1903677-ocf-shellfuncs-fix-traceback-redirection-bash5.patch Patch174: bz1913932-1-gcp-vpc-move-add-project-parameter.patch Patch175: bz1913932-2-gcp-vpc-move-route-fixes.patch Patch176: bz1913932-3-gcp-vpc-move-route-make-vpc_network-optional.patch -Patch177: bz1937142-azure-lb-redirect-to-avoid-nc-dying-EPIPE-error.patch +Patch177: bz1891883-ethmonitor-vlan-fix.patch +Patch178: bz1902045-iface-vlan-vlan-not-unique.patch +Patch179: bz1924363-nfsserver-error-check-unmount.patch +Patch180: bz1932863-VirtualDomain-fix-pid-status.patch # bundle patches Patch1000: 7-gcp-bundled.patch @@ -599,6 +602,9 @@ exit 1 %patch175 -p1 %patch176 -p1 %patch177 -p1 +%patch178 -p1 +%patch179 -p1 +%patch180 -p1 chmod 755 heartbeat/nova-compute-wait chmod 755 heartbeat/NovaEvacuate @@ -1162,10 +1168,14 @@ ccs_update_schema > /dev/null 2>&1 ||: %endif %changelog -* Thu Mar 11 2021 Oyvind Albrigtsen - 4.1.1-89 -- azure-lb: redirect to avoid nc dying with EPIPE error +* Mon Mar 8 2021 Oyvind Albrigtsen - 4.1.1-88 +- ethmonitor: fix vlan regex +- iface-vlan: make vlan parameter not unique +- nfsserver: error-check unmount +- VirtualDomain: fix pid status regex + + Resolves: rhbz#1891883, rhbz#1902045, rhbz#1924363, rhbz#1932863 - Resolves: rhbz#1937142 * Thu Feb 25 2021 Oyvind Albrigtsen - 4.1.1-87 - gcp-vpc-move-route, gcp-vpc-move-vip: add project parameter and