Merge commits from 8.6 into 9.0.0 branch.

Related: rhbz#1991764
This commit is contained in:
Nathan Scott 2021-11-10 15:51:39 +11:00
parent 4144cadcb7
commit bf5a61994e
3 changed files with 80 additions and 220 deletions

115
pcp.spec
View File

@ -1,6 +1,6 @@
Name: pcp
Version: 5.3.4
Release: 2%{?dist}
Version: 5.3.5
Release: 1%{?dist}
Summary: System-level performance monitoring and performance management
License: GPLv2+ and LGPLv2+ and CC-BY
URL: https://pcp.io
@ -8,8 +8,6 @@ URL: https://pcp.io
%global artifactory https://performancecopilot.jfrog.io/artifactory
Source0: %{artifactory}/pcp-source-release/pcp-%{version}.src.tar.gz
Patch0: remove-run-level-check.patch
%if 0%{?fedora} >= 26 || 0%{?rhel} > 7
%global __python2 python2
%else
@ -519,7 +517,7 @@ Requires: pcp-pmda-activemq pcp-pmda-bonding pcp-pmda-dbping pcp-pmda-ds389 pcp-
Requires: pcp-pmda-elasticsearch pcp-pmda-gpfs pcp-pmda-gpsd pcp-pmda-lustre
Requires: pcp-pmda-memcache pcp-pmda-mysql pcp-pmda-named pcp-pmda-netfilter pcp-pmda-news
Requires: pcp-pmda-nginx pcp-pmda-nfsclient pcp-pmda-pdns pcp-pmda-postfix pcp-pmda-postgresql pcp-pmda-oracle
Requires: pcp-pmda-samba pcp-pmda-slurm pcp-pmda-vmware pcp-pmda-zimbra
Requires: pcp-pmda-samba pcp-pmda-slurm pcp-pmda-zimbra
Requires: pcp-pmda-dm pcp-pmda-apache
Requires: pcp-pmda-bash pcp-pmda-cisco pcp-pmda-gfs2 pcp-pmda-mailq pcp-pmda-mounts
Requires: pcp-pmda-nvidia-gpu pcp-pmda-roomtemp pcp-pmda-sendmail pcp-pmda-shping pcp-pmda-smart
@ -547,7 +545,7 @@ Requires: pcp-pmda-bpftrace
Requires: pcp-pmda-gluster pcp-pmda-zswap pcp-pmda-unbound pcp-pmda-mic
Requires: pcp-pmda-libvirt pcp-pmda-lio pcp-pmda-openmetrics pcp-pmda-haproxy
Requires: pcp-pmda-lmsensors pcp-pmda-netcheck pcp-pmda-rabbitmq
Requires: pcp-pmda-openvswitch
Requires: pcp-pmda-openvswitch pcp-pmda-mongodb
%endif
%if !%{disable_mssql}
Requires: pcp-pmda-mssql
@ -1404,21 +1402,6 @@ collecting metrics about SNMP.
#end pcp-pmda-snmp
%endif
#
# pcp-pmda-vmware
#
%package pmda-vmware
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for VMware
URL: https://pcp.io
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
Requires: perl-PCP-PMDA = %{version}-%{release}
%description pmda-vmware
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics for VMware.
#end pcp-pmda-vmware
#
# pcp-pmda-zimbra
#
@ -1476,7 +1459,7 @@ Summary: Performance Co-Pilot (PCP) metrics from eBPF ELF modules
URL: https://pcp.io
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
Requires: libbpf
BuildRequires: libbpf-devel clang llvm
BuildRequires: libbpf-devel clang llvm bpftool
%description pmda-bpf
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
extracting performance metrics from eBPF ELF modules.
@ -1760,6 +1743,7 @@ BuildRequires: %{__python2}-requests
%endif
Obsoletes: pcp-pmda-prometheus < 5.0.0
Provides: pcp-pmda-prometheus < 5.0.0
Obsoletes: pcp-pmda-vmware < 5.3.5
%description pmda-openmetrics
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
@ -1805,6 +1789,29 @@ This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics from simple network checks.
# end pcp-pmda-netcheck
#
# pcp-pmda-mongodb
#
%package pmda-mongodb
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for MongoDB
URL: https://pcp.io
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
%if !%{disable_python3}
Requires: python3-pcp
%if 0%{?rhel} == 0
Requires: python3-pymongo
%endif
%else
Requires: %{__python2}-pcp
%if 0%{?rhel} == 0
Requires: %{__python2}-pymongo
%endif
%endif
%description pmda-mongodb
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics from MongoDB.
# end pcp-pmda-mongodb
%endif
%if !%{disable_mssql}
@ -2268,7 +2275,6 @@ updated policy package.
%prep
%setup -q
%patch0 -p1
%build
# the buildsubdir macro gets defined in %setup and is apparently only available in the next step (i.e. the %build step)
@ -2475,6 +2481,7 @@ basic_manifest | keep '(etc/pcp|pmdas)/memcache(/|$)' >pcp-pmda-memcache-files
basic_manifest | keep '(etc/pcp|pmdas)/mailq(/|$)' >pcp-pmda-mailq-files
basic_manifest | keep '(etc/pcp|pmdas)/mic(/|$)' >pcp-pmda-mic-files
basic_manifest | keep '(etc/pcp|pmdas)/mounts(/|$)' >pcp-pmda-mounts-files
basic_manifest | keep '(etc/pcp|pmdas)/mongodb(/|$)' >pcp-pmda-mongodb-files
basic_manifest | keep '(etc/pcp|pmdas|pmieconf)/mssql(/|$)' >pcp-pmda-mssql-files
basic_manifest | keep '(etc/pcp|pmdas)/mysql(/|$)' >pcp-pmda-mysql-files
basic_manifest | keep '(etc/pcp|pmdas)/named(/|$)' >pcp-pmda-named-files
@ -2511,7 +2518,6 @@ basic_manifest | keep '(etc/pcp|pmdas)/systemd(/|$)' >pcp-pmda-systemd-files
basic_manifest | keep '(etc/pcp|pmdas)/trace(/|$)' >pcp-pmda-trace-files
basic_manifest | keep '(etc/pcp|pmdas)/unbound(/|$)' >pcp-pmda-unbound-files
basic_manifest | keep '(etc/pcp|pmdas)/weblog(/|$)' >pcp-pmda-weblog-files
basic_manifest | keep '(etc/pcp|pmdas)/vmware(/|$)' >pcp-pmda-vmware-files
basic_manifest | keep '(etc/pcp|pmdas)/zimbra(/|$)' >pcp-pmda-zimbra-files
basic_manifest | keep '(etc/pcp|pmdas)/zswap(/|$)' >pcp-pmda-zswap-files
@ -2527,7 +2533,7 @@ for pmda_package in \
infiniband \
json \
libvirt lio lmsensors logger lustre lustrecomm \
mailq memcache mic mounts mssql mysql \
mailq memcache mic mounts mongodb mssql mysql \
named netcheck netfilter news nfsclient nginx \
nutcracker nvidia \
openmetrics openvswitch oracle \
@ -2537,7 +2543,6 @@ for pmda_package in \
sockets statsd summary systemd \
unbound \
trace \
vmware \
weblog \
zimbra zswap ; \
do \
@ -2824,9 +2829,6 @@ exit 0
%preun pmda-samba
%{pmda_remove "$1" "samba"}
%preun pmda-vmware
%{pmda_remove "$1" "vmware"}
%preun pmda-zimbra
%{pmda_remove "$1" "zimbra"}
@ -2870,6 +2872,9 @@ exit 0
%preun pmda-lmsensors
%{pmda_remove "$1" "lmsensors"}
%preun pmda-mongodb
%{pmda_remove "$1" "mongodb"}
%if !%{disable_mssql}
%preun pmda-mssql
%{pmda_remove "$1" "mssql"}
@ -2949,27 +2954,37 @@ then
# stop daemons before erasing the package
%if !%{disable_systemd}
%systemd_preun pmlogger.service
%systemd_preun pmlogger_farm.service
%systemd_preun pmie.service
%systemd_preun pmie_farm.service
%systemd_preun pmproxy.service
%systemd_preun pmcd.service
%systemd_preun pmie_daily.timer
%systemd_preun pmlogger_daily.timer
%systemd_preun pmlogger_check.timer
%systemd_preun pmlogger_farm_check.timer
%systemd_preun pmie_farm_check.timer
systemctl stop pmlogger.service >/dev/null 2>&1
systemctl stop pmlogger_farm.service >/dev/null 2>&1
systemctl stop pmie.service >/dev/null 2>&1
systemctl stop pmie_farm.service >/dev/null 2>&1
systemctl stop pmproxy.service >/dev/null 2>&1
systemctl stop pmcd.service >/dev/null 2>&1
%else
/sbin/service pmlogger stop >/dev/null 2>&1
/sbin/service pmlogger_farm stop >/dev/null 2>&1
/sbin/service pmie stop >/dev/null 2>&1
/sbin/service pmie_farm stop >/dev/null 2>&1
/sbin/service pmproxy stop >/dev/null 2>&1
/sbin/service pmcd stop >/dev/null 2>&1
/sbin/chkconfig --del pcp >/dev/null 2>&1
/sbin/chkconfig --del pmcd >/dev/null 2>&1
/sbin/chkconfig --del pmlogger >/dev/null 2>&1
/sbin/chkconfig --del pmlogger_farm >/dev/null 2>&1
/sbin/chkconfig --del pmie >/dev/null 2>&1
/sbin/chkconfig --del pmie_farm >/dev/null 2>&1
/sbin/chkconfig --del pmproxy >/dev/null 2>&1
%endif
# cleanup namespace state/flag, may still exist
@ -2988,28 +3003,31 @@ for PMDA in dm nfsclient openmetrics ; do
%{install_file "$PCP_PMDAS_DIR/$PMDA" .NeedInstall}
fi
done
# Increase default pmlogger recording frequency
# Note on systemd platforms, we ship pmlogger.service.d/zeroconf.conf instead
%if %{disable_systemd}
sed -i 's/^\#\ PMLOGGER_INTERVAL.*/PMLOGGER_INTERVAL=10/g' "$PCP_SYSCONFIG_DIR/pmlogger"
%endif
# auto-enable these usually optional pmie rules
pmieconf -c enable dmthin
%if 0%{?rhel}
%if !%{disable_systemd}
systemctl restart pmcd >/dev/null 2>&1
systemctl restart pmlogger >/dev/null 2>&1
systemctl restart pmlogger_farm >/dev/null 2>&1
systemctl restart pmie >/dev/null 2>&1
systemctl restart pmie_farm >/dev/null 2>&1
systemctl enable pmcd >/dev/null 2>&1
systemctl enable pmlogger >/dev/null 2>&1
systemctl enable pmlogger_farm >/dev/null 2>&1
systemctl enable pmie >/dev/null 2>&1
systemctl enable pmie_farm >/dev/null 2>&1
%else
/sbin/chkconfig --add pmcd >/dev/null 2>&1
/sbin/chkconfig --add pmlogger >/dev/null 2>&1
/sbin/chkconfig --add pmlogger_farm >/dev/null 2>&1
/sbin/chkconfig --add pmie >/dev/null 2>&1
/sbin/chkconfig --add pmie_farm >/dev/null 2>&1
/sbin/service pmcd condrestart
/sbin/service pmlogger condrestart
/sbin/service pmlogger_farm condrestart
/sbin/service pmie condrestart
/sbin/service pmie_farm condrestart
%endif
%endif
@ -3032,20 +3050,42 @@ PCP_LOG_DIR=%{_logsdir}
%if !%{disable_systemd}
# clean up any stale symlinks for deprecated pm*-poll services
rm -f %{_sysconfdir}/systemd/system/pm*.requires/pm*-poll.* >/dev/null 2>&1 || true
# pmlogger_farm service inherits the same initial state as pmlogger service
if systemctl is-enabled pmlogger.service >/dev/null; then
systemctl enable pmlogger_farm.service pmlogger_farm_check.service
systemctl start pmlogger_farm.service pmlogger_farm_check.service
fi
# pmie_farm service inherits the same initial state as pmie service
if systemctl is-enabled pmie.service >/dev/null; then
systemctl enable pmie_farm.service pmie_farm_check.service
systemctl start pmie_farm.service pmie_farm_check.service
fi
%systemd_postun_with_restart pmcd.service
%systemd_post pmcd.service
%systemd_postun_with_restart pmlogger.service
%systemd_post pmlogger.service
%systemd_postun_with_restart pmlogger_farm.service
%systemd_post pmlogger_farm.service
%systemd_post pmlogger_farm_check.service
%systemd_postun_with_restart pmie.service
%systemd_post pmie.service
%systemd_postun_with_restart pmie_farm.service
%systemd_post pmie_farm.service
%systemd_post pmie_farm_check.service
systemctl condrestart pmproxy.service >/dev/null 2>&1
%else
/sbin/chkconfig --add pmcd >/dev/null 2>&1
/sbin/service pmcd condrestart
/sbin/chkconfig --add pmlogger >/dev/null 2>&1
/sbin/service pmlogger condrestart
/sbin/chkconfig --add pmlogger_farm >/dev/null 2>&1
/sbin/service pmlogger_farm condrestart
/sbin/chkconfig --add pmie >/dev/null 2>&1
/sbin/service pmie condrestart
/sbin/chkconfig --add pmie_farm >/dev/null 2>&1
/sbin/service pmie_farm condrestart
/sbin/chkconfig --add pmproxy >/dev/null 2>&1
/sbin/service pmproxy condrestart
%endif
@ -3158,8 +3198,6 @@ PCP_LOG_DIR=%{_logsdir}
%files pmda-slurm -f pcp-pmda-slurm-files.rpm
%files pmda-vmware -f pcp-pmda-vmware-files.rpm
%files pmda-zimbra -f pcp-pmda-zimbra-files.rpm
%endif
@ -3218,6 +3256,8 @@ PCP_LOG_DIR=%{_logsdir}
%files pmda-lmsensors -f pcp-pmda-lmsensors-files.rpm
%files pmda-mongodb -f pcp-pmda-mongodb-files.rpm
%if !%{disable_mssql}
%files pmda-mssql -f pcp-pmda-mssql-files.rpm
%endif
@ -3345,6 +3385,9 @@ PCP_LOG_DIR=%{_logsdir}
%files zeroconf -f pcp-zeroconf-files.rpm
%changelog
* Wed Nov 10 2021 Nathan Scott <nathans@redhat.com> - 5.3.5-1
- Update to latest PCP sources (BZ 1991764)
* Fri Oct 15 2021 Mark Goodwin <mgoodwin@redhat.com> - 5.3.4-2
- Fix pmlogger manual start with service disabled (BZ 2013937)

View File

@ -1,183 +0,0 @@
commit b9ff7d65b5e11cae35995495b4177443283c9a31
Author: Mark Goodwin <mgoodwin@redhat.com>
Date: Wed Oct 13 12:04:35 2021 +1100
services: remove run-level check in pmlogger systemd service config
Remove the run-level check (pmlogger_check -C flag) since systemd
uses targets for run-level checks. The run-level checks were causing
the pmlogger service to fail to manually start (via systemctl start
pmlogger) when the service is disabled.
New test qa/1889 checks pmlogger still starts even if disabled (on
systemd platforms only). qa/808 is also reworked since it was running
pmlogger_check directly and was failing every *second* run.
diff --git a/qa/1889 b/qa/1889
new file mode 100755
index 000000000..00b748968
--- /dev/null
+++ b/qa/1889
@@ -0,0 +1,68 @@
+#!/bin/sh
+# PCP QA Test No. 1889
+# test primary pmlogger starts under systemd when service is disabled
+#
+# Copyright (c) 2021 Red Hat. All Rights Reserved.
+#
+seq=`basename $0`
+echo "QA output created by $seq"
+
+# get standard environment, filters and checks
+. ./common.product
+. ./common.filter
+. ./common.check
+
+# this tests systemd starting pmlogger
+which systemctl >/dev/null 2>&1 || _notrun "systemctl not installed"
+
+_cleanup()
+{
+ cd $here
+ if [ -n "$pid" ]
+ then
+ $sudo rm -f $PCP_TMP_DIR/pmlogger/$pid $PCP_RUN_DIR/pmlogger.$pid.socket
+ fi
+ $sudo rm -f $PCP_RUN_DIR/pmlogger.pid
+ echo "=== enable pmlogger.service"
+ $sudo systemctl enable pmlogger.service >/dev/null 2>&1
+ _restore_auto_restart pmlogger
+ _service pmlogger restart | _filter_pcp_start
+ rm -rf $tmp.*
+}
+
+status=1 # failure is the default!
+$sudo rm -rf $tmp.* $seq.full
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# real QA test starts here
+_stop_auto_restart pmlogger
+
+pid=`$PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep 'pmlogger.*-P' | \
+grep -v grep | awk '{print $2}'`
+
+if [ ! -S "$PCP_RUN_DIR/pmlogger.$pid.socket" ]; then
+ echo FAIL no primary pmlogger running? pid=$pid
+ status=1
+ exit
+fi
+echo found primary pmlogger and found control socket in PCP_RUN_DIR
+
+echo "=== disable pmlogger.service" | tee -a $seq.full
+$sudo systemctl disable pmlogger.service >>$seq.full 2>&1
+
+echo === start primary logger whilst disabled ===
+_service pmlogger start | _filter_pcp_start
+_wait_for_pmlogger
+
+newpid=`$PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep 'pmlogger.*-P' | \
+ grep -v grep | awk '{print $2}'`
+
+if [ -z "$newpid" ]; then
+ echo FAIL pmlogger failed to start whilst disabled
+ status=1
+ exit
+fi
+echo found primary pmlogger and found control socket in PCP_RUN_DIR
+status=0
+
+exit
diff --git a/qa/1889.out b/qa/1889.out
new file mode 100644
index 000000000..67d0e457f
--- /dev/null
+++ b/qa/1889.out
@@ -0,0 +1,6 @@
+QA output created by 1889
+found primary pmlogger and found control socket in PCP_RUN_DIR
+=== disable pmlogger.service
+=== start primary logger whilst disabled ===
+found primary pmlogger and found control socket in PCP_RUN_DIR
+=== enable pmlogger.service
diff --git a/qa/808 b/qa/808
index 6b0b64a7e..f1c796ee9 100755
--- a/qa/808
+++ b/qa/808
@@ -53,9 +53,9 @@ else
done
$sudo kill -0 $pid >/dev/null 2>&1 && echo "Arrggh, pid $pid won't die!"
- echo === running pmlogger_check to restart primary logger ===
- $sudo $PCP_BINADM_DIR/pmlogger_check -C
- sleep 2
+ echo === restart primary logger ===
+ _service pmlogger start | _filter_pcp_start
+ _wait_for_pmlogger
newpid=`$PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep 'pmlogger.*-P' | \
grep -v grep | awk '{print $2}'`
@@ -98,9 +98,9 @@ else
$sudo rm -f $PCP_RUN_DIR/pmlogger.primary.socket
$sudo ln $PCP_RUN_DIR/pmlogger.$pid.socket $PCP_RUN_DIR/pmlogger.primary.socket
- echo === running pmlogger_check to restart primary logger ===
- $sudo $PCP_BINADM_DIR/pmlogger_check -C
- sleep 2
+ echo === restart primary logger ===
+ _service pmlogger start | _filter_pcp_start
+ _wait_for_pmlogger
newpid=`$PCP_PS_PROG $PCP_PS_ALL_FLAGS | grep 'pmlogger.*-P' | \
grep -v grep | awk '{print $2}'`
diff --git a/qa/808.out b/qa/808.out
index fdd386503..be2f16086 100644
--- a/qa/808.out
+++ b/qa/808.out
@@ -1,7 +1,7 @@
QA output created by 808
found primary pmlogger and found control socket in PCP_RUN_DIR
=== killing the primary pmlogger with SIGKILL ===
-=== running pmlogger_check to restart primary logger ===
+=== restart primary logger ===
=== checking with stale legacy hard links
=== killing the primary pmlogger with SIGKILL ===
-=== running pmlogger_check to restart primary logger ===
+=== restart primary logger ===
diff --git a/qa/group b/qa/group
index 7b50c353e..3f2033f53 100644
--- a/qa/group
+++ b/qa/group
@@ -1946,6 +1946,7 @@ x11
1874 pmseries pmproxy local
1876 pmcd secure local
1886 pmseries libpcp_web local
+1889 pmlogger local
1893 pmda.proc local
1895 pmda.bpf local
1896 pmlogger logutil pmlc local
diff --git a/src/pmlogger/pmlogger.service.in b/src/pmlogger/pmlogger.service.in
index 19b904cff..c24143734 100644
--- a/src/pmlogger/pmlogger.service.in
+++ b/src/pmlogger/pmlogger.service.in
@@ -9,7 +9,7 @@ Wants=pmcd.service
[Service]
Type=notify
NotifyAccess=all
-Environment="PMLOGGER_CHECK_PARAMS=-C --only-primary"
+Environment="PMLOGGER_CHECK_PARAMS=--only-primary"
EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmlogger
TimeoutStartSec=120
TimeoutStopSec=120
diff --git a/src/pmlogger/pmlogger_check.service.in b/src/pmlogger/pmlogger_check.service.in
index af58997f3..ef24d30a5 100644
--- a/src/pmlogger/pmlogger_check.service.in
+++ b/src/pmlogger/pmlogger_check.service.in
@@ -13,7 +13,7 @@ TimeoutStopSec=120
# which is timer driven and exits. KillMode is temporary and will
# not be necessary once we have pmlogger-farm.service.
KillMode=process
-Environment="PMLOGGER_CHECK_PARAMS=-C --skip-primary"
+Environment="PMLOGGER_CHECK_PARAMS=--skip-primary"
EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmlogger_timers
ExecStart=@PCP_BINADM_DIR@/pmlogger_check $PMLOGGER_CHECK_PARAMS
WorkingDirectory=@PCP_VAR_DIR@

View File

@ -1 +1 @@
SHA512 (pcp-5.3.4.src.tar.gz) = 7753955712cd740c668fb23af82013916e8a6ddb25d6d6209afd2f8ac376e945ef4df3d0aa9f358ce45263b0e7aace864eaf59ef696739cc583c3b91ec3ca0aa
SHA512 (pcp-5.3.5.src.tar.gz) = d5481e2667d881ebc6a70e842958350e400f0a34cf746a29a97e77150af78d50d6eec5108a4e6fb013025bbd1089828c7cc02cc18220925f0198ed02924dc693