From 7082708af4517afce8f39d3f2b246947cac48ca1 Mon Sep 17 00:00:00 2001 From: chengzihan2 Date: Thu, 7 May 2020 16:55:16 +0800 Subject: [PATCH 1/9] add pcp.yaml --- pcp.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 pcp.yaml diff --git a/pcp.yaml b/pcp.yaml new file mode 100644 index 0000000..d207ca5 --- /dev/null +++ b/pcp.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: performancecopilot/pcp +tag_prefix: ^ +seperator: . -- Gitee From 188e04db889fff691f0224b6ee95a1a1f3f36a29 Mon Sep 17 00:00:00 2001 From: hht8 Date: Wed, 13 May 2020 17:22:16 +0800 Subject: [PATCH 2/9] fix CVE-2019-3695 CVE-2019-3696 --- CVE-2019-3695-CVE-2019-3696.patch | 200 ++++++++++++++++++++++++++++++ pcp.spec | 11 +- 2 files changed, 210 insertions(+), 1 deletion(-) create mode 100644 CVE-2019-3695-CVE-2019-3696.patch diff --git a/CVE-2019-3695-CVE-2019-3696.patch b/CVE-2019-3695-CVE-2019-3696.patch new file mode 100644 index 0000000..9b10703 --- /dev/null +++ b/CVE-2019-3695-CVE-2019-3696.patch @@ -0,0 +1,200 @@ +From 34c83f7ee46224fe410572f33c57a739f7bd044f Mon Sep 17 00:00:00 2001 +From: Nathan Scott +Date: Sun, 6 Oct 2019 14:10:40 +1100 +Subject: [PATCH] build: drop old config file transition code from rpm specs + +Its been many years since this transition was done, good time +now with pcp-5.0.0 to full this old shell code. Also remove +the Fedora crontab transition logic as thats completely moved +over to systemd now. +--- + build/rpm/GNUmakefile | 1 + + build/rpm/fedora.spec | 57 +--------------------------------------- + build/rpm/pcp.spec.in | 60 ++----------------------------------------- + 3 files changed, 4 insertions(+), 114 deletions(-) + +diff --git a/build/rpm/GNUmakefile b/build/rpm/GNUmakefile +index cf6d21f..40a9efe 100644 +--- a/build/rpm/GNUmakefile ++++ b/build/rpm/GNUmakefile +@@ -111,6 +111,7 @@ pcp.spec: pcp.spec.in + -e's|@pcp_sysconf_dir@|$(PCP_SYSCONF_DIR)|g' \ + -e's|@pcp_share_dir@|$(PCP_SHARE_DIR)|g' \ + -e's|@pcp_log_dir@|$(PCP_LOG_DIR)|g' \ ++ -e's|@pcp_sa_dir@|$(PCP_LOG_DIR)|g' \ + -e's|@pcp_var_dir@|$(PCP_VAR_DIR)|g' \ + -e's|@pcp_etc_dir@|$(PCP_ETC_DIR)|g' \ + -e's|@pcp_binadm_dir@|$(PCP_BINADM_DIR)|g' \ +diff --git a/build/rpm/fedora.spec b/build/rpm/fedora.spec +index 0471dbd..1256926 100644 +--- a/build/rpm/fedora.spec ++++ b/build/rpm/fedora.spec +@@ -2427,56 +2427,6 @@ exit 0 + getent group pcp >/dev/null || groupadd -r pcp + getent passwd pcp >/dev/null || \ + useradd -c "Performance Co-Pilot" -g pcp -d %{_localstatedir}/lib/pcp -M -r -s /sbin/nologin pcp +-PCP_CONFIG_DIR=%{_localstatedir}/lib/pcp/config +-PCP_SYSCONF_DIR=%{_confdir} +-PCP_LOG_DIR=%{_logsdir} +-PCP_ETC_DIR=%{_sysconfdir} +-# rename crontab files to align with current Fedora packaging guidelines +-for crontab in pmlogger pmie +-do +- test -f "$PCP_ETC_DIR/cron.d/$crontab" || continue +- mv -f "$PCP_ETC_DIR/cron.d/$crontab" "$PCP_ETC_DIR/cron.d/pcp-$crontab" +-done +-# produce a script to run post-install to move configs to their new homes +-save_configs_script() +-{ +- _new="$1" +- shift +- for _dir +- do +- [ "$_dir" = "$_new" ] && continue +- if [ -d "$_dir" ] +- then +- ( cd "$_dir" ; find . -maxdepth 1 -type f ) | sed -e 's/^\.\///' \ +- | while read _file +- do +- [ "$_file" = "control" ] && continue +- _want=true +- if [ -f "$_new/$_file" ] +- then +- # file exists in both directories, pick the more +- # recently modified one +- _try=`find "$_dir/$_file" -newer "$_new/$_file" -print` +- [ -n "$_try" ] || _want=false +- fi +- $_want && echo cp -p "$_dir/$_file" "$_new/$_file" +- done +- fi +- done +-} +-# migrate and clean configs if we have had a previous in-use installation +-[ -d "$PCP_LOG_DIR" ] || exit 0 # no configuration file upgrades required +-rm -f "$PCP_LOG_DIR/configs.sh" +-for daemon in pmie pmlogger +-do +- save_configs_script >> "$PCP_LOG_DIR/configs.sh" "$PCP_CONFIG_DIR/$daemon" \ +- "$PCP_SYSCONF_DIR/$daemon" +-done +-for daemon in pmcd pmproxy +-do +- save_configs_script >> "$PCP_LOG_DIR/configs.sh" "$PCP_SYSCONF_DIR/$daemon"\ +- "$PCP_CONFIG_DIR/$daemon" /etc/$daemon +-done + exit 0 + + %if !%{disable_microhttpd} +@@ -2828,11 +2778,7 @@ pmieconf -c enable dmthin + %{pmda_notready "$1" "prometheus"} + + %post +-PCP_LOG_DIR=%{_logsdir} + PCP_PMNS_DIR=%{_pmnsdir} +-# restore saved configs, if any +-test -s "$PCP_LOG_DIR/configs.sh" && source "$PCP_LOG_DIR/configs.sh" +-rm -f $PCP_LOG_DIR/configs.sh + + chown -R pcp:pcp %{_logsdir}/pmcd 2>/dev/null + chown -R pcp:pcp %{_logsdir}/pmlogger 2>/dev/null +@@ -2860,7 +2806,7 @@ chmod 644 "$PCP_PMNS_DIR/.NeedRebuild" + /sbin/service pmproxy condrestart + %endif + +-cd $PCP_PMNS_DIR && ./Rebuild -s && rm -f .NeedRebuild ++cd "$PCP_PMNS_DIR" && ./Rebuild -s && rm -f .NeedRebuild + cd + + %post libs -p /sbin/ldconfig +diff --git a/build/rpm/pcp.spec.in b/build/rpm/pcp.spec.in +index dba589e..c37e934 100755 +--- a/build/rpm/pcp.spec.in ++++ b/build/rpm/pcp.spec.in +@@ -2764,11 +2764,6 @@ chown -R pcpqa:pcpqa @pcp_var_dir@/testsuite 2>/dev/null + getent group pcp >/dev/null || groupadd -r pcp + getent passwd pcp >/dev/null || \ + useradd -c "Performance Co-Pilot" -g pcp -d @pcp_var_dir@ -M -r -s /sbin/nologin pcp +-# new directories; they should match /etc/pcp.conf settings after install +-PCP_CONFIG_DIR=@pcp_var_dir@/config +-PCP_SYSCONF_DIR=@pcp_sysconf_dir@ +-PCP_LOG_DIR=@pcp_log_dir@ +-PCP_ETC_DIR=@pcp_etc_dir@ + + # transition pmdadmcache over to pmdadm (device mapper) + PCP_PMCDCONF_PATH=@pcp_pmcdconf_path@ +@@ -2780,52 +2780,6 @@ + touch "$PCP_PMDAS_DIR/dmcache/.NeedRemove" + fi + +-# rename crontab files to align with current Fedora packaging guidelines +-for crontab in pmlogger pmie +-do +- test -f "$PCP_ETC_DIR/cron.d/$crontab" || continue +- mv -f "$PCP_ETC_DIR/cron.d/$crontab" "$PCP_ETC_DIR/cron.d/pcp-$crontab" +-done +-# produce a script to run post-install to move configs to their new homes +-save_configs_script() +-{ +- _new="$1" +- shift +- for _dir +- do +- [ "$_dir" = "$_new" ] && continue +- if [ -d "$_dir" ] +- then +- ( cd "$_dir" ; find . -maxdepth 1 -type f ) | sed -e 's/^\.\///' \ +- | while read _file +- do +- [ "$_file" = "control" ] && continue +- _want=true +- if [ -f "$_new/$_file" ] +- then +- # file exists in both directories, pick the more +- # recently modified one +- _try=`find "$_dir/$_file" -newer "$_new/$_file" -print` +- [ -n "$_try" ] || _want=false +- fi +- $_want && echo cp -p "$_dir/$_file" "$_new/$_file" +- done +- fi +- done +-} +-# migrate and clean configs if we have had a previous in-use installation +-[ -d "$PCP_LOG_DIR" ] || exit 0 # no configuration file upgrades required +-rm -f "$PCP_LOG_DIR/configs.sh" +-for daemon in pmie pmlogger +-do +- save_configs_script >> "$PCP_LOG_DIR/configs.sh" "$PCP_CONFIG_DIR/$daemon" \ +- "$PCP_SYSCONF_DIR/$daemon" +-done +-for daemon in pmcd pmproxy +-do +- save_configs_script >> "$PCP_LOG_DIR/configs.sh" "$PCP_SYSCONF_DIR/$daemon"\ +- "$PCP_CONFIG_DIR/$daemon" /etc/$daemon +-done + exit 0 + + %if "@enable_webapi@" == "true" +@@ -3191,11 +3129,7 @@ fi + %post + PCP_PMNS_DIR=@pcp_var_dir@/pmns + PCP_LOG_DIR=@pcp_log_dir@ +-PCP_SYSCONFIG_DIR=@pcp_sysconfig_dir@ +- +-# restore saved configs, if any +-test -s "$PCP_LOG_DIR/configs.sh" && source "$PCP_LOG_DIR/configs.sh" +-rm -f $PCP_LOG_DIR/configs.sh ++PCP_SA_DIR=@pcp_sa_dir@ + + chown -R pcp:pcp "$PCP_LOG_DIR/pmcd" 2>/dev/null + chown -R pcp:pcp "$PCP_LOG_DIR/pmlogger" 2>/dev/null +@@ -3224,7 +3158,7 @@ chmod 644 "$PCP_PMNS_DIR/.NeedRebuild" + /sbin/service pmproxy condrestart + %endif + +-cd $PCP_PMNS_DIR && ./Rebuild -s && rm -f .NeedRebuild ++cd "$PCP_PMNS_DIR" && ./Rebuild -s && rm -f .NeedRebuild + cd + + %post libs -p /sbin/ldconfig diff --git a/pcp.spec b/pcp.spec index 9028df2..5817199 100644 --- a/pcp.spec +++ b/pcp.spec @@ -9,7 +9,7 @@ Name: pcp Version: 4.1.3 Summary: System-level performance monitoring and performance management -Release: 3 +Release: 4 License: GPLv2+ and LGPLv2.1+ and CC-BY URL: https://pcp.io Source0: https://dl.bintray.com/pcp/source/pcp-4.1.3.tar.gz @@ -17,6 +17,8 @@ Source1: https://github.com/performancecopilot/pcp-webapp-vector/archiv Source2: https://github.com/performancecopilot/pcp-webapp-grafana/archive/1.9.1-2/pcp-webapp-grafana-1.9.1-2.tar.gz Source3: https://github.com/performancecopilot/pcp-webapp-graphite/archive/0.9.10/pcp-webapp-graphite-0.9.10.tar.gz Source4: https://github.com/performancecopilot/pcp-webapp-blinkenlights/archive/1.0.1/pcp-webapp-blinkenlights-1.0.1.tar.gz +Patch6000: CVE-2019-3695-CVE-2019-3696.patch + BuildRequires: gcc gcc-c++ procps autoconf bison flex nss-devel rpm-devel avahi-devel xz-devel zlib-devel BuildRequires: python2-devel python3-devel ncurses-devel readline-devel cyrus-sasl-devel papi-devel libpfm-devel >= 4 BuildRequires: libmicrohttpd-devel cairo-devel systemtap-sdt-devel boost-devel perl-generators perl-devel perl(strict) @@ -857,6 +859,7 @@ This package installs selinux support files for PCP. %setup -q -T -D -a 3 -c -n graphite %setup -q -T -D -a 4 -c -n blinkenlights %setup -q +%patch6000 -p1 %build @@ -2208,5 +2211,11 @@ fi %config(noreplace) /etc/pcp/pmrep/* %changelog +* Wed May 13 2020 huanghaitao - 4.1.3-4 +- Type:cves +- ID: CVE-2019-3695 CVE-2019-3696 +- SUG:restart +- DESC: fix CVE-2019-3695 CVE-2019-3696 + * Fri Feb 21 2020 Senlin Xia - 4.1.3-3 - package init -- Gitee From 7b2812618b97bafe7254afab391f90123993945d Mon Sep 17 00:00:00 2001 From: Zhou_Ang Date: Thu, 14 May 2020 14:45:21 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!3?= =?UTF-8?q?=20:=20update=20to=20update=5Flts'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pcp.spec | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pcp.spec b/pcp.spec index 5a1a6a5..9028df2 100644 --- a/pcp.spec +++ b/pcp.spec @@ -9,7 +9,7 @@ Name: pcp Version: 4.1.3 Summary: System-level performance monitoring and performance management -Release: 4 +Release: 3 License: GPLv2+ and LGPLv2.1+ and CC-BY URL: https://pcp.io Source0: https://dl.bintray.com/pcp/source/pcp-4.1.3.tar.gz @@ -285,8 +285,8 @@ gathering hardware counters statistics through libpfm. %package pmda-infiniband Summary: PCP metrics for Infiniband HCAs and switches License: GPLv2+ -Requires: pcp = %{version}-%{release} rdma-core -BuildRequires: rdma-core-devel +Requires: pcp = %{version}-%{release} libibmad >= 1.3.7 libibumad >= 1.3.7 +BuildRequires: libibmad-devel >= 1.3.7 libibumad-devel >= 1.3.7 %description pmda-infiniband This package provides the PCP Performance Metrics Domain Agent -- PMDA which is used for gathering Infiniband statistics. By default, it monitors the local HCAs @@ -2208,7 +2208,5 @@ fi %config(noreplace) /etc/pcp/pmrep/* %changelog -* Sun Apr 26 2020 volcanodragon - 4.1.3-4 -- change reuqire to rdma-core as libibmad and libibumad obsoleted * Fri Feb 21 2020 Senlin Xia - 4.1.3-3 - package init -- Gitee From 6ba6a06adbb8d84b74051ea6dc50380c717839bb Mon Sep 17 00:00:00 2001 From: panchenbo Date: Wed, 24 Jun 2020 00:28:53 +0800 Subject: [PATCH 4/9] fix new function not found when Install --- ...-new-function-not-found-when-Install.patch | 56 +++++++++++++++++++ pcp.spec | 10 +++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 9000-fix-new-function-not-found-when-Install.patch diff --git a/9000-fix-new-function-not-found-when-Install.patch b/9000-fix-new-function-not-found-when-Install.patch new file mode 100644 index 0000000..22e9cbb --- /dev/null +++ b/9000-fix-new-function-not-found-when-Install.patch @@ -0,0 +1,56 @@ +From f11997e1ce300515016be55c5dcef8d52352af9e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E6=BD=98=E6=99=A8=E5=8D=9A?= +Date: Tue, 23 Jun 2020 14:15:14 +0800 +Subject: [PATCH] fix new function not found when Install + +--- + src/pmdas/activemq/GNUmakefile | 4 +++- + src/pmdas/activemq/pmdaactivemq.pl | 14 +++++++------- + 2 files changed, 10 insertions(+), 8 deletions(-) + +diff --git a/src/pmdas/activemq/GNUmakefile b/src/pmdas/activemq/GNUmakefile +index da9c583..26bb78e 100644 +--- a/src/pmdas/activemq/GNUmakefile ++++ b/src/pmdas/activemq/GNUmakefile +@@ -41,7 +41,9 @@ build-me: check_domain + install install_pcp: default + $(INSTALL) -m 755 -d $(PMDADIR) + $(INSTALL) -m 755 Install Remove $(PMDADIR) +- $(INSTALL) -m 644 pmda$(IAM).pl $(MODULES) $(PMDADIR) ++ $(INSTALL) -m 644 pmda$(IAM).pl $(PMDADIR)/pmda$(IAM).pl ++ $(INSTALL) -m 755 -d $(PMDADIR)/PCP ++ $(INSTALL) -m 644 $(MODULES) $(PMDADIR)/PCP + @$(INSTALL_MAN) + else + build-me: +diff --git a/src/pmdas/activemq/pmdaactivemq.pl b/src/pmdas/activemq/pmdaactivemq.pl +index 7f835aa..4b54516 100755 +--- a/src/pmdas/activemq/pmdaactivemq.pl ++++ b/src/pmdas/activemq/pmdaactivemq.pl +@@ -49,16 +49,16 @@ my $jvm_garbage_collection_cluster = 5; + for my $file (pmda_config('PCP_PMDAS_DIR') . '/activemq/activemq.conf', 'activemq.conf') { + eval `cat $file` unless ! -f $file; + } +-my $timesource = TimeSource->new; +-my $cache = Cache->new($timesource, $cache_time); ++my $timesource = PCP::TimeSource->new; ++my $cache = PCP::Cache->new($timesource, $cache_time); + my $http_client = LWP::UserAgent->new; + $http_client->agent('pmdaactivemq'); + $http_client->timeout($rest_timeout); +-my $rest_client = RESTClient->new($http_client, $cache, $rest_hostname, $rest_port, $rest_username, $rest_password, $rest_realm); +-my $activemq = ActiveMQ->new($rest_client); +-my $jvm_memory = JVMMemory->new($rest_client); +-my $jvm_memory_pool = JVMMemoryPool->new($rest_client); +-my $jvm_garbage_collection = JVMGarbageCollection->new($rest_client); ++my $rest_client = PCP::RESTClient->new($http_client, $cache, $rest_hostname, $rest_port, $rest_username, $rest_password, $rest_realm); ++my $activemq = PCP::ActiveMQ->new($rest_client); ++my $jvm_memory = PCP::JVMMemory->new($rest_client); ++my $jvm_memory_pool = PCP::JVMMemoryPool->new($rest_client); ++my $jvm_garbage_collection = PCP::JVMGarbageCollection->new($rest_client); + + my %queue_instances; + +-- +2.23.0 + diff --git a/pcp.spec b/pcp.spec index 5817199..0841631 100644 --- a/pcp.spec +++ b/pcp.spec @@ -9,7 +9,7 @@ Name: pcp Version: 4.1.3 Summary: System-level performance monitoring and performance management -Release: 4 +Release: 5 License: GPLv2+ and LGPLv2.1+ and CC-BY URL: https://pcp.io Source0: https://dl.bintray.com/pcp/source/pcp-4.1.3.tar.gz @@ -18,6 +18,7 @@ Source2: https://github.com/performancecopilot/pcp-webapp-grafana/archi Source3: https://github.com/performancecopilot/pcp-webapp-graphite/archive/0.9.10/pcp-webapp-graphite-0.9.10.tar.gz Source4: https://github.com/performancecopilot/pcp-webapp-blinkenlights/archive/1.0.1/pcp-webapp-blinkenlights-1.0.1.tar.gz Patch6000: CVE-2019-3695-CVE-2019-3696.patch +Patch9000: 9000-fix-new-function-not-found-when-Install.patch BuildRequires: gcc gcc-c++ procps autoconf bison flex nss-devel rpm-devel avahi-devel xz-devel zlib-devel BuildRequires: python2-devel python3-devel ncurses-devel readline-devel cyrus-sasl-devel papi-devel libpfm-devel >= 4 @@ -860,6 +861,7 @@ This package installs selinux support files for PCP. %setup -q -T -D -a 4 -c -n blinkenlights %setup -q %patch6000 -p1 +%patch9000 -p1 %build @@ -2211,6 +2213,12 @@ fi %config(noreplace) /etc/pcp/pmrep/* %changelog +* Tue Jun Jun 2020 panchenbo - 4.1.3-5 +- Type:bugfix +- ID: NA +- SUG: install +- DESC: Fix pcp-pmda-activemq install error + * Wed May 13 2020 huanghaitao - 4.1.3-4 - Type:cves - ID: CVE-2019-3695 CVE-2019-3696 -- Gitee From ab80710a49d9d7a691782d81d1b86f037ea83f18 Mon Sep 17 00:00:00 2001 From: hht8 Date: Wed, 15 Jul 2020 14:07:25 +0800 Subject: [PATCH 5/9] change undelete rebuild flag file .NeedRebuild --- pcp.spec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pcp.spec b/pcp.spec index 0841631..8d6ee0a 100644 --- a/pcp.spec +++ b/pcp.spec @@ -9,7 +9,7 @@ Name: pcp Version: 4.1.3 Summary: System-level performance monitoring and performance management -Release: 5 +Release: 6 License: GPLv2+ and LGPLv2.1+ and CC-BY URL: https://pcp.io Source0: https://dl.bintray.com/pcp/source/pcp-4.1.3.tar.gz @@ -1641,7 +1641,6 @@ systemctl stop pmie.service >/dev/null 2>&1 systemctl stop pmproxy.service >/dev/null 2>&1 systemctl stop pmcd.service >/dev/null 2>&1 PCP_PMNS_DIR=/var/lib/pcp/pmns -rm -f "$PCP_PMNS_DIR/.NeedRebuild" >/dev/null 2>&1 fi %post webapi @@ -1755,7 +1754,7 @@ if [ $1 -eq 1 ] && [ -x /usr/bin/systemctl ] ; then /usr/bin/systemctl --no-reload preset pmie.service || : fi systemctl condrestart pmproxy.service >/dev/null 2>&1 -cd $PCP_PMNS_DIR && ./Rebuild -s && rm -f .NeedRebuild +cd $PCP_PMNS_DIR && ./Rebuild -s cd /sbin/ldconfig %postun @@ -2213,7 +2212,10 @@ fi %config(noreplace) /etc/pcp/pmrep/* %changelog -* Tue Jun Jun 2020 panchenbo - 4.1.3-5 +* Wed Jul 15 2020 huanghaitao - 4.1.3-6 +- change undelete rebuild flag file .NeedRebuild + +* Tue Jun 23 2020 panchenbo - 4.1.3-5 - Type:bugfix - ID: NA - SUG: install -- Gitee From 71f6b445b5c4b77fddb71bf55a307b36503d4b6e Mon Sep 17 00:00:00 2001 From: lingsheng Date: Tue, 28 Jul 2020 18:54:30 +0800 Subject: [PATCH 6/9] change require to rdma-core as libibmad and libibumad obsoleted --- pcp.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pcp.spec b/pcp.spec index 8d6ee0a..4fd977e 100644 --- a/pcp.spec +++ b/pcp.spec @@ -9,7 +9,7 @@ Name: pcp Version: 4.1.3 Summary: System-level performance monitoring and performance management -Release: 6 +Release: 7 License: GPLv2+ and LGPLv2.1+ and CC-BY URL: https://pcp.io Source0: https://dl.bintray.com/pcp/source/pcp-4.1.3.tar.gz @@ -288,8 +288,8 @@ gathering hardware counters statistics through libpfm. %package pmda-infiniband Summary: PCP metrics for Infiniband HCAs and switches License: GPLv2+ -Requires: pcp = %{version}-%{release} libibmad >= 1.3.7 libibumad >= 1.3.7 -BuildRequires: libibmad-devel >= 1.3.7 libibumad-devel >= 1.3.7 +Requires: pcp = %{version}-%{release} rdma-core +BuildRequires: rdma-core-devel %description pmda-infiniband This package provides the PCP Performance Metrics Domain Agent -- PMDA which is used for gathering Infiniband statistics. By default, it monitors the local HCAs @@ -2212,6 +2212,9 @@ fi %config(noreplace) /etc/pcp/pmrep/* %changelog +* Tue Jul 28 2020 lingsheng - 4.1.3-7 +- change require to rdma-core as libibmad and libibumad obsoleted + * Wed Jul 15 2020 huanghaitao - 4.1.3-6 - change undelete rebuild flag file .NeedRebuild -- Gitee From c8cb14f53dc18fa1b14cd12fc5ad1f163c7b6bdd Mon Sep 17 00:00:00 2001 From: jpzhang Date: Tue, 4 Aug 2020 11:38:10 +0800 Subject: [PATCH 7/9] Fix compile failure in make multithreading --- pcp.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pcp.spec b/pcp.spec index 4fd977e..bd24e57 100644 --- a/pcp.spec +++ b/pcp.spec @@ -9,7 +9,7 @@ Name: pcp Version: 4.1.3 Summary: System-level performance monitoring and performance management -Release: 7 +Release: 8 License: GPLv2+ and LGPLv2.1+ and CC-BY URL: https://pcp.io Source0: https://dl.bintray.com/pcp/source/pcp-4.1.3.tar.gz @@ -875,6 +875,7 @@ This package installs selinux support files for PCP. --with-pmdasnmp=yes \ --with-pmdanutcracker=no \ --with-webapps=yes +sed -i 's/make/make -j1/' src/selinux/GNUmakefile %make_build default_pcp @@ -2212,6 +2213,9 @@ fi %config(noreplace) /etc/pcp/pmrep/* %changelog +* Tue Aug 04 2020 zhangjiapeng - 4.1.3-8 +- Fix compile failure in make multithreading + * Tue Jul 28 2020 lingsheng - 4.1.3-7 - change require to rdma-core as libibmad and libibumad obsoleted -- Gitee From bb8023610143c4ffebc43fe5b78fec6e76fd12c8 Mon Sep 17 00:00:00 2001 From: lingsheng Date: Fri, 28 Aug 2020 19:28:53 +0800 Subject: [PATCH 8/9] Fix .NeedRebuild unfound when removing rpm --- pcp.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pcp.spec b/pcp.spec index bd24e57..e6fa1b2 100644 --- a/pcp.spec +++ b/pcp.spec @@ -9,7 +9,7 @@ Name: pcp Version: 4.1.3 Summary: System-level performance monitoring and performance management -Release: 8 +Release: 9 License: GPLv2+ and LGPLv2.1+ and CC-BY URL: https://pcp.io Source0: https://dl.bintray.com/pcp/source/pcp-4.1.3.tar.gz @@ -1642,6 +1642,7 @@ systemctl stop pmie.service >/dev/null 2>&1 systemctl stop pmproxy.service >/dev/null 2>&1 systemctl stop pmcd.service >/dev/null 2>&1 PCP_PMNS_DIR=/var/lib/pcp/pmns +rm -f "$PCP_PMNS_DIR/.NeedRebuild" >/dev/null 2>&1 fi %post webapi @@ -1755,7 +1756,7 @@ if [ $1 -eq 1 ] && [ -x /usr/bin/systemctl ] ; then /usr/bin/systemctl --no-reload preset pmie.service || : fi systemctl condrestart pmproxy.service >/dev/null 2>&1 -cd $PCP_PMNS_DIR && ./Rebuild -s +cd $PCP_PMNS_DIR && ./Rebuild -s && rm -f .NeedRebuild cd /sbin/ldconfig %postun @@ -1866,6 +1867,7 @@ fi /usr/lib64/libpcp_trace.so.2 /usr/lib64/libpcp_import.so.1 /usr/lib64/libpcp_web.so.1 +%exclude /var/lib/pcp/pmns/.NeedRebuild %files monitor @@ -2213,6 +2215,9 @@ fi %config(noreplace) /etc/pcp/pmrep/* %changelog +* Fri Aug 28 2020 lingsheng - 4.1.3-9 +- Fix .NeedRebuild unfound when removing rpm + * Tue Aug 04 2020 zhangjiapeng - 4.1.3-8 - Fix compile failure in make multithreading -- Gitee From 8e0022a5b70885d55bf2a72f25b84aef55d4067f Mon Sep 17 00:00:00 2001 From: jpzhang Date: Wed, 16 Sep 2020 10:36:03 +0800 Subject: [PATCH 9/9] Fix some options and syntax errors --- 0000-Fix-some-options-and-syntax-errors.patch | 184 ++++++++++++++++++ pcp.spec | 9 +- 2 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 0000-Fix-some-options-and-syntax-errors.patch diff --git a/0000-Fix-some-options-and-syntax-errors.patch b/0000-Fix-some-options-and-syntax-errors.patch new file mode 100644 index 0000000..9d23694 --- /dev/null +++ b/0000-Fix-some-options-and-syntax-errors.patch @@ -0,0 +1,184 @@ +diff --git a/src/pcp/collectl/pcp-collectl.py b/src/pcp/collectl/pcp-collectl.py +index 3cff1f9..58b8c64 100755 +--- a/src/pcp/collectl/pcp-collectl.py ++++ b/src/pcp/collectl/pcp-collectl.py +@@ -841,7 +841,7 @@ class _Options(object): + opts = pmapi.pmOptions() + opts.pmSetOptionCallback(self.option_callback) + opts.pmSetOverrideCallback(self.override) +- opts.pmSetShortOptions("vp:a:c:f:R:i:s:h:?") ++ opts.pmSetShortOptions("Vvp:a:c:f:R:i:s:h:?") + opts.pmSetLongOptionText("") + opts.pmSetLongOptionText("Interactive: pcp collectl [-h HOST] [options]") + opts.pmSetLongOptionText("Read PCP archive: pcp collectl -a ARCHIVE [options]") +diff --git a/src/pcp/dmcache/pcp-dmcache.py b/src/pcp/dmcache/pcp-dmcache.py +index cd88ed4..29eb0ec 100755 +--- a/src/pcp/dmcache/pcp-dmcache.py ++++ b/src/pcp/dmcache/pcp-dmcache.py +@@ -155,7 +155,7 @@ class DmCachePrinter(pmcc.MetricGroupPrinter): + + if __name__ == '__main__': + try: +- options = pmapi.pmOptions('iR:?') ++ options = pmapi.pmOptions('ViR:?') + options.pmSetShortUsage('[options] [device ...]') + options.pmSetOptionCallback(option) + options.pmSetLongOptionHeader('Options') +diff --git a/src/pcp/dstat/pcp-dstat.py b/src/pcp/dstat/pcp-dstat.py +index c178874..cdd7991 100755 +--- a/src/pcp/dstat/pcp-dstat.py ++++ b/src/pcp/dstat/pcp-dstat.py +@@ -727,7 +727,7 @@ class DstatTool(object): + # opts.pmSetLongOption('zones', 0, None, '', 'enable zoneinfo stats') + opts.pmSetLongOptionText('') + opts.pmSetLongOption('list', 0, None, '', 'list all available plugins') +- opts.pmSetLongOption('plugin', 0, None, '', 'enable external plugin by name, see --list') ++ opts.pmSetLongOption('', 0, None, '', 'enable external plugin by name, see --list') + opts.pmSetLongOptionText('') + opts.pmSetLongOption('all', 0, 'a', '', 'equals -cdngy (default)') + opts.pmSetLongOption('full', 0, 'f', '', 'automatically expand -C, -D, -I, -N and -S lists') +@@ -785,7 +785,7 @@ class DstatTool(object): + self.disklist = sorted([x for x in insts if x != 'total']) + if 'total' in insts: + self.disklist.append('total') +- elif opt in ['--filesystem']: ++ elif opt in ['filesystem']: + self.plugins.append('fs') + elif opt in ['g']: + self.plugins.append('page') +diff --git a/src/pcp/iostat/pcp-iostat.py b/src/pcp/iostat/pcp-iostat.py +index bc716c2..b3a810c 100755 +--- a/src/pcp/iostat/pcp-iostat.py ++++ b/src/pcp/iostat/pcp-iostat.py +@@ -165,11 +165,11 @@ class IostatReport(pmcc.MetricGroupPrinter): + if "t" in IostatOptions.xflag: + heading = ('# Timestamp', 'Device',rrqmspace, 'rrqm/s',wrqmspace, 'wrqm/s',precision+5, 'r/s',precision+4,\ + 'w/s',precision+6, 'rkB/s',precision+6, 'wkB/s', avgrqszspace,'avgrq-sz',precision+6, 'avgqu-sz',precision+5, \ +- 'await',precision+5, 'r_await', precision+5,'w_await',utilspace, '%util') ++ 'await_t',precision+5, 'r_await', precision+5,'w_await',utilspace, '%util') + else: + heading = ('# Device',rrqmspace, 'rrqm/s',wrqmspace, 'wrqm/s',precision+5, 'r/s',precision+4, 'w/s'\ + ,precision+6, 'rkB/s',precision+6, 'wkB/s', avgrqszspace,'avgrq-sz',precision+6, 'avgqu-sz',precision+5,\ +- 'await',awaitspace, 'r_await',awaitspace, 'w_await',utilspace, '%util') ++ 'await_t',awaitspace, 'r_await',awaitspace, 'w_await',utilspace, '%util') + print(headfmt % heading) + + if p_rrqm == {} or p_wrqm == {} or p_r == {} or p_w == {} or \ +@@ -205,7 +205,7 @@ class IostatReport(pmcc.MetricGroupPrinter): + # total active time in seconds (same units as dt) + tot_active = (float)(c_avactive[inst] - p_avactive[inst]) / 1000.0 + +- avgrqsz = avgqsz = await = r_await = w_await = util = 0.0 ++ avgrqsz = avgqsz = await_t = r_await = w_await = util = 0.0 + + # average request size units are KB (sysstat reports in units of sectors) + if tot_ios: +@@ -214,9 +214,9 @@ class IostatReport(pmcc.MetricGroupPrinter): + # average queue length + avgqsz = (float)((c_ractive[inst] - p_ractive[inst]) + (c_wactive[inst] - p_wactive[inst])) / dt / 1000.0 + +- # await, r_await, w_await ++ # await_t, r_await, w_await + if tot_ios: +- await = ((c_ractive[inst] - p_ractive[inst]) + (c_wactive[inst] - p_wactive[inst])) / tot_ios ++ await_t = ((c_ractive[inst] - p_ractive[inst]) + (c_wactive[inst] - p_wactive[inst])) / tot_ios + + if tot_rios: + r_await = (c_ractive[inst] - p_ractive[inst]) / tot_rios +@@ -229,7 +229,7 @@ class IostatReport(pmcc.MetricGroupPrinter): + util = 100.0 * tot_active / dt + + device = inst # prepare name for printing +- badcounters = rrqm < 0 or wrqm < 0 or r < 0 or w < 0 or await < 0 or avgrqsz < 0 or avgqsz < 0 or util < 0 ++ badcounters = rrqm < 0 or wrqm < 0 or r < 0 or w < 0 or await_t < 0 or avgrqsz < 0 or avgqsz < 0 or util < 0 + + if "t" in IostatOptions.xflag: + if badcounters: +@@ -250,7 +250,7 @@ class IostatReport(pmcc.MetricGroupPrinter): + if not IostatOptions.Gflag: + print(valfmt % (timestamp, device,rrqmspace, precision, rrqm,wrqmspace,precision, wrqm,precision+5,precision,\ + r,precision+4,precision, w,precision+6,precision, rkb,precision+6,precision, wkb, avgrqszspace,precision+1 ,avgrqsz,\ +- avgrqszspace,precision+1, avgqsz,precision+5,precision, await,awaitspace,precision, r_await,awaitspace,precision,\ ++ avgrqszspace,precision+1, avgqsz,precision+5,precision, await_t,awaitspace,precision, r_await,awaitspace,precision,\ + w_await,utilspace,precision, util)) + else: + if badcounters: +@@ -270,7 +270,7 @@ class IostatReport(pmcc.MetricGroupPrinter): + if not IostatOptions.Gflag: + print(valfmt % (device,rrqmspace, precision, rrqm,wrqmspace,precision, wrqm,precision+5,precision, r,precision+4,\ + precision, w,precision+6,precision, rkb,precision+6,precision, wkb,\ +- avgrqszspace,precision+1 ,avgrqsz,avgrqszspace,precision+1, avgqsz,precision+5,precision, await,awaitspace,precision,\ ++ avgrqszspace,precision+1 ,avgrqsz,avgrqszspace,precision+1, avgqsz,precision+5,precision, await_t,awaitspace,precision,\ + r_await,awaitspace,precision, w_await,utilspace,precision, util)) + + if IostatOptions.Gflag and not badcounters: +@@ -282,7 +282,7 @@ class IostatReport(pmcc.MetricGroupPrinter): + aggr_wkb = aggregate(aggr, aggr_wkb, wkb) + aggr_avgrqsz = aggregate(aggr, aggr_avgrqsz, avgrqsz) + aggr_avgqsz = aggregate(aggr, aggr_avgqsz, avgqsz) +- aggr_await = aggregate(aggr, aggr_await, await) ++ aggr_await = aggregate(aggr, aggr_await, await_t) + aggr_r_await = aggregate(aggr, aggr_r_await, r_await) + aggr_w_await = aggregate(aggr, aggr_w_await, w_await) + aggr_util = aggregate(aggr, aggr_util, util) +diff --git a/src/pmlogconf/pmlogconf.sh b/src/pmlogconf/pmlogconf.sh +index 44f5099..af2bf37 100755 +--- a/src/pmlogconf/pmlogconf.sh ++++ b/src/pmlogconf/pmlogconf.sh +@@ -161,7 +161,7 @@ _split() + $PCP_AWK_PROG <$tmp/ctl ' + BEGIN { out = "'"$tmp/head"'" } + /DO NOT UPDATE THE FILE ABOVE/ { seen = 1 } +-seen == 0 && /^\#\? [^:]*:[ynx]:/ { print >"'"$tmp/tag"'" ++seen == 0 && /^#\? [^:]*:[ynx]:/ { print >"'"$tmp/tag"'" + out = "'"$tmp/tail"'" + seen = 1 + next +@@ -180,8 +180,8 @@ _update() + $PCP_AWK_PROG <$tmp/in >$tmp/ctl ' + /DO NOT UPDATE THE FILE ABOVE/ { tail = 1 } + tail == 1 { print; next } +-/^\#\+ [^:]*:[ynx]:/ { sub(/\+/, "?", $1); print; skip = 1; next } +-skip == 1 && /^\#----/ { skip = 0; next } ++/^#\+ [^:]*:[ynx]:/ { sub(/\+/, "?", $1); print; skip = 1; next } ++skip == 1 && /^#----/ { skip = 0; next } + skip == 1 { next } + { print }' + +diff --git a/src/pmprobe/pmprobe.c b/src/pmprobe/pmprobe.c +index dcf1567..d6d7ab5 100644 +--- a/src/pmprobe/pmprobe.c ++++ b/src/pmprobe/pmprobe.c +@@ -63,7 +63,7 @@ overrides(int opt, pmOptions *opts) + + static pmOptions opts = { + .flags = PM_OPTFLAG_STDOUT_TZ, +- .short_options = "a:b:D:efh:IiK:Ln:FO:VvZ:z?", ++ .short_options = "a:b:D:defh:IiK:Ln:FO:VvZ:z?", + .long_options = longopts, + .short_usage = "[options] [metricname ...]", + .override = overrides, +diff --git a/src/pmstat/pmstat.c b/src/pmstat/pmstat.c +index c4f9881..b3986d7 100644 +--- a/src/pmstat/pmstat.c ++++ b/src/pmstat/pmstat.c +@@ -371,6 +371,10 @@ main(int argc, char *argv[]) + case 'x': /* extended CPU reporting */ + extraCpuStats = 1; + break; ++ case 'V': ++ pmprintf("%s version %s\n", pmGetProgname(), PCP_VERSION); ++ opts.flags |= PM_OPTFLAG_EXIT; ++ break; + default: + opts.errors++; + break; +@@ -387,7 +391,7 @@ main(int argc, char *argv[]) + opts.errors++; + } + +- if (opts.errors) { ++ if (opts.errors || (opts.flags & PM_OPTFLAG_EXIT)) { + pmUsageMessage(&opts); + exit(1); + } diff --git a/pcp.spec b/pcp.spec index e6fa1b2..73de802 100644 --- a/pcp.spec +++ b/pcp.spec @@ -9,7 +9,7 @@ Name: pcp Version: 4.1.3 Summary: System-level performance monitoring and performance management -Release: 9 +Release: 10 License: GPLv2+ and LGPLv2.1+ and CC-BY URL: https://pcp.io Source0: https://dl.bintray.com/pcp/source/pcp-4.1.3.tar.gz @@ -17,6 +17,7 @@ Source1: https://github.com/performancecopilot/pcp-webapp-vector/archiv Source2: https://github.com/performancecopilot/pcp-webapp-grafana/archive/1.9.1-2/pcp-webapp-grafana-1.9.1-2.tar.gz Source3: https://github.com/performancecopilot/pcp-webapp-graphite/archive/0.9.10/pcp-webapp-graphite-0.9.10.tar.gz Source4: https://github.com/performancecopilot/pcp-webapp-blinkenlights/archive/1.0.1/pcp-webapp-blinkenlights-1.0.1.tar.gz +Patch0000: 0000-Fix-some-options-and-syntax-errors.patch Patch6000: CVE-2019-3695-CVE-2019-3696.patch Patch9000: 9000-fix-new-function-not-found-when-Install.patch @@ -860,6 +861,7 @@ This package installs selinux support files for PCP. %setup -q -T -D -a 3 -c -n graphite %setup -q -T -D -a 4 -c -n blinkenlights %setup -q +%patch0000 -p1 %patch6000 -p1 %patch9000 -p1 @@ -1868,6 +1870,8 @@ fi /usr/lib64/libpcp_import.so.1 /usr/lib64/libpcp_web.so.1 %exclude /var/lib/pcp/pmns/.NeedRebuild +%exclude /usr/libexec/pcp/bin/pcp-ipcs +%exclude /usr/libexec/pcp/bin/pcp-lvmcache %files monitor @@ -2215,6 +2219,9 @@ fi %config(noreplace) /etc/pcp/pmrep/* %changelog +* Thu Sep 16 2020 zhangjiapeng - 4.1.3-10 +- Fix some options and syntax errors + * Fri Aug 28 2020 lingsheng - 4.1.3-9 - Fix .NeedRebuild unfound when removing rpm -- Gitee