From 8d26044536e826b1247cb5ba5728586858eda14f Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 28 2020 19:24:08 +0000 Subject: import resource-agents-4.1.1-64.el8 --- diff --git a/SOURCES/bz1818997-3-nfsserver-nfsnotify-fix-selinux-label-issue.patch b/SOURCES/bz1818997-3-nfsserver-nfsnotify-fix-selinux-label-issue.patch new file mode 100644 index 0000000..e470d50 --- /dev/null +++ b/SOURCES/bz1818997-3-nfsserver-nfsnotify-fix-selinux-label-issue.patch @@ -0,0 +1,48 @@ +From dbd45cb5fcce0a3378f6ecd0c14b578e6f843e3d Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Fri, 24 Jul 2020 16:03:20 +0200 +Subject: [PATCH 1/2] nfsserver: fix SELinux issue due to newer ls versions + giving additional output. + +This patch has been tested on RHEL6, 7 and 8. +--- + heartbeat/nfsserver | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver +index 0dbc173f3..80d20676b 100755 +--- a/heartbeat/nfsserver ++++ b/heartbeat/nfsserver +@@ -192,7 +192,7 @@ fi + which restorecon > /dev/null 2>&1 && selinuxenabled + SELINUX_ENABLED=$? + if [ $SELINUX_ENABLED -eq 0 ]; then +- export SELINUX_LABEL="$(ls -ldZ $STATD_PATH | cut -f4 -d' ')" ++ export SELINUX_LABEL="$(ls -dZ $STATD_PATH | grep -o '\S\+:\S\+:\S\+')" + fi + + ## + +From 81118dbb25fe2cfc7d5fc803178cd7c3b445915e Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Mon, 27 Jul 2020 10:33:44 +0200 +Subject: [PATCH 2/2] nfsnotify: fix SELinux issue due to newer ls versions + giving additional output. + +--- + heartbeat/nfsnotify.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/heartbeat/nfsnotify.in b/heartbeat/nfsnotify.in +index 7f710bca7..851f6ad6b 100644 +--- a/heartbeat/nfsnotify.in ++++ b/heartbeat/nfsnotify.in +@@ -305,7 +305,7 @@ esac + which restorecon > /dev/null 2>&1 && selinuxenabled + SELINUX_ENABLED=$? + if [ $SELINUX_ENABLED -eq 0 ]; then +- export SELINUX_LABEL="$(ls -ldZ $STATD_PATH | cut -f4 -d' ')" ++ export SELINUX_LABEL="$(ls -dZ $STATD_PATH | grep -o '\S\+:\S\+:\S\+')" + fi + + case $__OCF_ACTION in diff --git a/SOURCES/bz1818997-nfsserver-1-fix-nfsv4-only-support.patch b/SOURCES/bz1818997-nfsserver-1-fix-nfsv4-only-support.patch new file mode 100644 index 0000000..b3efdce --- /dev/null +++ b/SOURCES/bz1818997-nfsserver-1-fix-nfsv4-only-support.patch @@ -0,0 +1,43 @@ +From 47dd1d16f08de06d512f9e04c3966c35f0ac4d3f Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Wed, 27 May 2020 13:05:57 +0200 +Subject: [PATCH] nfsserver: fix NFSv4-only support + +When disabling NFSv2 and NFSv3 mountd doesnt register with rpcbind, but +it's still running. This patch checks that mountd is running instead of +basing its status on it being registered w/rpcbind. +--- + heartbeat/nfsserver | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver +index acef0147a..9e6e1fcb1 100755 +--- a/heartbeat/nfsserver ++++ b/heartbeat/nfsserver +@@ -316,7 +316,7 @@ nfsserver_systemd_monitor() + fi + + ocf_log debug "Status: nfs-mountd" +- rpcinfo -t localhost 100005 > /dev/null 2>&1 ++ ps axww | grep -q "[r]pc.mountd" + rc=$? + if [ "$rc" -ne "0" ]; then + ocf_exit_reason "nfs-mountd is not running" +@@ -683,7 +683,7 @@ nfsserver_start () + local i=1 + while : ; do + ocf_log info "Start: nfs-mountd i: $i" +- rpcinfo -t localhost 100005 > /dev/null 2>&1 ++ ps axww | grep -q "[r]pc.mountd" + rc=$? + if [ "$rc" -eq "0" ]; then + break; +@@ -800,7 +800,7 @@ nfsserver_stop () + + nfs_exec stop nfs-mountd > /dev/null 2>&1 + ocf_log info "Stop: nfs-mountd" +- rpcinfo -t localhost 100005 > /dev/null 2>&1 ++ ps axww | grep -q "[r]pc.mountd" + rc=$? + if [ "$rc" -eq "0" ]; then + ocf_exit_reason "Failed to stop nfs-mountd" diff --git a/SOURCES/bz1818997-nfsserver-2-stop-nfsdcld-if-present.patch b/SOURCES/bz1818997-nfsserver-2-stop-nfsdcld-if-present.patch new file mode 100644 index 0000000..085a39a --- /dev/null +++ b/SOURCES/bz1818997-nfsserver-2-stop-nfsdcld-if-present.patch @@ -0,0 +1,34 @@ +From 290741f43ff414630f558ee3432e830e39d1599d Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Wed, 22 Jul 2020 11:56:32 +0200 +Subject: [PATCH] nfsserver: stop nfsdcld if present during stop-action + +--- + heartbeat/nfsserver | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver +index 9e6e1fcb1..0dbc173f3 100755 +--- a/heartbeat/nfsserver ++++ b/heartbeat/nfsserver +@@ -806,6 +806,20 @@ nfsserver_stop () + ocf_exit_reason "Failed to stop nfs-mountd" + return $OCF_ERR_GENERIC + fi ++ ++ if systemctl --no-legend list-unit-files "nfsdcld*" | grep -q nfsdcld; then ++ nfs_exec stop nfsdcld > /dev/null 2>&1 ++ ocf_log info "Stop: nfsdcld" ++ fn=`mktemp` ++ nfs_exec status nfsdcld > $fn 2>&1 ++ rc=$? ++ ocf_log debug "$(cat $fn)" ++ rm -f $fn ++ if [ "$rc" -eq "0" ]; then ++ ocf_exit_reason "Failed to stop nfsdcld" ++ return $OCF_ERR_GENERIC ++ fi ++ fi + esac + + diff --git a/SOURCES/bz1818997-nfsserver-fix-nfsv4-only-support.patch b/SOURCES/bz1818997-nfsserver-fix-nfsv4-only-support.patch deleted file mode 100644 index b3efdce..0000000 --- a/SOURCES/bz1818997-nfsserver-fix-nfsv4-only-support.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 47dd1d16f08de06d512f9e04c3966c35f0ac4d3f Mon Sep 17 00:00:00 2001 -From: Oyvind Albrigtsen -Date: Wed, 27 May 2020 13:05:57 +0200 -Subject: [PATCH] nfsserver: fix NFSv4-only support - -When disabling NFSv2 and NFSv3 mountd doesnt register with rpcbind, but -it's still running. This patch checks that mountd is running instead of -basing its status on it being registered w/rpcbind. ---- - heartbeat/nfsserver | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver -index acef0147a..9e6e1fcb1 100755 ---- a/heartbeat/nfsserver -+++ b/heartbeat/nfsserver -@@ -316,7 +316,7 @@ nfsserver_systemd_monitor() - fi - - ocf_log debug "Status: nfs-mountd" -- rpcinfo -t localhost 100005 > /dev/null 2>&1 -+ ps axww | grep -q "[r]pc.mountd" - rc=$? - if [ "$rc" -ne "0" ]; then - ocf_exit_reason "nfs-mountd is not running" -@@ -683,7 +683,7 @@ nfsserver_start () - local i=1 - while : ; do - ocf_log info "Start: nfs-mountd i: $i" -- rpcinfo -t localhost 100005 > /dev/null 2>&1 -+ ps axww | grep -q "[r]pc.mountd" - rc=$? - if [ "$rc" -eq "0" ]; then - break; -@@ -800,7 +800,7 @@ nfsserver_stop () - - nfs_exec stop nfs-mountd > /dev/null 2>&1 - ocf_log info "Stop: nfs-mountd" -- rpcinfo -t localhost 100005 > /dev/null 2>&1 -+ ps axww | grep -q "[r]pc.mountd" - rc=$? - if [ "$rc" -eq "0" ]; then - ocf_exit_reason "Failed to stop nfs-mountd" diff --git a/SOURCES/bz1819965-3-azure-events-decode-when-type-not-str.patch b/SOURCES/bz1819965-3-azure-events-decode-when-type-not-str.patch new file mode 100644 index 0000000..3c62631 --- /dev/null +++ b/SOURCES/bz1819965-3-azure-events-decode-when-type-not-str.patch @@ -0,0 +1,59 @@ +From 57424bd1f158f1ff597034e09ca90da864925a16 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Thu, 16 Jul 2020 09:58:55 +0200 +Subject: [PATCH] azure-events: only decode() when exec() output not of type + str + +--- + heartbeat/azure-events.in | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/heartbeat/azure-events.in b/heartbeat/azure-events.in +index a48a86309..d4a166d9f 100644 +--- a/heartbeat/azure-events.in ++++ b/heartbeat/azure-events.in +@@ -179,6 +179,8 @@ class clusterHelper: + ocf.logger.debug("_exec: cmd = %s" % " ".join(command)) + try: + ret = subprocess.check_output(command) ++ if type(ret) != str: ++ ret = ret.decode() + ocf.logger.debug("_exec: return = %s" % ret) + return ret.rstrip() + except Exception as err: +@@ -232,7 +234,7 @@ class clusterHelper: + + nodes = [] + nodeList = clusterHelper._exec("crm_node", "--list") +- for n in nodeList.decode().split("\n"): ++ for n in nodeList.split("\n"): + nodes.append(n.split()[1]) + ocf.logger.debug("getAllNodes: finished; return %s" % str(nodes)) + +@@ -303,7 +305,7 @@ class clusterHelper: + ocf.logger.warning("transitionSummary: received unexpected transition summary: %s" % summary) + return False + summary = summary.split("Transition Summary:")[1] +- ret = summary.decode().split("\n").pop(0) ++ ret = summary.split("\n").pop(0) + + ocf.logger.debug("transitionSummary: finished; return = %s" % str(ret)) + return ret +@@ -324,7 +326,7 @@ class clusterHelper: + if len(resources) == 0: + ret = [] + else: +- ret = resources.decode().split("\n") ++ ret = resources.split("\n") + + ocf.logger.debug("listOperationsOnNode: finished; return = %s" % str(ret)) + return ret +@@ -470,7 +472,7 @@ class Node: + + eventIDStr = clusterHelper.getAttr(attr_pendingEventIDs, node=node) + if eventIDStr: +- eventIDs = eventIDStr.decode().split(",") ++ eventIDs = eventIDStr.split(",") + else: + eventIDs = None + diff --git a/SOURCES/bz1819965-4-azure-events-import-urlerror-encode-postdata.patch b/SOURCES/bz1819965-4-azure-events-import-urlerror-encode-postdata.patch new file mode 100644 index 0000000..2e95152 --- /dev/null +++ b/SOURCES/bz1819965-4-azure-events-import-urlerror-encode-postdata.patch @@ -0,0 +1,32 @@ +From 14765fca34efb80598463aba49a48758ffca598c Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Mon, 27 Jul 2020 10:09:43 +0200 +Subject: [PATCH] azure-events: import URLError in Python 3+ and encode + postData when necessary + +--- + heartbeat/azure-events.in | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/heartbeat/azure-events.in b/heartbeat/azure-events.in +index d4a166d9f..4eed376fb 100644 +--- a/heartbeat/azure-events.in ++++ b/heartbeat/azure-events.in +@@ -15,6 +15,7 @@ try: + import urllib2 + except ImportError: + import urllib.request as urllib2 ++ from urllib.error import URLError + import socket + from collections import defaultdict + +@@ -79,6 +80,9 @@ class azHelper: + ocf.logger.debug("_sendMetadataRequest: begin; endpoint = %s, postData = %s" % (endpoint, postData)) + ocf.logger.debug("_sendMetadataRequest: url = %s" % url) + ++ if postData and type(postData) != bytes: ++ postData = postData.encode() ++ + req = urllib2.Request(url, postData) + req.add_header("Metadata", "true") + req.add_header("User-Agent", USER_AGENT) diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec index 8738405..4e59e7b 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: 60%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 64%{?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} @@ -215,7 +215,7 @@ Patch123: bz1744190-pgsql-1-set-primary-standby-initial-score.patch Patch124: bz1744190-pgsql-2-improve-start-checks.patch Patch125: bz1820523-exportfs-1-add-symlink-support.patch Patch126: bz1832321-rabbitmq-cluster-increase-wait-timeout.patch -Patch127: bz1818997-nfsserver-fix-nfsv4-only-support.patch +Patch127: bz1818997-nfsserver-1-fix-nfsv4-only-support.patch Patch128: bz1830716-NovaEvacuate-suppress-expected-error.patch Patch129: bz1836945-db2-hadr-promote-standby-node.patch Patch130: bz1633251-gcp-pd-move-4-fixes-and-improvements.patch @@ -229,6 +229,10 @@ Patch137: bz1845583-exportfs-1-describe-clientspec-format-in-metadata.patch Patch138: bz1845583-exportfs-2-fix-typo.patch Patch139: bz1814896-Filesystem-fast_stop-default-to-no-for-GFS2.patch Patch140: bz1836186-pgsql-support-Pacemaker-v2.03-output.patch +Patch141: bz1819965-3-azure-events-decode-when-type-not-str.patch +Patch142: bz1818997-nfsserver-2-stop-nfsdcld-if-present.patch +Patch143: bz1818997-3-nfsserver-nfsnotify-fix-selinux-label-issue.patch +Patch144: bz1819965-4-azure-events-import-urlerror-encode-postdata.patch # bundle patches Patch1000: 7-gcp-bundled.patch @@ -518,6 +522,10 @@ exit 1 %patch138 -p1 %patch139 -p1 %patch140 -p1 +%patch141 -p1 +%patch142 -p1 +%patch143 -p1 +%patch144 -p1 chmod 755 heartbeat/nova-compute-wait chmod 755 heartbeat/NovaEvacuate @@ -1081,6 +1089,13 @@ ccs_update_schema > /dev/null 2>&1 ||: %endif %changelog +* Mon Jul 27 2020 Oyvind Albrigtsen - 4.1.1-64 +- nfsserver: fix NFSv4-only support +- azure-events: new resource agent for Azure + + Resolves: rhbz#1818997 + Resolves: rhbz#1819965 + * Thu Jun 25 2020 Oyvind Albrigtsen - 4.1.1-60 - Upgrade bundled python-httplib2 to fix CVE-2020-11078 @@ -1123,11 +1138,9 @@ ccs_update_schema > /dev/null 2>&1 ||: Resolves: rhbz#1633251 * Wed May 27 2020 Oyvind Albrigtsen - 4.1.1-51 -- nfsserver: fix NFSv4-only support - NovaEvacuate: suppress expected initial error message - db2 (HADR): promote standby node when master node disappears - Resolves: rhbz#1818997 Resolves: rhbz#1830716 Resolves: rhbz#1836945 @@ -1144,12 +1157,6 @@ ccs_update_schema > /dev/null 2>&1 ||: Resolves: rhbz#1759115 Resolves: rhbz#1744190 -* Thu Apr 16 2020 Oyvind Albrigtsen - 4.1.1-48 -- azure-events: new resource agent for Azure - - Resolves: rhbz#1633251 - Resolves: rhbz#1819965 - * Mon Apr 6 2020 Oyvind Albrigtsen - 4.1.1-47 - aws-vpc-move-ip: delete remaining route entries