diff --git a/.gitignore b/.gitignore index 466cd93..d22a71b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -SOURCES/pcp-3.11.3.src.tar.gz -SOURCES/pcp-webjs-3.11.2.tar.gz +SOURCES/pcp-3.11.8.src.tar.gz +SOURCES/pcp-webjs-3.11.8.src.tar.gz SOURCES/vector-1.1.0.tar.gz diff --git a/.pcp.metadata b/.pcp.metadata index 6855e85..b8c5f28 100644 --- a/.pcp.metadata +++ b/.pcp.metadata @@ -1,3 +1,3 @@ -8f29aba8b9b69f3a7413ccf96531f7aca73ad573 SOURCES/pcp-3.11.3.src.tar.gz -642f251e68e64b83c50d98d3b130f19cec38138b SOURCES/pcp-webjs-3.11.2.tar.gz +bab944a0874b89bd1f29c9a135270848f3683a57 SOURCES/pcp-3.11.8.src.tar.gz +d0507dcb9e816df1211357b5e3bb525f0f45bdca SOURCES/pcp-webjs-3.11.8.src.tar.gz 687b20283d4aee6c5494341843cb7ff01c393459 SOURCES/vector-1.1.0.tar.gz diff --git a/SOURCES/rhbz1211432.patch b/SOURCES/rhbz1211432.patch new file mode 100644 index 0000000..e214a81 --- /dev/null +++ b/SOURCES/rhbz1211432.patch @@ -0,0 +1,430 @@ +Author: Lukas Berk +Date: Fri Apr 21 17:41:41 2017 -0400 + + Add zeroconf rpm subpackage + + fedora.spec - packaging, nfsclient .Needinstall, set pmlogger to 10s + pcp.spec.in - ditto + GNUmakefiles - subdirectory work + atop-proc - pmlogconf for atop/proc metrics + nfsclient - pmlogconf for nfsclient metrics + xfs-perdev - pmlogconf for logging xfs.perdev metrics + +diff --git a/src/GNUmakefile b/src/GNUmakefile +index 0c3579f..ee8d5d6 100644 +--- a/src/GNUmakefile ++++ b/src/GNUmakefile +@@ -106,6 +106,7 @@ OTHER_SUBDIRS = \ + pmpython \ + derived \ + selinux \ ++ zeroconf \ + # + + SUBDIRS = \ +diff --git a/src/pmlogconf/GNUmakefile b/src/pmlogconf/GNUmakefile +index 42e563c..4de5ed9 100644 +--- a/src/pmlogconf/GNUmakefile ++++ b/src/pmlogconf/GNUmakefile +@@ -15,7 +15,7 @@ + TOPDIR = ../.. + include $(TOPDIR)/src/include/builddefs + +-SUBDIRS = v1.0 platform disk sgi memory cpu kernel filesystem networking tools ++SUBDIRS = v1.0 platform disk sgi memory cpu kernel filesystem networking tools zeroconf + + default: makefiles pmlogconf.sh pmlogconf-setup.sh + +diff --git a/src/pmlogconf/zeroconf/GNUmakefile b/src/pmlogconf/zeroconf/GNUmakefile +new file mode 100644 +index 0000000..ecf8521 +--- /dev/null ++++ b/src/pmlogconf/zeroconf/GNUmakefile +@@ -0,0 +1,41 @@ ++# ++# Copyright (c) 2017 Red Hat. ++# ++# This program is free software; you can redistribute it and/or modify it ++# under the terms of the GNU General Public License as published by the ++# Free Software Foundation; either version 2 of the License, or (at your ++# option) any later version. ++# ++# This program is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ++# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++# for more details. ++# ++ ++TOPDIR = ../../.. ++include $(TOPDIR)/src/include/builddefs ++include localdefs ++ ++WORKDIR := $(shell pwd) ++GROUP := $(shell basename $(WORKDIR)) ++GROUPDIR = $(PCP_VAR_DIR)/config/pmlogconf ++ ++LDIRT = GNUmakefile ++ ++DEFAULT = $(FILES) ++ ++LSRCFILES = localdefs $(DEFAULT) ++ ++CONFIGS = $(subst "./","",$(DEFAULT)) ++ ++default_pcp: $(DEFAULT) ++ ++install_pcp: install ++ ++install: default_pcp ++ $(INSTALL) -d $(GROUPDIR)/$(GROUP) ++ @for f in $(CONFIGS); do \ ++ $(INSTALL) -m 644 $$f $(GROUPDIR)/$(GROUP)/$$f; \ ++ done ++ ++include $(BUILDRULES) +diff --git a/src/pmlogconf/zeroconf/atop-proc b/src/pmlogconf/zeroconf/atop-proc +new file mode 100644 +index 0000000..11da450 +--- /dev/null ++++ b/src/pmlogconf/zeroconf/atop-proc +@@ -0,0 +1,44 @@ ++#pmlogconf-setup 2.0 ++ident per-process metrics used by the atop command for zeroconf subpackage ++probe kernel.uname.sysname ~ Linux ? include : exclude ++delta 10 seconds ++ ++ proc.psinfo.cmd ++ proc.psinfo.sname ++ proc.psinfo.ppid ++ proc.psinfo.minflt ++ proc.psinfo.maj_flt ++ proc.psinfo.utime ++ proc.psinfo.stime ++ proc.psinfo.priority ++ proc.psinfo.nice ++ proc.psinfo.start_time ++ proc.psinfo.vsize ++ proc.psinfo.rss ++ proc.psinfo.processor ++ proc.psinfo.rt_priority ++ proc.psinfo.policy ++ proc.psinfo.threads ++ proc.psinfo.tgid ++ proc.psinfo.pid ++ proc.namespaces.envid ++ proc.id.uid ++ proc.id.euid ++ proc.id.suid ++ proc.id.fsuid ++ proc.id.gid ++ proc.id.egid ++ proc.id.sgid ++ proc.id.fsgid ++ proc.memory.vmdata ++ proc.memory.vmstack ++ proc.memory.vmexe ++ proc.memory.vmlib ++ proc.memory.vmswap ++ proc.io.read_bytes ++ proc.io.write_bytes ++ proc.io.cancelled_write_bytes ++ proc.id.uid_nm ++ proc.id.euid_nm ++ proc.id.suid_nm ++ proc.id.fsuid_nm +diff --git a/src/pmlogconf/zeroconf/localdefs b/src/pmlogconf/zeroconf/localdefs +new file mode 100644 +index 0000000..8a43fb1 +--- /dev/null ++++ b/src/pmlogconf/zeroconf/localdefs +@@ -0,0 +1,4 @@ ++FILES = \ ++ atop-proc \ ++ xfs-perdev ++# END +\ No newline at end of file +diff --git a/src/pmlogconf/zeroconf/nfsclient b/src/pmlogconf/zeroconf/nfsclient +new file mode 100644 +index 0000000..919a1ec +--- /dev/null ++++ b/src/pmlogconf/zeroconf/nfsclient +@@ -0,0 +1,7 @@ ++#pmlogconf-setup 2.0 ++ident metrics used by zeroconf setup ++probe kernel.uname.sysname ~ Linux ? include : exclude ++delta 10 seconds ++ ++# nfsclient metrics ++ nfsclient +diff --git a/src/pmlogconf/zeroconf/xfs-perdev b/src/pmlogconf/zeroconf/xfs-perdev +new file mode 100644 +index 0000000..0a4f4e1 +--- /dev/null ++++ b/src/pmlogconf/zeroconf/xfs-perdev +@@ -0,0 +1,7 @@ ++#pmlogconf-setup 2.0 ++ident metrics used by zeroconf setup ++probe kernel.uname.sysname ~ Linux ? include : exclude ++delta 10 seconds ++ ++# xfs.perdev metrics ++ xfs.perdev +commit 28a557d44aabc0817296c402a7315c489f54d9a0 +Author: Nathan Scott +Date: Tue May 9 14:30:25 2017 +1000 + + zeroconf: enable pmie and dmthin monitoring, minor fixes + + Ensure nfsclient metrics are included in the install, add + specfile deps on needed PMDAs, use PCP_SYSCONFIG_DIR the + same way across spec files, and handle scripting via %post + so we're sure all installed bits are available for use. + + This incorporates feedback from mgoodwin and tbowling @RH. + +diff --git a/src/pmlogconf/zeroconf/localdefs b/src/pmlogconf/zeroconf/localdefs +index 8a43fb1..e2e11a0 100644 +--- a/src/pmlogconf/zeroconf/localdefs ++++ b/src/pmlogconf/zeroconf/localdefs +@@ -1,4 +1,5 @@ + FILES = \ + atop-proc \ ++ nfsclient \ + xfs-perdev +-# END +\ No newline at end of file ++# END +commit 8f496f54c1a1902b2829de7508fba7c97d8b592a +Author: Nathan Scott +Date: Thu May 11 15:51:07 2017 +1000 + + build: fix pmlogconf/zeroconf makefile (auto-)creation + + Also only descend into zeroconf pmlogconf subdir if we will + be packaging it up intentionally (i.e. for RPM platforms), + otherwise it becomes the default instead of opt-in for non- + RPM platforms. + +diff --git a/src/pmlogconf/.gitignore b/src/pmlogconf/.gitignore +index 8d59d51..b5f297c 100644 +--- a/src/pmlogconf/.gitignore ++++ b/src/pmlogconf/.gitignore +@@ -9,3 +9,4 @@ sgi/GNUmakefile + sqlserver/GNUmakefile + v1.0/GNUmakefile + tools/GNUmakefile ++zeroconf/GNUmakefile +diff --git a/src/pmlogconf/GNUmakefile b/src/pmlogconf/GNUmakefile +index 4de5ed9..edfbcbc 100644 +--- a/src/pmlogconf/GNUmakefile ++++ b/src/pmlogconf/GNUmakefile +@@ -15,7 +15,15 @@ + TOPDIR = ../.. + include $(TOPDIR)/src/include/builddefs + +-SUBDIRS = v1.0 platform disk sgi memory cpu kernel filesystem networking tools zeroconf ++SUBDIRS = v1.0 platform disk sgi memory cpu kernel filesystem networking tools ++ ++# Only evaluate zeroconf configurations if we package that. ++# Otherwise zeroconf will be installed for all platforms as ++# the default, which is not what we want (it's opt-in). ++# ++ifneq "$(RPMPROG)" "" ++SUBDIRS += zeroconf ++endif + + default: makefiles pmlogconf.sh pmlogconf-setup.sh + +diff --git a/src/pmlogconf/zeroconf/GNUmakefile b/src/pmlogconf/zeroconf/GNUmakefile +deleted file mode 100644 +index ecf8521..0000000 +--- a/src/pmlogconf/zeroconf/GNUmakefile ++++ /dev/null +@@ -1,41 +0,0 @@ +-# +-# Copyright (c) 2017 Red Hat. +-# +-# This program is free software; you can redistribute it and/or modify it +-# under the terms of the GNU General Public License as published by the +-# Free Software Foundation; either version 2 of the License, or (at your +-# option) any later version. +-# +-# This program is distributed in the hope that it will be useful, but +-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +-# for more details. +-# +- +-TOPDIR = ../../.. +-include $(TOPDIR)/src/include/builddefs +-include localdefs +- +-WORKDIR := $(shell pwd) +-GROUP := $(shell basename $(WORKDIR)) +-GROUPDIR = $(PCP_VAR_DIR)/config/pmlogconf +- +-LDIRT = GNUmakefile +- +-DEFAULT = $(FILES) +- +-LSRCFILES = localdefs $(DEFAULT) +- +-CONFIGS = $(subst "./","",$(DEFAULT)) +- +-default_pcp: $(DEFAULT) +- +-install_pcp: install +- +-install: default_pcp +- $(INSTALL) -d $(GROUPDIR)/$(GROUP) +- @for f in $(CONFIGS); do \ +- $(INSTALL) -m 644 $$f $(GROUPDIR)/$(GROUP)/$$f; \ +- done +- +-include $(BUILDRULES) +commit e574b2680e7360b02743fd5e69bd4c84f546426c +Author: Mark Goodwin +Date: Fri May 26 17:12:30 2017 +1000 + + pmlogconf: add proc.psinfo.guest_time to atop-proc for pcp-pidstat + +diff --git a/src/pmlogconf/tools/atop-proc b/src/pmlogconf/tools/atop-proc +index 93230f7..b523ae2 100644 +--- a/src/pmlogconf/tools/atop-proc ++++ b/src/pmlogconf/tools/atop-proc +@@ -12,6 +12,7 @@ force available + proc.psinfo.priority + proc.psinfo.nice + proc.psinfo.start_time ++ proc.psinfo.guest_time + proc.psinfo.vsize + proc.psinfo.rss + proc.psinfo.processor +commit 69a48c619ccb6975a33a4fb30f628e25473e3aee +Author: Mark Goodwin +Date: Fri May 26 17:24:19 2017 +1000 + + pmlogconf: add config for pcp-tapestat + + Also add hinv.ntape to the pcp-summary config. + +diff --git a/src/pmlogconf/tools/pcp-summary b/src/pmlogconf/tools/pcp-summary +index 240d92b..916e16b 100644 +--- a/src/pmlogconf/tools/pcp-summary ++++ b/src/pmlogconf/tools/pcp-summary +@@ -4,6 +4,7 @@ force include + delta once + hinv.ncpu + hinv.ndisk ++ hinv.ntape + hinv.nnode + hinv.physmem + pmda.uname +diff --git a/src/pmlogconf/tools/tapestat b/src/pmlogconf/tools/tapestat +new file mode 100644 +index 0000000..bc4ff2a +--- /dev/null ++++ b/src/pmlogconf/tools/tapestat +@@ -0,0 +1,5 @@ ++#pmlogconf-setup 2.0 ++ident metrics used by the pcp-tapestat(1) command ++probe kernel.uname.sysname ~ Linux ? include : exclude ++ ++ tape.dev +commit b375c50bc22ccceea89236ec06cb84a72284719a +Author: Mark Goodwin +Date: Fri May 26 17:26:14 2017 +1000 + + pmlogconf: add numastat, pidstat and tapestat to the zeroconf config + + Adding numastat, pidstat and tapestat to zeroconf doesn't add much + extra logging and we get better tool coverage for replaying default + zeroconf archives. We're already logging atop-proc and add one more + metric so pidstat can also replay. + + QA to follow using qa/archives/pcp-zeroconf. + +diff --git a/src/pmlogconf/zeroconf/atop-proc b/src/pmlogconf/zeroconf/atop-proc +index 11da450..f56525d 100644 +--- a/src/pmlogconf/zeroconf/atop-proc ++++ b/src/pmlogconf/zeroconf/atop-proc +@@ -12,6 +12,7 @@ delta 10 seconds + proc.psinfo.stime + proc.psinfo.priority + proc.psinfo.nice ++ proc.psinfo.guest_time + proc.psinfo.start_time + proc.psinfo.vsize + proc.psinfo.rss +diff --git a/src/pmlogconf/zeroconf/localdefs b/src/pmlogconf/zeroconf/localdefs +index e2e11a0..253977b 100644 +--- a/src/pmlogconf/zeroconf/localdefs ++++ b/src/pmlogconf/zeroconf/localdefs +@@ -1,5 +1,8 @@ + FILES = \ + atop-proc \ + nfsclient \ +- xfs-perdev ++ xfs-perdev \ ++ pidstat-summary \ ++ tapestat \ ++ numastat + # END +diff --git a/src/pmlogconf/zeroconf/numastat b/src/pmlogconf/zeroconf/numastat +new file mode 100644 +index 0000000..9e2289c +--- /dev/null ++++ b/src/pmlogconf/zeroconf/numastat +@@ -0,0 +1,6 @@ ++#pmlogconf-setup 2.0 ++ident metrics used by the pcp-numastat(1) command ++probe kernel.uname.sysname ~ Linux ? include : exclude ++delta 10 seconds ++ ++ mem.numa.alloc +diff --git a/src/pmlogconf/zeroconf/pidstat-summary b/src/pmlogconf/zeroconf/pidstat-summary +new file mode 100644 +index 0000000..7dd00cc +--- /dev/null ++++ b/src/pmlogconf/zeroconf/pidstat-summary +@@ -0,0 +1,10 @@ ++#pmlogconf-setup 2.0 ++ident metrics sampled once by the pcp-pidstat(1) command ++probe kernel.uname.sysname ~ Linux ? include : exclude ++delta once ++ hinv.ncpu ++ kernel.uname.nodename ++ kernel.uname.release ++ kernel.uname.sysname ++ kernel.uname.machine ++ mem.physmem +diff --git a/src/pmlogconf/zeroconf/tapestat b/src/pmlogconf/zeroconf/tapestat +new file mode 100644 +index 0000000..f0f0394 +--- /dev/null ++++ b/src/pmlogconf/zeroconf/tapestat +@@ -0,0 +1,6 @@ ++#pmlogconf-setup 2.0 ++ident metrics used by the pcp-tapestat(1) command ++probe kernel.uname.sysname ~ Linux ? include : exclude ++delta 10 seconds ++ ++ tape.dev +commit 359a4b024dd22457f80aac7f47bd045aa4e73b5b +Author: Nathan Scott +Date: Mon May 29 17:02:05 2017 +1000 + + build: add pmlogconf tools/tapestat into the build + +diff --git a/src/pmlogconf/tools/localdefs b/src/pmlogconf/tools/localdefs +index 75abda3..7595e5d 100644 +--- a/src/pmlogconf/tools/localdefs ++++ b/src/pmlogconf/tools/localdefs +@@ -24,6 +24,7 @@ FILES = \ + pmstat \ + sar \ + sar-summary \ ++ tapestat \ + uptime \ + vector \ + vector-summary \ diff --git a/SOURCES/rhbz1336211.patch b/SOURCES/rhbz1336211.patch deleted file mode 100644 index 53ecac2..0000000 --- a/SOURCES/rhbz1336211.patch +++ /dev/null @@ -1,131 +0,0 @@ -diff -Naurp pcp-3.11.3.orig/src/pmdas/linux_proc/getinfo.c pcp-3.11.3/src/pmdas/linux_proc/getinfo.c ---- pcp-3.11.3.orig/src/pmdas/linux_proc/getinfo.c 2016-02-29 11:53:04.000000000 +1100 -+++ pcp-3.11.3/src/pmdas/linux_proc/getinfo.c 2016-08-05 15:06:14.699422894 +1000 -@@ -1,4 +1,5 @@ - /* -+ * Copyright (c) 2016 Red Hat. - * Copyright (c) 2010 Aconex. All Rights Reserved. - * Copyright (c) 2000,2004 Silicon Graphics, Inc. All Rights Reserved. - * -@@ -14,42 +15,54 @@ - */ - - #include --#include - #include - #include - #include "pmapi.h" - -+/* -+ * Convert kernels string device number encoding into a dev_t. -+*/ -+dev_t -+get_encoded_dev(const char *devnum) -+{ -+ unsigned device = (unsigned int)strtoul(devnum, NULL, 0); -+ return (dev_t)device; -+} -+ -+/* -+ * Attempt to map a device number to a tty for a given process. -+ * -+ * Previously this was much more elaborate, scanning all open fds -+ * for a match on the device; but that is expensive for processes -+ * with many open fds, and we end up stat'ing all sorts of files -+ * unrelated to the job at hand (which SElinux blocks and reports -+ * as poor form). -+ * -+ * Returns a pointer into a static buffer, so no free'ing needed. -+ */ - char * --get_ttyname_info(int pid, dev_t dev, char *ttyname) -+get_ttyname_info(int pid, dev_t dev) - { -- DIR *dir; -- struct dirent *dp; -- struct stat sbuf; -- int found=0; -- char procpath[MAXPATHLEN]; -+ int i; -+ size_t length; -+ struct stat statbuf; - char ttypath[MAXPATHLEN]; -+ char procpath[MAXPATHLEN]; -+ static char ttyname[MAXPATHLEN]; -+ const int fds[] = { STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO }; - -- sprintf(procpath, "/proc/%d/fd", pid); -- if ((dir = opendir(procpath)) != NULL) { -- while ((dp = readdir(dir)) != NULL) { -- if (!isdigit((int)dp->d_name[0])) -- continue; -- sprintf(procpath, "/proc/%d/fd/%s", pid, dp->d_name); -- if (realpath(procpath, ttypath) == NULL || stat(ttypath, &sbuf) < 0) -- continue; -- if (S_ISCHR(sbuf.st_mode) && dev == sbuf.st_rdev) { -- found=1; -- break; -- } -+ strcpy(ttyname, "?"); -+ for (i = 0; i < sizeof(fds)/sizeof(int); i++) { -+ sprintf(procpath, "/proc/%d/fd/%d", pid, fds[i]); -+ if ((length = readlink(procpath, ttypath, sizeof(ttypath)-1)) < 0) -+ continue; -+ ttypath[length] = '\0'; -+ if (strncmp(ttypath, "/dev/", 5) == 0 && -+ stat(ttypath, &statbuf) == 0 && -+ S_ISCHR(statbuf.st_mode) && dev == statbuf.st_rdev) { -+ strcpy(ttyname, &ttypath[5]); /* skip "/dev/" prefix */ -+ break; - } -- closedir(dir); - } -- -- if (!found) -- strcpy(ttyname, "?"); -- else -- /* skip the "/dev/" prefix */ -- strcpy(ttyname, &ttypath[5]); -- - return ttyname; - } -diff -Naurp pcp-3.11.3.orig/src/pmdas/linux_proc/getinfo.h pcp-3.11.3/src/pmdas/linux_proc/getinfo.h ---- pcp-3.11.3.orig/src/pmdas/linux_proc/getinfo.h 2016-02-29 11:53:04.000000000 +1100 -+++ pcp-3.11.3/src/pmdas/linux_proc/getinfo.h 2016-08-05 15:06:14.700422880 +1000 -@@ -1,4 +1,5 @@ - /* -+ * Copyright (c) 2016 Red Hat. - * Copyright (c) 2010 Aconex. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it -@@ -12,5 +13,6 @@ - * for more details. - */ - --extern char *get_ttyname_info(int, dev_t, char *); -+extern dev_t get_encoded_dev(const char *); -+extern char *get_ttyname_info(int, dev_t); - -diff -Naurp pcp-3.11.3.orig/src/pmdas/linux_proc/pmda.c pcp-3.11.3/src/pmdas/linux_proc/pmda.c ---- pcp-3.11.3.orig/src/pmdas/linux_proc/pmda.c 2016-05-16 16:28:19.000000000 +1000 -+++ pcp-3.11.3/src/pmdas/linux_proc/pmda.c 2016-08-05 15:06:14.701422866 +1000 -@@ -1896,8 +1896,6 @@ proc_fetchCallBack(pmdaMetric *mdesc, un - if (idp->item == 99) /* proc.nprocs */ - atom->ul = active_proc_pid->indom->it_numinst; - else { -- static char ttyname[MAXPATHLEN]; -- - if (!have_access) - return PM_ERR_PERMISSION; - entry = fetch_proc_pid_stat(inst, active_proc_pid, &sts); -@@ -1914,8 +1912,8 @@ proc_fetchCallBack(pmdaMetric *mdesc, un - if (f == NULL) - atom->cp = "?"; - else { -- dev_t dev = (dev_t)atoi(f); -- atom->cp = get_ttyname_info(inst, dev, ttyname); -+ dev_t dev = get_encoded_dev(f); -+ atom->cp = get_ttyname_info(inst, dev); - } - break; - diff --git a/SOURCES/rhbz1349932.patch b/SOURCES/rhbz1349932.patch deleted file mode 100644 index 3510215..0000000 --- a/SOURCES/rhbz1349932.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff -Naurp pcp-3.11.3.orig/src/pmdas/linux/filesys.c pcp-3.11.3/src/pmdas/linux/filesys.c ---- pcp-3.11.3.orig/src/pmdas/linux/filesys.c 2016-02-29 11:53:04.000000000 +1100 -+++ pcp-3.11.3/src/pmdas/linux/filesys.c 2016-07-07 16:46:00.633663707 +1000 -@@ -1,7 +1,7 @@ - /* - * Linux Filesystem Cluster - * -- * Copyright (c) 2014-2015 Red Hat. -+ * Copyright (c) 2014-2016 Red Hat. - * Copyright (c) 2000,2004,2007-2008 Silicon Graphics, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it -@@ -90,8 +90,12 @@ refresh_filesys(pmInDom filesys_indom, p - } - else if (strncmp(device, "/dev", 4) != 0) - continue; -- if (realpath(device, src) != NULL) -- device = src; -+ -+ /* keep dm and md persistent names, RHBZ#1349932 */ -+ if (strncmp(device, "/dev/mapper", 11) != 0 && strncmp(device, "/dev/md", 7) != 0) { -+ if (realpath(device, src) != NULL) -+ device = src; -+ } - - sts = pmdaCacheLookupName(indom, device, NULL, (void **)&fs); - if (sts == PMDA_CACHE_ACTIVE) /* repeated line in /proc/mounts? */ -diff -Naurp pcp-3.11.3.orig/src/pmdas/mounts/mounts.c pcp-3.11.3/src/pmdas/mounts/mounts.c ---- pcp-3.11.3.orig/src/pmdas/mounts/mounts.c 2016-02-29 11:53:04.000000000 +1100 -+++ pcp-3.11.3/src/pmdas/mounts/mounts.c 2016-07-07 16:46:00.633663707 +1000 -@@ -1,7 +1,7 @@ - /* - * Mounts PMDA, info on current tracked filesystem mounts - * -- * Copyright (c) 2012,2015 Red Hat. -+ * Copyright (c) 2012,2015-2016 Red Hat. - * Copyright (c) 2001,2003,2004 Silicon Graphics, Inc. All Rights Reserved. - * Copyright (c) 2001 Alan Bailey (bailey@mcs.anl.gov or abailey@ncsa.uiuc.edu) - * All rights reserved. -@@ -323,7 +323,8 @@ mounts_refresh_mounts(void) - if (strcmp(path, mounts[item].i_name) != 0) - continue; - strncpy(mp->type, type, MAXFSTYPE-1); -- if (realpath(device, mp->device) == NULL) -+ /* don't resolve dm symlinks - we want the persistent device name, not the dm-* name */ -+ if (strncmp(device, "/dev/mapper", 11) == 0 || realpath(device, mp->device) == NULL) - strncpy(mp->device, device, MAXPATHLEN-1); - strncpy(mp->options, options, MAXOPTSTR-1); - mp->flags = MOUNTS_FLAG_UP; diff --git a/SOURCES/rhbz1351223.patch b/SOURCES/rhbz1351223.patch deleted file mode 100644 index 98ac72a..0000000 --- a/SOURCES/rhbz1351223.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff -Naurp pcp-3.11.3.orig/qa/006.out pcp-3.11.3/qa/006.out ---- pcp-3.11.3.orig/qa/006.out 2016-05-23 14:59:11.000000000 +1000 -+++ pcp-3.11.3/qa/006.out 2016-08-05 15:09:10.008021649 +1000 -@@ -57,7 +57,7 @@ QA output created by 006 - -12400 Bad input to pmstore - -12401 Archives overlap in time - -12402 Archives differ by host ---12403 Archives differ by time zone -+-12403 No such PMAPI error code (-12403) - -12404 The type of a metric has changed in an archive - -12405 The semantics of a metric has changed in an archive - -12406 The instance domain of a metric has changed in an archive -diff -Naurp pcp-3.11.3.orig/src/include/pcp/pmapi.h pcp-3.11.3/src/include/pcp/pmapi.h ---- pcp-3.11.3.orig/src/include/pcp/pmapi.h 2016-05-25 09:37:12.000000000 +1000 -+++ pcp-3.11.3/src/include/pcp/pmapi.h 2016-08-05 15:09:10.009021635 +1000 -@@ -189,7 +189,7 @@ typedef struct pmDesc { - #define PM_ERR_BADSTORE (-PM_ERR_BASE-55) /* Bad input to pmstore */ - #define PM_ERR_LOGOVERLAP (-PM_ERR_BASE-56) /* Archives overlap in time */ - #define PM_ERR_LOGHOST (-PM_ERR_BASE-57) /* Archives differ by host */ --#define PM_ERR_LOGTIMEZONE (-PM_ERR_BASE-58) /* Archives differ in time zone */ -+ /* retired PM_ERR_LOGTIMEZONE (-PM_ERR_BASE-58) Archives differ in time zone */ - #define PM_ERR_LOGCHANGETYPE (-PM_ERR_BASE-59) /* The type of a metric has changed in an archive */ - #define PM_ERR_LOGCHANGESEM (-PM_ERR_BASE-60) /* The semantics of a metric has changed in an archive */ - #define PM_ERR_LOGCHANGEINDOM (-PM_ERR_BASE-61) /* The instance domain of a metric has changed in an archive */ -diff -Naurp pcp-3.11.3.orig/src/libpcp/src/err.c pcp-3.11.3/src/libpcp/src/err.c ---- pcp-3.11.3.orig/src/libpcp/src/err.c 2016-05-23 14:59:11.000000000 +1000 -+++ pcp-3.11.3/src/libpcp/src/err.c 2016-08-05 15:09:10.009021635 +1000 -@@ -154,8 +154,6 @@ static const struct { - "Archives overlap in time" }, - { PM_ERR_LOGHOST, "PM_ERR_LOGHOST", - "Archives differ by host" }, -- { PM_ERR_LOGTIMEZONE, "PM_ERR_LOGTIMEZONE", -- "Archives differ by time zone" }, - { PM_ERR_LOGCHANGETYPE, "PM_ERR_LOGCHANGETYPE", - "The type of a metric has changed in an archive" }, - { PM_ERR_LOGCHANGESEM, "PM_ERR_LOGCHANGESEM", -diff -Naurp pcp-3.11.3.orig/src/libpcp/src/logutil.c pcp-3.11.3/src/libpcp/src/logutil.c ---- pcp-3.11.3.orig/src/libpcp/src/logutil.c 2016-05-16 16:42:00.000000000 +1000 -+++ pcp-3.11.3/src/libpcp/src/logutil.c 2016-08-05 15:09:10.008021649 +1000 -@@ -108,12 +108,10 @@ checkLabelConsistency (__pmContext *ctxp - * When checking for consistency, it is sufficient to check vs the - * first archive in the context. - * The version number is checked by __pmLogChkLabel. -- * Check the hostname and the time zone. -+ * Check the hostname. - */ - if (strcmp(lp->ill_hostname, ctxp->c_archctl->ac_log_list[0]->ml_hostname) != 0) - return PM_ERR_LOGHOST; -- if (strcmp(lp->ill_tz, ctxp->c_archctl->ac_log_list[0]->ml_tz) != 0) -- return PM_ERR_LOGTIMEZONE; - - /* All is ok */ - return 0; diff --git a/SOURCES/rhbz1357607.patch b/SOURCES/rhbz1357607.patch deleted file mode 100644 index 4d606d5..0000000 --- a/SOURCES/rhbz1357607.patch +++ /dev/null @@ -1,40 +0,0 @@ -commit 1f0ee8705d108b628e59746e851f51fd1599190c -Author: Nathan Scott -Date: Wed Jul 20 11:47:30 2016 +1000 - - pmda ds389log: use dirsrv as default user account - - In all current Fedora versions and since RHEL7.3 the default - user for 389-ds is dirsrv instead of nobody. - - Update defaults for pcp-pmda-ds389log to reflect this change. - The configuration file can still be used to explicitly set an - alternative user if needed. - - Resolves Red Hat BZ #1357607. - -diff --git a/qa/960 b/qa/960 -index 845da39..5c9f269 100755 ---- a/qa/960 -+++ b/qa/960 -@@ -18,6 +18,7 @@ echo "QA output created by $seq" - which logconv.pl >/dev/null 2>&1 || _notrun "No logconv.pl script installed" - $sudo ls /var/log/dirsrv/slapd-*/access 2>&1 >/dev/null || \ - _notrun "No ds389 directory log files accessible" -+id dirsrv >/dev/null 2>&1 || _notrun "No dirsrv (default) account installed" - - status=1 # failure is the default! - $sudo rm -rf $tmp.* $seq.full -diff --git a/src/pmdas/ds389log/pmdads389log.pl b/src/pmdas/ds389log/pmdads389log.pl -index a7e7c32..fd063db 100644 ---- a/src/pmdas/ds389log/pmdads389log.pl -+++ b/src/pmdas/ds389log/pmdads389log.pl -@@ -25,7 +25,7 @@ our $lc_opts = '-D /dev/shm -s all'; - our $lc_ival = 30; # minimal query interval in seconds, must be >= 30 - our $ds_alog = ''; # empty - guess; ok if only one DS instance in use - our $ds_logd = '/var/log/dirsrv'; --our $ds_user = 'nobody'; # empty - use root -+our $ds_user = 'dirsrv'; # empty - use root - - # Configuration files for overriding the above settings - for my $file (pmda_config('PCP_PMDAS_DIR') . '/ds389log/ds389log.conf', './ds389log.conf') { diff --git a/SOURCES/rhbz1419490.patch b/SOURCES/rhbz1419490.patch new file mode 100644 index 0000000..1f6cef9 Binary files /dev/null and b/SOURCES/rhbz1419490.patch differ diff --git a/SOURCES/rhbz1425880.patch b/SOURCES/rhbz1425880.patch new file mode 100644 index 0000000..d672b3c --- /dev/null +++ b/SOURCES/rhbz1425880.patch @@ -0,0 +1,340 @@ +diff -Naurp pcp-3.11.8-orig/configure pcp-3.11.8/configure +--- pcp-3.11.8-orig/configure 2017-02-14 07:37:52.000000000 +1100 ++++ pcp-3.11.8/configure 2017-03-01 17:09:48.238622561 +1100 +@@ -960,6 +960,7 @@ with_books_brand + with_papi + with_perfevent + with_pmdajson ++with_pmdanutcracker + with_pmdasnmp + with_manager + with_webapi +@@ -1675,6 +1676,7 @@ Optional Packages: + installation prefix, or a pkgconfig module name. + --with-perfevent enable perfevent pmda (default is on) + --with-pmdajson enable JSON pmda (default is on) ++ --with-pmdanutcracker enable nutcracker pmda (default is on) + --with-pmdasnmp enable SNMP pmda (default is on) + --with-manager enable daemon manager (default is on) + --with-webapi enable REST API daemon (default is on) +@@ -2797,6 +2799,15 @@ fi + + + ++# Check whether --with-pmdanutcracker was given. ++if test "${with_pmdanutcracker+set}" = set; then : ++ withval=$with_pmdanutcracker; do_pmdanutcracker=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdanutcracker=$withval" ++else ++ do_pmdanutcracker=check ++fi ++ ++ ++ + # Check whether --with-pmdasnmp was given. + if test "${with_pmdasnmp+set}" = set; then : + withval=$with_pmdasnmp; do_pmdasnmp=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdasnmp=$withval" +@@ -7560,15 +7571,22 @@ $as_echo "no" >&6; }; fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the nutcracker PMDA should be included" >&5 + $as_echo_n "checking if the nutcracker PMDA should be included... " >&6; } + pmda_nutcracker=false +-if test "$have_perl" = true +-then +- if $pcp_perl_prog -e "use YAML::XS" >/dev/null 2>&1 ++if test "x$do_pmdanutcracker" = "xyes"; then : ++ pmda_nutcracker=true ++fi ++if test "x$do_pmdanutcracker" = "xcheck"; then : ++ ++ if test "$have_perl" = true + then +- if $pcp_perl_prog -e "use JSON" >/dev/null 2>&1 ++ if $pcp_perl_prog -e "use YAML::XS" >/dev/null 2>&1 + then +- pmda_nutcracker=true ++ if $pcp_perl_prog -e "use JSON" >/dev/null 2>&1 ++ then ++ pmda_nutcracker=true ++ fi + fi + fi ++ + fi + PMDA_NUTCRACKER=$pmda_nutcracker + +diff -Naurp pcp-3.11.8-orig/configure.ac pcp-3.11.8/configure.ac +--- pcp-3.11.8-orig/configure.ac 2017-02-14 07:37:52.000000000 +1100 ++++ pcp-3.11.8/configure.ac 2017-03-01 17:09:35.495740047 +1100 +@@ -148,6 +148,12 @@ AC_ARG_WITH([pmdajson], + [do_pmdajson=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdajson=$withval"], + [do_pmdajson=check]) + ++AC_ARG_WITH([pmdanutcracker], ++ [AC_HELP_STRING([--with-pmdanutcracker], ++ [enable nutcracker pmda (default is on)])], ++ [do_pmdanutcracker=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdanutcracker=$withval"], ++ [do_pmdanutcracker=check]) ++ + AC_ARG_WITH([pmdasnmp], + [AC_HELP_STRING([--with-pmdasnmp], + [enable SNMP pmda (default is on)])], +@@ -1060,17 +1066,20 @@ if $pmda_bind2; then AC_MSG_RESULT(yes); + + AC_MSG_CHECKING([if the nutcracker PMDA should be included]) + pmda_nutcracker=false +-if test "$have_perl" = true +-then +- dnl rpm build for nutcracker PMDA needs Perl JSON YAML::XS +- if $pcp_perl_prog -e "use YAML::XS" >/dev/null 2>&1 ++AS_IF([test "x$do_pmdanutcracker" = "xyes"], [pmda_nutcracker=true]) ++AS_IF([test "x$do_pmdanutcracker" = "xcheck"], [ ++ dnl build for nutcracker PMDA needs perl JSON & YAML::XS modules ++ if test "$have_perl" = true + then +- if $pcp_perl_prog -e "use JSON" >/dev/null 2>&1 ++ if $pcp_perl_prog -e "use YAML::XS" >/dev/null 2>&1 + then +- pmda_nutcracker=true ++ if $pcp_perl_prog -e "use JSON" >/dev/null 2>&1 ++ then ++ pmda_nutcracker=true ++ fi + fi + fi +-fi ++]) + AC_SUBST(PMDA_NUTCRACKER, $pmda_nutcracker) + if $pmda_nutcracker; then AC_MSG_RESULT(yes); else AC_MSG_RESULT(no); fi + +diff -Naurp pcp-3.11.8-orig/src/libpcp/src/interp.c pcp-3.11.8/src/libpcp/src/interp.c +--- pcp-3.11.8-orig/src/libpcp/src/interp.c 2017-02-15 10:57:23.000000000 +1100 ++++ pcp-3.11.8/src/libpcp/src/interp.c 2017-03-01 17:09:35.495740047 +1100 +@@ -699,7 +699,7 @@ __pmLogFetchInterp(__pmContext *ctxp, in + int i; + int j; + int k; +- int sts, sts1; ++ int sts; + double t_req; + double t_this; + pmResult *rp; +@@ -810,6 +810,8 @@ __pmLogFetchInterp(__pmContext *ctxp, in + /* enumerate all the instances from the domain underneath */ + int *instlist = NULL; + char **namelist = NULL; ++ int hsts = 0; ++ + if (pcp->desc.indom == PM_INDOM_NULL) { + sts = 1; + if ((instlist = (int *)malloc(sizeof(int))) == NULL) { +@@ -821,10 +823,10 @@ __pmLogFetchInterp(__pmContext *ctxp, in + sts = pmGetInDomArchive(pcp->desc.indom, &instlist, &namelist); + if (sts > 0) { + /* Pre allocate enough space for the instance domain. */ +- sts1 = __pmHashPreAlloc(sts, &pcp->hc); +- if (sts1 < 0) { ++ hsts = __pmHashPreAlloc(sts, &pcp->hc); ++ if (hsts < 0) { + free(pcp); +- return sts1; ++ goto done_icp; + } + } + } +@@ -839,16 +841,19 @@ __pmLogFetchInterp(__pmContext *ctxp, in + SET_UNDEFINED(icp->s_prior); + SET_UNDEFINED(icp->s_next); + icp->v_prior.pval = icp->v_next.pval = NULL; +- sts1 = __pmHashAdd((int)instlist[i], (void *)icp, &pcp->hc); +- if (sts1 < 0) { ++ hsts = __pmHashAdd((int)instlist[i], (void *)icp, &pcp->hc); ++ if (hsts < 0) { + free(icp); +- return sts1; ++ goto done_icp; + } + } ++ done_icp: + if (instlist != NULL) + free(instlist); + if (namelist != NULL) + free(namelist); ++ if (hsts < 0) ++ return hsts; /* hash allocation error */ + } + } + else +diff -Naurp pcp-3.11.8-orig/src/libpcp_web/src/http_client.c pcp-3.11.8/src/libpcp_web/src/http_client.c +--- pcp-3.11.8-orig/src/libpcp_web/src/http_client.c 2017-01-16 17:02:10.000000000 +1100 ++++ pcp-3.11.8/src/libpcp_web/src/http_client.c 2017-03-01 17:09:02.208046949 +1100 +@@ -283,7 +283,7 @@ http_client_connect(http_client *cp) + snprintf(path, sizeof(path), "/%.*s/%.*s", + up->field_data[UF_HOST].len, url + up->field_data[UF_HOST].off, + up->field_data[UF_PATH].len, url + up->field_data[UF_PATH].off); +- path[length] = '\0'; ++ path[length - 1] = '\0'; + // __pmNotifyErr(LOG_DEBUG, "host: %.*s\n", up->field_data[UF_HOST].len, url + up->field_data[UF_HOST].off); + // __pmNotifyErr(LOG_DEBUG, "UF_path: %.*s\n", up->field_data[UF_PATH].len, url + up->field_data[UF_PATH].off); + // __pmNotifyErr(LOG_DEBUG, "path: %s\n", path); +@@ -448,7 +448,7 @@ reset_url_location(const char *tourl, si + if (*suffix != '/') + *str++ = '/'; + strncat(str, suffix, length); +- url[size] = '\0'; ++ url[size - 1] = '\0'; + http_parser_parse_url(url, size, 0, fromp); + + if (pmDebug & DBG_TRACE_HTTP) +@@ -569,7 +569,7 @@ http_should_client_redirect(http_client + static int + http_client_response(http_client *cp) + { +- size_t bytes, total; ++ size_t bytes; + char buffer[BUFSIZ]; + int sts; + static int setup; +@@ -599,7 +599,6 @@ http_client_response(http_client *cp) + return sts ? sts : -EAGAIN; + } + bytes = http_parser_execute(&cp->parser, &settings, buffer, sts); +- total += bytes; + + } while (bytes && !(cp->flags & F_MESSAGE_END)); + +diff -Naurp pcp-3.11.8-orig/src/libpcp_web/src/json_helpers.c pcp-3.11.8/src/libpcp_web/src/json_helpers.c +--- pcp-3.11.8-orig/src/libpcp_web/src/json_helpers.c 2017-01-17 07:34:15.000000000 +1100 ++++ pcp-3.11.8/src/libpcp_web/src/json_helpers.c 2017-03-01 17:08:57.532090060 +1100 +@@ -354,7 +354,8 @@ json_pointer_to_index(const char *json, + pointer_final[j++] = strdup(json_pointer); + } else { + pointer_final[j++] = strdup(pointer_part); +- while (pointer_part && j < sizeof(pointer_final)) { ++ while (pointer_part && ++ j < sizeof(pointer_final)/sizeof(*pointer_final)) { + if ((pointer_part = strtok(NULL, "/")) != NULL) + pointer_final[j++] = strdup(pointer_part); + } +diff -Naurp pcp-3.11.8-orig/src/pmdas/docker/docker.c pcp-3.11.8/src/pmdas/docker/docker.c +--- pcp-3.11.8-orig/src/pmdas/docker/docker.c 2017-01-19 08:22:49.000000000 +1100 ++++ pcp-3.11.8/src/pmdas/docker/docker.c 2017-03-01 17:08:57.532090060 +1100 +@@ -69,6 +69,7 @@ static json_metric_desc version_metrics[ + { "GitCommit", 0, 1, {0}, ""}, + { "Arch", 0, 1, {0}, ""}, + { "ApiVersion", 0, 1, {0}, ""}, ++ { "BuildVersion", 0, 1, {0}, ""} + }; + #define version_metrics_size ARRAY_SIZE(version_metrics) + +diff -Naurp pcp-3.11.8-orig/src/pmdas/linux/ipc.c pcp-3.11.8/src/pmdas/linux/ipc.c +--- pcp-3.11.8-orig/src/pmdas/linux/ipc.c 2017-01-25 18:00:10.000000000 +1100 ++++ pcp-3.11.8/src/pmdas/linux/ipc.c 2017-03-01 17:09:00.694060908 +1100 +@@ -197,9 +197,6 @@ refresh_shm_stat(pmInDom shm_indom) + if (sts < 0) { + fprintf(stderr, "Warning: %s: pmdaCacheStore(%s, %s): %s\n", + __FUNCTION__, shmid, shm_stat->shm_key, pmErrStr(sts)); +- free(shm_stat->shm_key); +- free(shm_stat->shm_owner); +- free(shm_stat->shm_status); + free(shm_stat); + } + } +@@ -266,8 +263,6 @@ refresh_msg_que(pmInDom msg_indom) + if (sts < 0) { + fprintf(stderr, "Warning: %s: pmdaCacheStore(%s, %s): %s\n", + __FUNCTION__, msgid, msg_que->msg_key, pmErrStr(sts)); +- free(msg_que->msg_key); +- free(msg_que->msg_owner); + free(msg_que); + } + } +@@ -336,8 +331,6 @@ refresh_sem_array(pmInDom sem_indom) + if (sts < 0) { + fprintf(stderr, "Warning: %s: pmdaCacheStore(%s, %s): %s\n", + __FUNCTION__, semid, sem_arr->sem_key, pmErrStr(sts)); +- free(sem_arr->sem_key); +- free(sem_arr->sem_owner); + free(sem_arr); + } + } +diff -Naurp pcp-3.11.8-orig/src/pmdas/linux/proc_buddyinfo.c pcp-3.11.8/src/pmdas/linux/proc_buddyinfo.c +--- pcp-3.11.8-orig/src/pmdas/linux/proc_buddyinfo.c 2017-02-14 16:41:34.000000000 +1100 ++++ pcp-3.11.8/src/pmdas/linux/proc_buddyinfo.c 2017-03-01 17:09:03.206037748 +1100 +@@ -148,9 +148,13 @@ refresh_proc_buddyinfo(proc_buddyinfo_t + proc_buddyinfo->buddys = (buddyinfo_t *)realloc(proc_buddyinfo->buddys, proc_buddyinfo->nbuddys * sizeof(buddyinfo_t)); + for (j=0; j < MAX_ORDER; j++) { + proc_buddyinfo->buddys[i+j].id = next_id++; +- strcpy(proc_buddyinfo->buddys[i+j].node_name, node_name); +- strcpy(proc_buddyinfo->buddys[i+j].zone_name, zone_name); +- sprintf(proc_buddyinfo->buddys[i+j].id_name, "%s::order%u::%s", zone_name, j, node_name); ++ strncpy(proc_buddyinfo->buddys[i+j].node_name, node_name, ++ sizeof(proc_buddyinfo->buddys[i+j].node_name) - 1); ++ strncpy(proc_buddyinfo->buddys[i+j].zone_name, zone_name, ++ sizeof(proc_buddyinfo->buddys[i+j].zone_name) - 1); ++ snprintf(proc_buddyinfo->buddys[i+j].id_name, ++ sizeof(proc_buddyinfo->buddys[i+j].id_name), ++ "%s::order%u::%s", zone_name, j, node_name); + } + } + /* update data */ +diff -Naurp pcp-3.11.8-orig/src/pmdas/linux/sysfs_tapestats.c pcp-3.11.8/src/pmdas/linux/sysfs_tapestats.c +--- pcp-3.11.8-orig/src/pmdas/linux/sysfs_tapestats.c 2017-02-13 15:43:35.000000000 +1100 ++++ pcp-3.11.8/src/pmdas/linux/sysfs_tapestats.c 2017-03-01 17:09:03.206037748 +1100 +@@ -81,7 +81,7 @@ refresh_sysfs_tapestats(pmInDom tape_ind + return sts; + } + memset(device, 0, sizeof(tapedev_t)); +- strncpy(device->devname, sysdev, sizeof(device->devname)); ++ strncpy(device->devname, sysdev, sizeof(device->devname) - 1); + #if PCP_DEBUG + if (pmDebug & DBG_TRACE_LIBPMDA) + fprintf(stderr, "refresh_sysfs_tapestats: added new tape device \"%s\"\n", sysdev); +diff -Naurp pcp-3.11.8-orig/src/pmdas/mmv/src/mmv.c pcp-3.11.8/src/pmdas/mmv/src/mmv.c +--- pcp-3.11.8-orig/src/pmdas/mmv/src/mmv.c 2017-01-27 09:16:52.000000000 +1100 ++++ pcp-3.11.8/src/pmdas/mmv/src/mmv.c 2017-03-01 17:09:04.612024785 +1100 +@@ -774,13 +774,11 @@ mmv_lookup_item1(int item, unsigned int + mmv_disk_value_t *v = s->values; + int mi, vi, sts = PM_ERR_PMID; + +- m1 = s->metrics1; + for (mi = 0; mi < s->mcnt1; mi++) { + if (m1[mi].item != item) + continue; + + sts = PM_ERR_INST; +- v = s->values; + for (vi = 0; vi < s->vcnt; vi++) { + mmv_disk_metric_t *mt = (mmv_disk_metric_t *) + ((char *)s->addr + v[vi].metric); +diff -Naurp pcp-3.11.8-orig/src/pmdas/nutcracker/GNUmakefile pcp-3.11.8/src/pmdas/nutcracker/GNUmakefile +--- pcp-3.11.8-orig/src/pmdas/nutcracker/GNUmakefile 2017-01-25 15:58:00.000000000 +1100 ++++ pcp-3.11.8/src/pmdas/nutcracker/GNUmakefile 2017-03-01 17:09:35.495740047 +1100 +@@ -26,20 +26,23 @@ MAN_SECTION = 1 + MAN_PAGES = pmda$(IAM).$(MAN_SECTION) + MAN_DEST = $(PCP_MAN_DIR)/man$(MAN_SECTION) + +-default: check_domain ++default_pcp default: build-me $(MAN_PAGES) + + include $(BUILDRULES) + +-install: default ++ifeq "$(PMDA_NUTCRACKER)" "true" ++build-me: check_domain ++install_pcp install: default + $(INSTALL) -m 755 -d $(PMDADIR) + $(INSTALL) -m 755 Install Remove $(PMDADIR) + $(INSTALL) -m 644 pmda$(IAM).pl $(PMDADIR)/pmda$(IAM).pl + $(INSTALL) -m 644 nutcracker.conf $(PMDADIR)/nutcracker.conf + @$(INSTALL_MAN) +- +-default_pcp : default +- +-install_pcp : install ++else ++build-me: ++install_pcp install: default ++ @$(INSTALL_MAN) ++endif + + check_domain: ../../pmns/stdpmid + $(DOMAIN_PERLRULE) diff --git a/SOURCES/rhbz1432086.patch b/SOURCES/rhbz1432086.patch new file mode 100644 index 0000000..62f676d --- /dev/null +++ b/SOURCES/rhbz1432086.patch @@ -0,0 +1,444 @@ +diff -Naurp pcp-3.11.8-orig/configure pcp-3.11.8/configure +--- pcp-3.11.8-orig/configure 2017-02-14 07:37:52.000000000 +1100 ++++ pcp-3.11.8/configure 2017-04-21 10:51:36.986013923 +1000 +@@ -703,6 +703,7 @@ fmt_pid + rdynamic_flag + pcp_selinux_dir + enable_selinux ++SEINFO + enable_manager + enable_webapi + HAVE_CAIRO +@@ -11084,16 +11085,63 @@ rm -f core conftest.err conftest.$ac_obj + fi + + ++for ac_prog in seinfo ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_SEINFO+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$SEINFO"; then ++ ac_cv_prog_SEINFO="$SEINFO" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_SEINFO="$ac_prog" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++SEINFO=$ac_cv_prog_SEINFO ++if test -n "$SEINFO"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SEINFO" >&5 ++$as_echo "$SEINFO" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$SEINFO" && break ++done ++ ++ + enable_selinux=false + if test "x$do_selinux" != "xno"; then : + +- if test -f /usr/share/selinux/devel/Makefile ++for makefile in /usr/share/selinux/devel/Makefile ++do ++# if test -f /usr/share/selinux/devel/Makefile -a "x$SEINFO" != "x" ++ if test -f "$makefile" -a "x$SEINFO" != "x" + then + enable_selinux=true + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + $as_echo "no" >&6; } + fi ++done + + fi + +diff -Naurp pcp-3.11.8-orig/configure.ac pcp-3.11.8/configure.ac +--- pcp-3.11.8-orig/configure.ac 2017-02-14 07:37:52.000000000 +1100 ++++ pcp-3.11.8/configure.ac 2017-04-21 10:51:36.986013923 +1000 +@@ -1849,14 +1849,19 @@ AS_IF([test "x$do_manager" != "xno"], [ + ]) + AC_SUBST(enable_manager) + ++AC_CHECK_PROGS(SEINFO, seinfo) ++AC_SUBST(SEINFO) + enable_selinux=false + AS_IF([test "x$do_selinux" != "xno"], [ +- if test -f /usr/share/selinux/devel/Makefile ++for makefile in /usr/share/selinux/devel/Makefile ++do ++ if test -f "$makefile" -a "x$SEINFO" != "x" + then + enable_selinux=true + else + AC_MSG_RESULT(no) + fi ++done + ]) + AC_SUBST(enable_selinux) + AC_SUBST(pcp_selinux_dir) +diff -Naurp pcp-3.11.8-orig/qa/917 pcp-3.11.8/qa/917 +--- pcp-3.11.8-orig/qa/917 2017-02-16 08:57:57.000000000 +1100 ++++ pcp-3.11.8/qa/917 2017-04-21 11:00:54.404877472 +1000 +@@ -17,10 +17,15 @@ policy_name="pcpupstream" + policy_file="$PCP_VAR_DIR/selinux/$policy_name.pp" + which sedismod >/dev/null 2>&1 || _notrun "sedismod tool not installed (module disassembly)" + which semodule >/dev/null 2>&1 || _notrun "semodule tool not installed" ++which seinfo >/dev/null 2>&1 || _notrun "seinfo tool not installed" + [ -f "$policy_file" ] || _notrun "upstream policy package not installed" + + container_runtime_t=`seinfo -t | grep "container_runtime_t$"` + nsfs_t=`seinfo -t | grep 'nsfs_t$'` ++docker_var_lib_t=`seinfo -t | grep "docker_var_lib_t$"` ++svirt_lxc_net_t=`seinfo -t | grep "svirt_lxc_net_t$"` ++systemd_systemctl_exec_t=`seinfo -t | grep "systemd_systemctl_exec_t$"` ++systemd_systemctl_unit_file_t=`seinfo -t | grep "systemd_systemctl_unit_file_t$"` + + _filter_semodule() + { +@@ -39,11 +44,24 @@ _filter_outfile() + { + awk -v container_t="$container_runtime_t" \ + -v nsfs_t="$nsfs_t" \ ++ -v docker_var_lib_t="$docker_var_lib_t" \ ++ -v svirt_lxc_net_t="$svirt_lxc_net_t" \ ++ -v class_status="$class_status" \ ++ -v systemd_systemctl_exec_t="$systemd_systemctl_exec_t" \ ++ -v systemd_systemctl_unit_file_t="$systemd_systemctl_unit_file_t" \ + '{ + if (container_t == "" && /container_runtime_t/) + !/container_runtime_t/ ; + else if (nsfs_t == "" && /nsfs_t/) + !/nsfs_t/ ; ++ if (docker_var_lib_t == "" && /docker_var_lib_t/) ++ !/docker_var_lib_t/ ; ++ else if (svirt_lxc_net_t == "" && /svirt_lxc_net_t/) ++ !/svirt_lxc_net_t/ ; ++ else if (systemd_systemctl_exec_t == "" && /systemd_systemctl_exec_t/) ++ !/systemd_systemctl_exec_t/ ; ++ else if (systemd_systemctl_unit_file_t == "" && /systemd_systemctl_unit_file_t/) ++ !/systemd_systemctl_unit_file_t/ ; + else + print; + }' > $seq.out +diff -Naurp pcp-3.11.8-orig/qa/917.out.in pcp-3.11.8/qa/917.out.in +--- pcp-3.11.8-orig/qa/917.out.in 2017-02-16 08:57:57.000000000 +1100 ++++ pcp-3.11.8/qa/917.out.in 2017-04-21 11:01:41.981353982 +1000 +@@ -11,8 +11,6 @@ decl 1: + allow [init_t] [pcp_var_lib_t] : [file] { append create execute execute_no_trans getattr ioctl open read write }; + allow [init_t] [pcp_var_lib_t] : [lnk_file] { read }; + allow [init_t] [tmp_t] : [file] { open }; +- allow [pcp_pmcd_t] [docker_var_lib_t] : [dir] { search }; +- allow [pcp_pmcd_t] [container_runtime_t] : [unix_stream_socket] { connectto }; + allow [pcp_pmcd_t] [svirt_sandbox_file_t] : [dir] { open read search }; + allow [pcp_pmcd_t] [svirt_lxc_net_t] : [dir] { open read search }; + allow [pcp_pmcd_t] [sysctl_net_t] : [dir] { search }; +@@ -21,7 +19,10 @@ decl 1: + allow [pcp_pmcd_t] [debugfs_t] : [dir] { read }; + allow [pcp_pmcd_t] [debugfs_t] : [file] { getattr ioctl open read }; + allow [pcp_pmcd_t] [pcp_pmie_exec_t] : [file] { execute execute_no_trans open read }; +- allow [pcp_pmcd_t] self : [capability] { net_admin }; ++ allow [pcp_pmcd_t] self : [capability] { sys_ptrace net_admin }; ++ allow [pcp_pmcd_t] [initctl_t] : [fifo_file] { getattr }; ++ allow [pcp_pmcd_t] [proc_kcore_t] : [file] { getattr }; ++ allow [pcp_pmcd_t] self : [cap_userns] { sys_ptrace }; + allow [pcp_pmcd_t] self : [capability] { sys_chroot }; + allow [pcp_pmcd_t] [nsfs_t] : [file] { open read }; + allow [pcp_pmcd_t] [pcp_log_t] : [fifo_file] { getattr read open }; +@@ -29,9 +30,14 @@ decl 1: + allow [pcp_pmlogger_t] self : [capability] { kill }; + allow [pcp_pmlogger_t] [init_t] : [system] { status }; + allow [pcp_pmlogger_t] self : [capability] { sys_ptrace }; ++ allow [pcp_pmlogger_t] [unconfined_t] : [process] { signal }; + allow [pcp_pmie_t] [hostname_exec_t] : [file] { execute execute_no_trans getattr open read }; + allow [pcp_pmie_t] self : [capability] { kill net_admin chown }; ++ allow [pcp_pmie_t] [init_t] : [unix_stream_socket] { connectto }; ++ allow [pcp_pmie_t] [initrc_var_run_t] : [file] { lock open read }; + allow [pcp_pmie_t] [init_t] : [system] { status }; ++ allow [pcp_pmie_t] [systemd_unit_file_t] : [file] { getattr }; ++ allow [pcp_pmie_t] [systemd_systemctl_exec_t] : [file] { execute execute_no_trans open read }; + allow [pcp_pmcd_t] [configfs_t] : [dir] { open read search }; + allow [pcp_pmcd_t] [configfs_t] : [file] { getattr open read }; + allow [pcp_pmcd_t] [configfs_t] : [lnk_file] { read getattr }; +@@ -41,4 +47,6 @@ decl 1: + allow [pcp_pmcd_t] [modules_object_t] : [dir] { search }; + allow [pcp_pmcd_t] [modules_object_t] : [file] { getattr open read }; + allow [pcp_pmcd_t] [saslauthd_t] : [unix_stream_socket] { connectto }; ++ allow [pcp_pmproxy_t] self : [capability] { net_admin }; ++ allow [pcp_pmproxy_t] [sysctl_net_t] : [file] { getattr open read }; + +diff -Naurp pcp-3.11.8-orig/src/selinux/GNUlocaldefs pcp-3.11.8/src/selinux/GNUlocaldefs +--- pcp-3.11.8-orig/src/selinux/GNUlocaldefs 2017-02-15 10:47:24.000000000 +1100 ++++ pcp-3.11.8/src/selinux/GNUlocaldefs 2017-04-21 11:00:54.404877472 +1000 +@@ -1,9 +1,41 @@ + ifneq "$(shell seinfo -t | grep 'container_runtime_t$$' | sed -e 's/^[ \t]*//')" "" + PCP_CONTAINER_RUNTIME_T="type container_runtime_t\;" + PCP_CONTAINER_RUNTIME_RULE="allow pcp_pmcd_t container_runtime_t:unix_stream_socket connectto\;" ++else ++PCP_CONTAINER_RUNTIME_RULE="" ++PCP_CONTAINER_RUNTIME_T="" + endif + + ifneq "$(shell seinfo -t | grep 'nsfs_t$$' | sed -e 's/^[ \t]*//')" "" + PCP_NSFS_T="type nsfs_t\; \# filesys.used" + PCP_NSFS_RULE="allow pcp_pmcd_t nsfs_t:file { read open }\;" + endif ++ ++ifneq "$(shell seinfo -t | grep 'docker_var_lib_t$$' | sed -e 's/^[ \t]*//')" "" ++PCP_DOCKER_VAR_LIB_T="type docker_var_lib_t\;" ++PCP_DOCKER_VAR_LIB_RULE="allow pcp_pmcd_t docker_var_lib_t:dir search\;" ++else ++PCP_DOCKER_VAR_LIB_T="" ++PCP_DOCKER_VAR_LIB_RULE="" ++endif ++ ++ifneq "$(shell seinfo -t | grep 'svirt_lxc_net_t$$' | sed -e 's/^[ \t]*//')" "" ++PCP_SVIRT_LXC_NET_T="type svirt_lxc_net_t\;" ++PCP_SVIRT_LXC_NET_RULE="allow pcp_pmcd_t svirt_lxc_net_t:dir { open read search }\;" ++endif ++ ++ifneq "$(shell seinfo -x --class=system | grep 'status')" "" ++PCP_CLASS_STATUS="class system status\;" ++PCP_PMLOGGER_SYSTEM_STATUS_RULE="allow pcp_pmlogger_t init_t:system status\;" ++PCP_PMIE_SYSTEM_STATUS_RULE="allow pcp_pmie_t init_t:system status\;" ++endif ++ ++ifneq "$(shell seinfo -t | grep 'systemd_unit_file_t$$' | sed -e 's/^[ \t]*//')" "" ++PCP_SYSTEMCTL_UNIT_FILE_T="type systemd_unit_file_t\;" ++PCP_SYSTEMCTL_UNIT_FILE_RULE="allow pcp_pmie_t systemd_unit_file_t:file getattr\;" ++endif ++ ++ifneq "$(shell seinfo -t | grep 'systemd_systemctl_exec_t$$' | sed -e 's/^[ \t]*//')" "" ++PCP_SYSTEMCTL_EXEC_T="type systemd_systemctl_exec_t\;" ++PCP_SYSTEMCTL_EXEC_RULE="allow pcp_pmie_t systemd_systemctl_exec_t:file { execute execute_no_trans open read }\;" ++endif +\ No newline at end of file +diff -Naurp pcp-3.11.8-orig/src/selinux/GNUmakefile pcp-3.11.8/src/selinux/GNUmakefile +--- pcp-3.11.8-orig/src/selinux/GNUmakefile 2017-02-15 10:47:24.000000000 +1100 ++++ pcp-3.11.8/src/selinux/GNUmakefile 2017-04-21 11:00:54.404877472 +1000 +@@ -14,10 +14,15 @@ + + TOPDIR = ../.. + include $(TOPDIR)/src/include/builddefs ++ifeq "$(ENABLE_SELINUX)" "true" + -include ./GNUlocaldefs ++endif + IAM = pcpupstream + +-LDIRT = $(IAM).cil $(IAM).pp $(IAM).mod $(IAM).te tmp ++LDIRT = $(IAM).cil $(IAM).pp $(IAM).mod $(IAM).te tmp \ ++ $(IAM)-docker.cil $(IAM)-docker.pp $(IAM)-docker.mod \ ++ $(IAM)-container.cil $(IAM)-container.pp $(IAM)-container.mod ++ + + default: build-me + +@@ -32,6 +37,17 @@ $(IAM).te: $(IAM).te.in + -e 's;@PCP_CONTAINER_RUNTIME_RULE@;'$(PCP_CONTAINER_RUNTIME_RULE)';' \ + -e 's;@PCP_NSFS_T@;'$(PCP_NSFS_T)';' \ + -e 's;@PCP_NSFS_RULE@;'$(PCP_NSFS_RULE)';' \ ++ -e 's;@PCP_DOCKER_VAR_LIB_T@;'$(PCP_DOCKER_VAR_LIB_T)';' \ ++ -e 's;@PCP_DOCKER_VAR_LIB_RULE@;'$(PCP_DOCKER_VAR_LIB_RULE)';' \ ++ -e 's;@PCP_CLASS_STATUS@;'$(PCP_CLASS_STATUS)';' \ ++ -e 's;@PCP_PMLOGGER_SYSTEM_STATUS_RULE@;'$(PCP_PMLOGGER_SYSTEM_STATUS_RULE)';' \ ++ -e 's;@PCP_PMIE_SYSTEM_STATUS_RULE@;'$(PCP_PMIE_SYSTEM_STATUS_RULE)';' \ ++ -e 's;@PCP_SVIRT_LXC_NET_T@;'$(PCP_SVIRT_LXC_NET_T)';' \ ++ -e 's;@PCP_SVIRT_LXC_NET_RULE@;'$(PCP_SVIRT_LXC_NET_RULE)';' \ ++ -e 's;@PCP_SYSTEMCTL_UNIT_FILE_T@;'$(PCP_SYSTEMCTL_UNIT_FILE_T)';' \ ++ -e 's;@PCP_SYSTEMCTL_UNIT_FILE_RULE@;'$(PCP_SYSTEMCTL_UNIT_FILE_RULE)';' \ ++ -e 's;@PCP_SYSTEMCTL_EXEC_T@;'$(PCP_SYSTEMCTL_EXEC_T)';' \ ++ -e 's;@PCP_SYSTEMCTL_EXEC_RULE@;'$(PCP_SYSTEMCTL_EXEC_RULE)';' \ + + # END + make -f /usr/share/selinux/devel/Makefile +@@ -40,6 +56,15 @@ install: default + $(INSTALL) -m 755 -d $(PCP_SELINUX_DIR) + $(INSTALL) -m 664 $(IAM).pp $(PCP_SELINUX_DIR)/$(IAM).pp + $(INSTALL) -m 664 $(IAM).te $(PCP_SELINUX_DIR)/$(IAM).te ++ifneq "$(PCP_DOCKER_VAR_LIB)" "" ++ $(INSTALL) -m 664 $(IAM)-docker.pp $(PCP_SELINUX_DIR)/$(IAM)-docker.pp ++ $(INSTALL) -m 664 $(IAM)-docker.te $(PCP_SELINUX_DIR)/$(IAM)-docker.te ++endif ++ifneq "$(PCP_CONTAINER_RUNTIME_T)" "" ++ $(INSTALL) -m 664 $(IAM)-container.pp $(PCP_SELINUX_DIR)/$(IAM)-container.pp ++ $(INSTALL) -m 664 $(IAM)-container.te $(PCP_SELINUX_DIR)/$(IAM)-container.te ++endif ++ + else + build-me: + install: +diff -Naurp pcp-3.11.8-orig/src/selinux/pcpupstream-container.te pcp-3.11.8/src/selinux/pcpupstream-container.te +--- pcp-3.11.8-orig/src/selinux/pcpupstream-container.te 1970-01-01 10:00:00.000000000 +1000 ++++ pcp-3.11.8/src/selinux/pcpupstream-container.te 2017-04-21 11:00:19.549260992 +1000 +@@ -0,0 +1,9 @@ ++module pcpupstream-container 1.0; ++ ++require { ++ type container_runtime_t; ++ type pcp_pmcd_t; ++ class unix_stream_socket connectto; ++} ++ ++allow pcp_pmcd_t container_runtime_t:unix_stream_socket connectto; +diff -Naurp pcp-3.11.8-orig/src/selinux/pcpupstream-docker.te pcp-3.11.8/src/selinux/pcpupstream-docker.te +--- pcp-3.11.8-orig/src/selinux/pcpupstream-docker.te 1970-01-01 10:00:00.000000000 +1000 ++++ pcp-3.11.8/src/selinux/pcpupstream-docker.te 2017-04-21 11:00:19.555260927 +1000 +@@ -0,0 +1,9 @@ ++module pcpupstream-docker 1.0; ++ ++require { ++ type docker_var_lib_t; ++ type pcp_pmcd_t; ++ class dir { search }; ++} ++ ++allow pcp_pmcd_t docker_var_lib_t:dir search; +diff -Naurp pcp-3.11.8-orig/src/selinux/pcpupstream.te.in pcp-3.11.8/src/selinux/pcpupstream.te.in +--- pcp-3.11.8-orig/src/selinux/pcpupstream.te.in 2017-02-15 10:47:24.000000000 +1100 ++++ pcp-3.11.8/src/selinux/pcpupstream.te.in 2017-04-21 11:01:41.981353982 +1000 +@@ -1,20 +1,20 @@ + module pcpupstream 1.0; + + require { +- @PCP_CONTAINER_RUNTIME_T@ + type pcp_pmcd_t; + type user_home_t; + type tmp_t; + type init_t; ++ type initrc_var_run_t; + type kmsg_device_t; + type pcp_pmlogger_t; + type pcp_var_lib_t; + type pcp_log_t; + type pcp_pmie_t; ++ type pcp_pmproxy_t; + type sysctl_net_t; + type svirt_sandbox_file_t; +- type svirt_lxc_net_t; +- type docker_var_lib_t; ++ @PCP_SVIRT_LXC_NET_T@ + type hostname_exec_t; + type ldconfig_exec_t; # pcp-lio + type configfs_t; # pcp-lio +@@ -23,15 +23,19 @@ require { + type modules_object_t; # pcp-lio + @PCP_NSFS_T@ + type pcp_pmie_exec_t; # pmdasummary ++ @PCP_SYSTEMCTL_UNIT_FILE_T@ ++ @PCP_SYSTEMCTL_EXEC_T@ + type debugfs_t; # pmdalibvirt ++ type unconfined_t; #RHBZ1443632 + class lnk_file { read getattr }; +- class file { append create execute execute_no_trans getattr ioctl open read write }; ++ class file { append create execute execute_no_trans getattr ioctl lock open read write }; + class dir { add_name open read search write getattr }; + class unix_stream_socket connectto; + class capability { kill sys_ptrace net_admin chown sys_chroot }; + class chr_file { open write }; + class fifo_file { getattr read open }; # qa/455 +- class system status; ++ class process signal; #RHBZ1443632 ++ @PCP_CLASS_STATUS@ + } + + #============= init_t ============== +@@ -57,13 +61,8 @@ allow init_t tmp_t:file open; + + #============= pcp_pmcd_t ============== + +-#!!!! The file '/run/docker.sock' is mislabeled on your system. +-#!!!! Fix with $ restorecon -R -v /run/docker.sock +-#!!!! This avc can be allowed using the boolean 'daemons_enable_cluster_mode' +-allow pcp_pmcd_t docker_var_lib_t:dir search; +-@PCP_CONTAINER_RUNTIME_RULE@ + allow pcp_pmcd_t svirt_sandbox_file_t:dir { open read search }; +-allow pcp_pmcd_t svirt_lxc_net_t:dir { open read search }; ++@PCP_SVIRT_LXC_NET_RULE@ + allow pcp_pmcd_t sysctl_net_t:dir search; + allow pcp_pmcd_t sysctl_net_t:file { getattr open read }; + allow pcp_pmcd_t user_home_t:file { execute execute_no_trans open read }; +@@ -73,7 +72,8 @@ allow pcp_pmcd_t pcp_pmie_exec_t:file { + + + #type=AVC msg=audit(1463754714.313:316): avc: denied { net_admin } for pid=2335 comm="pmcd" capability=12 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:pcp_pmcd_t:s0 tclass=capability permissive=1 +-allow pcp_pmcd_t self:capability net_admin; ++#type=AVC msg=audit(1491576442.619:1738169): avc: denied { sys_ptrace } for pid=15205 comm="pmdaproc" capability=19 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:pcp_pmcd_t:s0 tclass=capability permissive=0 ++allow pcp_pmcd_t self:capability { net_admin sys_ptrace }; + + #type=AVC msg=audit(1485899863.032:3024): avc: denied { sys_chroot } for pid=25873 comm="pmdalinux" capability=18 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:pcp_pmcd_t:s0 tclass=capability + allow pcp_pmcd_t self:capability sys_chroot; +@@ -86,16 +86,38 @@ allow pcp_pmcd_t pcp_log_t:fifo_file { g + #============= pcp_pmlogger_t ============== + allow pcp_pmlogger_t kmsg_device_t:chr_file { open write }; + allow pcp_pmlogger_t self:capability kill; +-allow pcp_pmlogger_t init_t:system status; ++@PCP_PMLOGGER_SYSTEM_STATUS_RULE@ + + # type=AVC msg=audit(1484681301.380:174695): avc: denied { sys_ptrace } for pid=21962 comm="ps" capability=19 scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=system_u:system_r:pcp_pmlogger_t:s0 tclass=capability + # src/pmlogger/pmnewlog.sh + allow pcp_pmlogger_t self:capability sys_ptrace; + ++## type=AVC msg=audit(04/19/2017 16:57:40.120:11020) : avc: denied { signal } for pid=28414 comm=pmsignal scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=process ++ ++allow pcp_pmlogger_t unconfined_t:process signal; ++ + #============= pcp_pmie_t ============== + allow pcp_pmie_t hostname_exec_t:file { execute execute_no_trans getattr open read }; + allow pcp_pmie_t self:capability { chown kill net_admin }; +-allow pcp_pmie_t init_t:system status; ++ ++#type=AVC msg=audit(04/05/2017 10:24:45.084:351) : avc: denied { connectto } for pid=8941 comm=systemctl path=/run/systemd/private scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=unix_stream_socket ++allow pcp_pmie_t init_t:unix_stream_socket connectto; ++ ++#type=AVC msg=audit(04/05/2017 10:24:45.081:348) : avc: denied { open } for pid=8939 comm=runlevel path=/run/utmp dev="tmpfs" ino=12392 scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:initrc_var_run_t:s0 tclass=file ++#type=AVC msg=audit(04/05/2017 10:24:45.081:348) : avc: denied { read } for pid=8939 comm=runlevel name=utmp dev="tmpfs" ino=12392 scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:initrc_var_run_t:s0 tclass=file ++#type=AVC msg=audit(04/05/2017 10:24:45.081:349) : avc: denied { lock } for pid=8939 comm=runlevel path=/run/utmp dev="tmpfs" ino=12392 scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:initrc_var_run_t:s0 tclass=file ++allow pcp_pmie_t initrc_var_run_t:file { lock open read }; ++ ++@PCP_PMIE_SYSTEM_STATUS_RULE@ ++ ++#type=AVC msg=audit(04/05/2017 10:24:45.082:350) : avc: denied { getattr } for pid=8870 comm=pmie path=/usr/lib/systemd/system/pmie.service dev="dm-1" ino=4203 scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:systemd_unit_file_t:s0 tclass=file ++@PCP_SYSTEMCTL_UNIT_FILE_RULE@ ++#type=AVC msg=audit(04/05/2017 09:58:27.740:304) : avc: denied { read } for pid=7073 comm=pmie name=systemctl dev="dm-1" ino=3402 scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:systemd_systemctl_exec_t:s0 tclass=file ++#type=AVC msg=audit(04/05/2017 09:58:27.740:303) : avc: denied { execute } for pid=7073 comm=pmie name=systemctl dev="dm-1" ino=3402 scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:systemd_systemctl_exec_t:s0 tclass=file ++#type=AVC msg=audit(04/05/2017 09:58:27.742:305) : avc: denied { getattr } for pid=7004 comm=pmie path=/usr/lib/systemd/system/pmie.service dev="dm-1" ino=4203 scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:systemd_unit_file_t:s0 tclass=file ++#type=AVC msg=audit(04/05/2017 10:24:45.080:347) : avc: denied { execute_no_trans } for pid=8939 comm=pmie path=/usr/bin/systemctl dev="dm-1" ino=3402 scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:systemd_systemctl_exec_t:s0 tclass=file ++#type=AVC msg=audit(04/05/2017 10:24:45.080:347) : avc: denied { open } for pid=8939 comm=pmie path=/usr/bin/systemctl dev="dm-1" ino=3402 scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:systemd_systemctl_exec_t:s0 tclass=file ++@PCP_SYSTEMCTL_EXEC_RULE@ + + #============= pmda-lio ============== + allow pcp_pmcd_t configfs_t:dir { open read search }; +@@ -111,3 +133,12 @@ allow pcp_pmcd_t modules_object_t:dir se + allow pcp_pmcd_t modules_object_t:file { getattr open read }; + + allow pcp_pmcd_t saslauthd_t:unix_stream_socket connectto; ++ ++#============= pcp_pmproxy_t ============== ++#type=AVC msg=audit(04/05/2017 09:54:13.548:281) : avc: denied { net_admin } for pid=6669 comm=pmproxy capability=net_admin scontext=system_u:system_r:pcp_pmproxy_t:s0 tcontext=system_u:system_r:pcp_pmproxy_t:s0 tclass=capability ++allow pcp_pmproxy_t self:capability net_admin; ++ ++#type=AVC msg=audit(04/05/2017 09:54:13.548:281) : avc: denied { read } for pid=6669 comm=pmproxy name=disable_ipv6 dev="proc" ino=9994 scontext=system_u:system_r:pcp_pmproxy_t:s0 tcontext=system_u:object_r:sysctl_net_t:s0 tclass=file ++#type=AVC msg=audit(04/05/2017 10:24:45.771:356) : avc: denied { open } for pid=9669 comm=pmproxy path=/proc/sys/net/ipv6/conf/all/disable_ipv6 dev="proc" ino=9994 scontext=system_u:system_r:pcp_pmproxy_t:s0 tcontext=system_u:object_r:sysctl_net_t:s0 tclass=file ++#type=AVC msg=audit(04/05/2017 10:24:45.771:357) : avc: denied { getattr } for pid=9669 comm=pmproxy path=/proc/sys/net/ipv6/conf/all/disable_ipv6 dev="proc" ino=9994 scontext=system_u:system_r:pcp_pmproxy_t:s0 tcontext=system_u:object_r:sysctl_net_t:s0 tclass=file ++allow pcp_pmproxy_t sysctl_net_t:file { getattr open read }; diff --git a/SPECS/pcp.spec b/SPECS/pcp.spec index 713b74d..4957f9a 100644 --- a/SPECS/pcp.spec +++ b/SPECS/pcp.spec @@ -1,7 +1,7 @@ Summary: System-level performance monitoring and performance management Name: pcp -Version: 3.11.3 -%global buildversion 4 +Version: 3.11.8 +%global buildversion 7 Release: %{buildversion}%{?dist} License: GPLv2+ and LGPLv2.1+ and CC-BY @@ -12,16 +12,22 @@ Source0: %{name}-%{version}.src.tar.gz # https://bintray.com/artifact/download/netflixoss/downloads/vector.tar.gz Source1: vector-1.1.0.tar.gz # https://github.com/performancecopilot/pcp-webjs/archive/3.11.2.tar.gz -Source2: pcp-webjs-3.11.2.tar.gz - -# selinux improvements in pmdaproc ttyname access -Patch0: rhbz1336211.patch -# filesys metrics with persistent device mapper names -Patch1: rhbz1349932.patch -# remove multi-archive log label timezone assertions -Patch2: rhbz1351223.patch -# Update pcp-pmda-ds389log defaults to use dirsrv user instead of nobody -Patch3: rhbz1357607.patch +Source2: pcp-webjs-3.11.8.src.tar.gz + +# Resolve missing dependency on upstream pcp-pmda-nutcracker (disabled) +Patch0: rhbz1425880.patch +# Series of SELinux policy and build improvements +Patch1: rhbz1432086.patch +# Updates to the perfevent PMDA +Patch2: rhbz1419490.patch +# Add pcp-zeroconf sub-package +Patch3: rhbz1211432.patch + +%if 0%{?fedora} || 0%{?rhel} +%global disable_selinux 0 +%else +%global disable_selinux 1 +%endif %global disable_snmp 0 @@ -72,6 +78,13 @@ Patch3: rhbz1357607.patch %global disable_json 1 %endif +# support for pmdanutcracker (perl deps missing on rhel) +%if 0%{?rhel} == 0 +%global disable_nutcracker 0 +%else +%global disable_nutcracker 1 +%endif + # support for pmdarpm %if 0%{?rhel} == 0 || 0%{?rhel} > 5 %global disable_rpm 0 @@ -111,6 +124,13 @@ Patch3: rhbz1357607.patch %global disable_noarch 1 %endif +# pcp-pmda-libvirt for aarch64 +%ifarch aarch64 +%global collector_with_pmda_libvirt 0 +%else +%global collector_with_pmda_libvirt 1 +%endif + # prevent conflicting binary and man page install for pcp(1) Conflicts: librapi @@ -161,13 +181,9 @@ BuildRequires: qt4-devel >= 4.4 %endif Requires: bash gawk sed grep fileutils findutils initscripts which -Requires: python%{?default_python} Requires: pcp-libs = %{version}-%{release} -%if 0%{?default_python} == 3 -Requires: python3-pcp = %{version}-%{release} -%endif -%if !%{disable_python2} && 0%{?default_python} != 3 -Requires: python-pcp = %{version}-%{release} +%if !%{disable_selinux} +Requires: pcp-selinux = %{version}-%{release} %endif Obsoletes: pcp-gui-debuginfo Obsoletes: pcp-pmda-nvidia @@ -186,6 +202,8 @@ Obsoletes: pcp-gui-debuginfo %global _tempsdir %{_localstatedir}/lib/pcp/tmp %global _pmdasdir %{_localstatedir}/lib/pcp/pmdas %global _testsdir %{_localstatedir}/lib/pcp/testsuite +%global _selinuxdir %{_localstatedir}/lib/pcp/selinux +%global _logconfdir %{_localstatedir}/lib/pcp/config/pmlogconf %global _pixmapdir %{_datadir}/pcp-gui/pixmaps %global _booksdir %{_datadir}/doc/pcp-doc @@ -230,6 +248,12 @@ Obsoletes: pcp-gui-debuginfo %global _with_json --with-pmdajson=yes %endif +%if %{disable_nutcracker} +%global _with_nutcracker --with-pmdanutcracker=no +%else +%global _with_nutcracker --with-pmdanutcracker=yes +%endif + %if %{disable_snmp} %global _with_snmp --with-pmdasnmp=no %else @@ -246,6 +270,31 @@ then fi } +%global selinux_handle_policy() %{expand: +if [ "%1" -eq 1 ] +then + PCP_SELINUX_DIR=%{_selinuxdir} + if [ -f "$PCP_SELINUX_DIR/%2" ] + then + %if 0%{?fedora} >= 24 || 0%{?rhel} > 6 + (semodule -X 400 -i %{_selinuxdir}/%2) + %else + (semodule -i %{_selinuxdir}/%2) + %endif #distro version check + fi +elif [ "%1" -eq 0 ] +then + if semodule -l | grep %2 >/dev/null 2>&1 + then + %if 0%{?fedora} >= 24 || 0%{?rhel} > 6 + (semodule -X 400 -r %2 >/dev/null) + %else + (semodule -r %2 >/dev/null) + %endif #distro version check + fi +fi +} + %description Performance Co-Pilot (PCP) provides a framework and services to support system-level performance monitoring and performance management. @@ -258,7 +307,7 @@ applications to easily retrieve and process any subset of that data. # pcp-conf # %package conf -License: LGPLv2+ +License: LGPLv2.1+ Group: System Environment/Libraries Summary: Performance Co-Pilot run-time configuration URL: http://www.pcp.io @@ -273,7 +322,7 @@ Performance Co-Pilot (PCP) run-time configuration # pcp-libs # %package libs -License: LGPLv2+ +License: LGPLv2.1+ Group: System Environment/Libraries Summary: Performance Co-Pilot run-time libraries URL: http://www.pcp.io @@ -294,7 +343,7 @@ URL: http://www.pcp.io #Requires: pcp-libs = %{version}-%{release} %description libs-devel -Performance Co-Pilot (PCP) headers, for development +Performance Co-Pilot (PCP) headers for development. # # pcp-devel @@ -561,6 +610,20 @@ Performance Co-Pilot (PCP) front-end tools for importing ganglia data into standard PCP archive logs for replay with any PCP monitoring tool. # +# pcp-import-collectl2pcp +# +%package import-collectl2pcp +License: LGPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot tools for importing collectl log files into PCP archive logs +URL: http://www.pcp.io +Requires: pcp-libs = %{version}-%{release} + +%description import-collectl2pcp +Performance Co-Pilot (PCP) front-end tools for importing collectl data +into standard PCP archive logs for replay with any PCP monitoring tool. + +# # pcp-export-zabbix-agent # %package export-zabbix-agent @@ -593,21 +656,27 @@ Requires: python-pcp = %{version}-%{release} %description export-pcp2graphite Performance Co-Pilot (PCP) front-end tools for exporting metric values to graphite (http://graphite.readthedocs.org). -%endif +# pcp-export-pcp2influxdb # -# pcp-import-collectl2pcp -# -%package import-collectl2pcp -License: LGPLv2+ +%package export-pcp2influxdb +License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot tools for importing collectl log files into PCP archive logs +Summary: Performance Co-Pilot tools for exporting PCP metrics to InfluxDB URL: http://www.pcp.io -Requires: pcp-libs = %{version}-%{release} +Requires: pcp-libs >= %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp = %{version}-%{release} +Requires: python3-requests +%else +Requires: python-pcp = %{version}-%{release} +Requires: python-requests +%endif -%description import-collectl2pcp -Performance Co-Pilot (PCP) front-end tools for importing collectl data -into standard PCP archive logs for replay with any PCP monitoring tool. +%description export-pcp2influxdb +Performance Co-Pilot (PCP) front-end tools for exporting metric values +to InfluxDB (https://influxdata.com/time-series-platform/influxdb). +%endif %if !%{disable_papi} # @@ -662,6 +731,7 @@ This package contains the PCP Performance Metrics Domain Agent (PMDA) for collecting Infiniband statistics. By default, it monitors the local HCAs but can also be configured to monitor remote GUIDs such as IB switches. %endif + # # pcp-pmda-activemq # @@ -679,6 +749,58 @@ collecting metrics about the ActiveMQ message broker. #end pcp-pmda-activemq # +# pcp-pmda-bind2 +# +%package pmda-bind2 +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) metrics for BIND servers +URL: http://www.pcp.io +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl(LWP::UserAgent) +Requires: perl(XML::LibXML) +Requires: perl(File::Slurp) + +%description pmda-bind2 +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from BIND (Berkeley Internet Name Domain). +#end pcp-pmda-bind2 + +# +# pcp-pmda-redis +# +%package pmda-redis +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) metrics for Redis +URL: http://www.pcp.io +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-redis +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from Redis servers (redis.io). +#end pcp-pmda-redis + +%if !%{disable_nutcracker} +# +# pcp-pmda-nutcracker +# +%package pmda-nutcracker +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) metrics for NutCracker (TwemCache) +URL: http://www.pcp.io +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl(YAML::XS::LibYAML) +Requires: perl(JSON) + +%description pmda-nutcracker +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from NutCracker (TwemCache). +#end pcp-pmda-nutcracker +%endif + +# # pcp-pmda-bonding # %package pmda-bonding @@ -803,6 +925,20 @@ collecting metrics about the Kernel based Virtual Machine. #end pcp-pmda-kvm # +# pcp-pmda-docker +# +%package pmda-docker +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) metrics from the Docker daemon +URL: http://www.pcp.io + +%description pmda-docker +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics using the Docker daemon REST API. +#end pcp-pmda-docker + +# # pcp-pmda-lustre # %package pmda-lustre @@ -1201,6 +1337,54 @@ This package contains the PCP Performance Metrics Domain Agent (PMDA) for collecting metrics about Intel MIC cards. # end pcp-pmda-mic +# +# pcp-pmda-libvirt +# +%package pmda-libvirt +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) metrics for virtual machines +URL: http://www.pcp.io +%if !%{disable_python3} +Requires: python3-pcp +Requires: libvirt-python3 python3-lxml +BuildRequires: libvirt-python3 +%else +Requires: python-pcp +Requires: libvirt-python python-lxml +%if 0%{?rhel} == 0 || 0%{?rhel} > 5 +BuildRequires: libvirt-python +%endif +%endif +%description pmda-libvirt +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +extracting virtualisation statistics from libvirt about behaviour of guest +and hypervisor machines. +# end pcp-pmda-libvirt + +# +# pcp-pmda-lio +# +%package pmda-lio +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) metrics for the LIO subsystem +URL: http://www.pcp.io +%if !%{disable_python3} +Requires: python3-pcp +Requires: python3-rtslib +%else +Requires: python-pcp +Requires: python-rtslib +%endif +%description pmda-lio +This package provides a PMDA to gather performance metrics from the kernels +iSCSI target interface (LIO). The metrics are stored by LIO within the Linux +kernels configfs filesystem. The PMDA provides per LUN level stats, and a +summary instance per iSCSI target, which aggregates all LUN metrics within the +target. +#end pcp-pmda-lio + %endif # !%{disable_python2} || !%{disable_python3} %if !%{disable_json} @@ -1262,7 +1446,7 @@ collecting metrics about the Bash shell. %package pmda-cifs License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Cifs shell +Summary: Performance Co-Pilot (PCP) metrics for the CIFS protocol URL: http://www.pcp.io Requires: pcp-libs = %{version}-%{release} %description pmda-cifs @@ -1276,7 +1460,7 @@ collecting metrics about the Common Internet Filesytem. %package pmda-cisco License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Cisco shell +Summary: Performance Co-Pilot (PCP) metrics for Cisco routers URL: http://www.pcp.io Requires: pcp-libs = %{version}-%{release} %description pmda-cisco @@ -1290,7 +1474,7 @@ collecting metrics about Cisco routers. %package pmda-gfs2 License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Gfs2 shell +Summary: Performance Co-Pilot (PCP) metrics for the GFS2 filesystem URL: http://www.pcp.io Requires: pcp-libs = %{version}-%{release} %description pmda-gfs2 @@ -1304,7 +1488,7 @@ collecting metrics about the Global Filesystem v2. %package pmda-lmsensors License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Lmsensors shell +Summary: Performance Co-Pilot (PCP) metrics for hardware sensors URL: http://www.pcp.io Requires: pcp-libs = %{version}-%{release} %description pmda-lmsensors @@ -1333,7 +1517,7 @@ supports both sampled and event-style metrics. %package pmda-mailq License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Mailq shell +Summary: Performance Co-Pilot (PCP) metrics for the sendmail queue URL: http://www.pcp.io Requires: pcp-libs = %{version}-%{release} %description pmda-mailq @@ -1347,7 +1531,7 @@ collecting metrics about email queues managed by sendmail. %package pmda-mounts License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Mounts shell +Summary: Performance Co-Pilot (PCP) metrics for filesystem mounts URL: http://www.pcp.io Requires: pcp-libs = %{version}-%{release} %description pmda-mounts @@ -1361,12 +1545,12 @@ collecting metrics about filesystem mounts. %package pmda-nvidia-gpu License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Nvidia shell +Summary: Performance Co-Pilot (PCP) metrics for the Nvidia GPU URL: http://www.pcp.io Requires: pcp-libs = %{version}-%{release} %description pmda-nvidia-gpu This package contains the PCP Performance Metrics Domain Agent (PMDA) for -collecting metrics about the Nvidia gpu metrics. +collecting metrics about Nvidia GPUs. # end pcp-pmda-nvidia-gpu # @@ -1375,13 +1559,13 @@ collecting metrics about the Nvidia gpu metrics. %package pmda-roomtemp License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Roomtemp shell +Summary: Performance Co-Pilot (PCP) metrics for the room temperature URL: http://www.pcp.io Requires: pcp = %{version}-%{release} Requires: pcp-libs = %{version}-%{release} %description pmda-roomtemp This package contains the PCP Performance Metrics Domain Agent (PMDA) for -collecting metrics about the Room temperature metrics. +collecting metrics about the room temperature. # end pcp-pmda-roomtemp %if !%{disable_rpm} @@ -1391,15 +1575,16 @@ collecting metrics about the Room temperature metrics. %package pmda-rpm License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Rpm shell +Summary: Performance Co-Pilot (PCP) metrics for the RPM package manager URL: http://www.pcp.io Requires: pcp = %{version}-%{release} Requires: pcp-libs = %{version}-%{release} %description pmda-rpm This package contains the PCP Performance Metrics Domain Agent (PMDA) for -collecting metrics about the rpms. -# end pcp-pmda-rpm +collecting metrics about the installed RPM packages. %endif +# end pcp-pmda-rpm + # # pcp-pmda-sendmail @@ -1407,13 +1592,13 @@ collecting metrics about the rpms. %package pmda-sendmail License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Sendmail shell +Summary: Performance Co-Pilot (PCP) metrics for Sendmail URL: http://www.pcp.io Requires: pcp = %{version}-%{release} Requires: pcp-libs = %{version}-%{release} %description pmda-sendmail This package contains the PCP Performance Metrics Domain Agent (PMDA) for -collecting metrics about Sendmail traffic metrics. +collecting metrics about Sendmail traffic. # end pcp-pmda-sendmail # @@ -1422,7 +1607,7 @@ collecting metrics about Sendmail traffic metrics. %package pmda-shping License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Shping shell +Summary: Performance Co-Pilot (PCP) metrics for shell command responses URL: http://www.pcp.io Requires: pcp-libs = %{version}-%{release} %description pmda-shping @@ -1437,7 +1622,7 @@ arbitrary shell commands. %package pmda-summary License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Summary shell +Summary: Performance Co-Pilot (PCP) summary metrics from pmie URL: http://www.pcp.io Requires: pcp = %{version}-%{release} Requires: pcp-libs = %{version}-%{release} @@ -1453,12 +1638,12 @@ collecting metrics about other installed pmdas. %package pmda-systemd License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Systemd shell +Summary: Performance Co-Pilot (PCP) metrics from the Systemd journal URL: http://www.pcp.io Requires: pcp-libs = %{version}-%{release} %description pmda-systemd This package contains the PCP Performance Metrics Domain Agent (PMDA) for -collecting metrics about the Systemd shell. +collecting metrics from the Systemd journal. # end pcp-pmda-systemd %endif @@ -1468,12 +1653,12 @@ collecting metrics about the Systemd shell. %package pmda-trace License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Trace shell +Summary: Performance Co-Pilot (PCP) metrics for application tracing URL: http://www.pcp.io Requires: pcp-libs = %{version}-%{release} %description pmda-trace This package contains the PCP Performance Metrics Domain Agent (PMDA) for -collecting metrics about transaction performance metrics from applications. +collecting metrics about trace performance data in applications. # end pcp-pmda-trace # @@ -1482,7 +1667,7 @@ collecting metrics about transaction performance metrics from applications. %package pmda-weblog License: GPLv2+ Group: Applications/System -Summary: Performance Co-Pilot (PCP) metrics for the Weblog shell +Summary: Performance Co-Pilot (PCP) metrics from web server logs URL: http://www.pcp.io Requires: pcp = %{version}-%{release} Requires: pcp-libs = %{version}-%{release} @@ -1506,9 +1691,15 @@ Requires: pcp-pmda-samba pcp-pmda-slurm pcp-pmda-vmware pcp-pmda-zimbra Requires: pcp-pmda-dm pcp-pmda-apache Requires: pcp-pmda-bash pcp-pmda-cisco pcp-pmda-gfs2 pcp-pmda-lmsensors pcp-pmda-mailq pcp-pmda-mounts Requires: pcp-pmda-nvidia-gpu pcp-pmda-roomtemp pcp-pmda-sendmail pcp-pmda-shping -Requires: pcp-pmda-lustrecomm pcp-pmda-logger +Requires: pcp-pmda-lustrecomm pcp-pmda-logger pcp-pmda-docker pcp-pmda-bind2 +%if !%{disable_nutcracker} +Requires: pcp-pmda-nutcracker +%endif %if !%{disable_python2} || !%{disable_python3} -Requires: pcp-pmda-gluster pcp-pmda-zswap pcp-pmda-unbound pcp-pmda-mic +Requires: pcp-pmda-gluster pcp-pmda-zswap pcp-pmda-unbound pcp-pmda-mic pcp-pmda-lio +%if %{collector_with_pmda_libvirt} +Requires: pcp-pmda-libvirt +%endif %endif %if !%{disable_snmp} Requires: pcp-pmda-snmp @@ -1547,6 +1738,18 @@ This meta-package contains the PCP performance monitoring dependencies. This includes a large number of packages for analysing PCP metrics in various ways. # monitor +%package zeroconf +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) Zeroconf Package +URL: http://www.pcp.io +Requires: pcp +Requires: pcp-pmda-dm pcp-pmda-nfsclient +%description zeroconf +This package contains configuration tweaks and files to increase metrics +gathering frequency, several extended pmlogger configurations, as well as +automated pmie diagnosis, alerting and self-healing for the localhost. + %if !%{disable_python2} # # python-pcp. This is the PCP library bindings for python. @@ -1591,7 +1794,7 @@ Metric Domain Agent (PMDA) collector tools written in Python3. # # pcp-system-tools # -%package -n pcp-system-tools +%package system-tools License: GPLv2+ Group: Development/Libraries Summary: Performance Co-Pilot (PCP) System and Monitoring Tools @@ -1603,7 +1806,8 @@ Requires: python3-pcp = %{version}-%{release} Requires: python-pcp = %{version}-%{release} %endif Requires: pcp-libs = %{version}-%{release} -%description -n pcp-system-tools + +%description system-tools This PCP module contains additional system monitoring tools written in python. %endif #end pcp-system-tools @@ -1612,14 +1816,14 @@ in python. # # pcp-gui package for Qt tools # -%package -n pcp-gui +%package gui License: GPLv2+ and LGPLv2+ and LGPLv2+ with exceptions Group: Applications/System Summary: Visualization tools for the Performance Co-Pilot toolkit URL: http://www.pcp.io Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} -%description -n pcp-gui +%description gui Visualization tools for the Performance Co-Pilot toolkit. The pcp-gui package primarily includes visualization tools for monitoring systems using live and archived Performance Co-Pilot @@ -1629,7 +1833,7 @@ monitoring systems using live and archived Performance Co-Pilot # # pcp-doc package # -%package -n pcp-doc +%package doc License: GPLv2+ and CC-BY Group: Documentation %if !%{disable_noarch} @@ -1642,7 +1846,7 @@ URL: http://www.pcp.io Conflicts: pcp-pmda-pmda < 3.10.5 Conflicts: pcp-pmda-infiniband < 3.10.5 -%description -n pcp-doc +%description doc Documentation and tutorial for the Performance Co-Pilot Performance Co-Pilot (PCP) provides a framework and services to support system-level performance monitoring and performance management. @@ -1653,6 +1857,26 @@ level performance management. It includes tutorials, HOWTOs, and other detailed documentation about the internals of core PCP utilities and daemons, and the PCP graphical tools. +# +# pcp-selinux package +# +%if !%{disable_selinux} +%package selinux +License: GPLv2+ and CC-BY +Group: Applications/System +Summary: Selinux policy package +URL: http://www.pcp.io +BuildRequires: selinux-policy-devel +BuildRequires: setools-console +Requires: policycoreutils +Requires: pcp = %{version}-%{release} + +%description selinux +This package contains SELinux support for PCP. The package contains +interface rules, type enforcement and file context adjustments for an +updated policy package. +%endif + %prep %setup -q %setup -q -T -D -a 1 -c -n pcp-%{version}/vector @@ -1669,7 +1893,7 @@ rm -Rf $RPM_BUILD_ROOT %if !%{disable_python2} && 0%{?default_python} != 3 export PYTHON=python%{?default_python} %endif -%configure %{?_with_initd} %{?_with_doc} %{?_with_ib} %{?_with_papi} %{?_with_perfevent} %{?_with_json} %{?_with_snmp} +%configure %{?_with_initd} %{?_with_doc} %{?_with_ib} %{?_with_papi} %{?_with_perfevent} %{?_with_json} %{?_with_snmp} %{?_with_nutcracker} make %{?_smp_mflags} default_pcp %install @@ -1708,6 +1932,10 @@ rm -f $RPM_BUILD_ROOT/%{_pmdasdir}/ib rm -fr $RPM_BUILD_ROOT/%{_pmdasdir}/infiniband %endif +%if %{disable_selinux} +rm -fr $RPM_BUILD_ROOT/%{_selinuxdir} +%endif + %if %{disable_qt} rm -fr $RPM_BUILD_ROOT/%{_pixmapdir} rm -fr $RPM_BUILD_ROOT/%{_confdir}/pmsnap @@ -1732,16 +1960,18 @@ ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} |\ grep -E -v '^simple|sample|trivial|txmon' |\ grep -E -v '^perfevent|perfalloc.1' |\ grep -E -v '^ib$|^infiniband' |\ - grep -E -v '^papi' |\ grep -E -v '^activemq' |\ grep -E -v '^bonding' |\ + grep -E -v '^bind2' |\ grep -E -v '^dbping' |\ + grep -E -v '^docker' |\ grep -E -v '^ds389log'|\ grep -E -v '^ds389' |\ grep -E -v '^elasticsearch' |\ grep -E -v '^gpfs' |\ grep -E -v '^gpsd' |\ grep -E -v '^kvm' |\ + grep -E -v '^lio' |\ grep -E -v '^lustre' |\ grep -E -v '^lustrecomm' |\ grep -E -v '^memcache' |\ @@ -1751,10 +1981,13 @@ ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} |\ grep -E -v '^news' |\ grep -E -v '^nfsclient' |\ grep -E -v '^nginx' |\ + grep -E -v '^nutcracker' |\ grep -E -v '^oracle' |\ + grep -E -v '^papi' |\ grep -E -v '^pdns' |\ grep -E -v '^postfix' |\ grep -E -v '^postgresql' |\ + grep -E -v '^redis' |\ grep -E -v '^rsyslog' |\ grep -E -v '^samba' |\ grep -E -v '^slurm' |\ @@ -1767,6 +2000,7 @@ ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} |\ grep -E -v '^cifs' |\ grep -E -v '^cisco' |\ grep -E -v '^gfs2' |\ + grep -E -v '^libvirt' |\ grep -E -v '^lmsensors' |\ grep -E -v '^logger' |\ grep -E -v '^mailq' |\ @@ -1788,7 +2022,8 @@ ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} |\ # all base pcp package files except those split out into sub packages ls -1 $RPM_BUILD_ROOT/%{_bindir} |\ - grep -E -v 'pmiostat|pmcollectl|pmatop|pmrep|pcp2graphite|zabbix|zbxpcp' |\ + grep -E -v 'pmiostat|pmcollectl|pmatop|zabbix|zbxpcp' |\ + grep -E -v 'pmrep|pcp2graphite|pcp2influxdb' |\ grep -E -v 'pmdbg|pmclient|pmerr|genpmda' |\ sed -e 's#^#'%{_bindir}'\/#' >base_bin.list # @@ -1801,13 +2036,13 @@ ls -1 $RPM_BUILD_ROOT/%{_bindir} |\ grep -E 'pmiostat|pmcollectl|pmatop|pmrep' |\ sed -e 's#^#'%{_bindir}'\/#' >pcp_system_tools.list ls -1 $RPM_BUILD_ROOT/%{_libexecdir}/pcp/bin |\ - grep -E 'atop|collectl|dmcache|free|iostat|numastat|verify|uptime|shping' |\ + grep -E 'atop|collectl|dmcache|free|iostat|mpstat|numastat|pidstat|verify|uptime|shping' |\ sed -e 's#^#'%{_libexecdir}/pcp/bin'\/#' >>pcp_system_tools.list %endif ls -1 $RPM_BUILD_ROOT/%{_libexecdir}/pcp/bin |\ %if !%{disable_python2} || !%{disable_python3} - grep -E -v 'atop|collectl|dmcache|free|iostat|numastat|verify|uptime|shping' |\ + grep -E -v 'atop|collectl|dmcache|free|iostat|mpstat|numastat|pidstat|verify|uptime|shping' |\ %endif sed -e 's#^#'%{_libexecdir}/pcp/bin'\/#' >base_exec.list ls -1 $RPM_BUILD_ROOT/%{_booksdir} |\ @@ -1818,15 +2053,22 @@ ls -1 $RPM_BUILD_ROOT/%{_mandir}/man5 |\ sed -e 's#^#'%{_mandir}'\/man5\/#' >>pcp-doc.list ls -1 $RPM_BUILD_ROOT/%{_datadir}/pcp/demos/tutorials |\ sed -e 's#^#'%{_datadir}/pcp/demos/tutorials'\/#' >>pcp-doc.list +%if !%{disable_selinux} +ls -1 $RPM_BUILD_ROOT/%{_selinuxdir} |\ + sed -e 's#^#'%{_selinuxdir}'\/#' > pcp-selinux.list +%endif %if !%{disable_qt} ls -1 $RPM_BUILD_ROOT/%{_pixmapdir} |\ sed -e 's#^#'%{_pixmapdir}'\/#' > pcp-gui.list -cat base_bin.list base_exec.list base_man.list |\ +cat base_bin.list base_exec.list |\ grep -E "$PCP_GUI" >> pcp-gui.list %endif -cat base_pmdas.list base_bin.list base_exec.list base_man.list |\ +ls -1 $RPM_BUILD_ROOT/%{_logconfdir}/ |\ + sed -e 's#^#'%{_logconfdir}'\/#' |\ + grep -E -v 'zeroconf' >pcp-logconf.list +cat base_pmdas.list base_bin.list base_exec.list pcp-logconf.list |\ grep -E -v 'pmdaib|pmmgr|pmweb|pmsnap|2pcp|pmdas/systemd' |\ - grep -E -v "$PCP_GUI|pixmaps|pcp-doc|tutorials" |\ + grep -E -v "$PCP_GUI|pixmaps|pcp-doc|tutorials|selinux" |\ grep -E -v %{_confdir} | grep -E -v %{_logsdir} > base.list # all devel pcp package files except those split out into sub packages @@ -1988,12 +2230,18 @@ fi %preun pmda-activemq %{pmda_remove "$1" "activemq"} +%preun pmda-bind2 +%{pmda_remove "$1" "bind2"} + %preun pmda-bonding %{pmda_remove "$1" "bonding"} %preun pmda-dbping %{pmda_remove "$1" "dbping"} +%preun pmda-docker +%{pmda_remove "$1" "docker"} + %preun pmda-ds389 %{pmda_remove "$1" "ds389"} @@ -2009,6 +2257,9 @@ fi %preun pmda-kvm %{pmda_remove "$1" "kvm"} +%preun pmda-lio +%{pmda_remove "$1" "lio"} + %preun pmda-lustre %{pmda_remove "$1" "lustre"} @@ -2030,12 +2281,20 @@ fi %preun pmda-nfsclient %{pmda_remove "$1" "nfsclient"} +%if !%{disable_nutcracker} +%preun pmda-nutcracker +%{pmda_remove "$1" "nutcracker"} +%endif + %preun pmda-pdns %{pmda_remove "$1" "pdns"} %preun pmda-rsyslog %{pmda_remove "$1" "rsyslog"} +%preun pmda-redis +%{pmda_remove "$1" "redis"} + %preun pmda-samba %{pmda_remove "$1" "samba"} @@ -2060,6 +2319,9 @@ fi %preun pmda-mic %{pmda_remove "$1" "mic"} + +%preun pmda-libvirt +%{pmda_remove "$1" "libvirt"} %endif # !%{disable_python[2,3]} %preun pmda-apache @@ -2176,6 +2438,47 @@ chown -R pcp:pcp %{_logsdir}/pmmgr 2>/dev/null %endif %endif +%post zeroconf +PCP_PMDAS_DIR=%{_pmdasdir} +PCP_SYSCONFIG_DIR=%{_sysconfdir}/sysconfig +# auto-install important PMDAs for RH Support +for PMDA in dm nfsclient ; do + touch "$PCP_PMDAS_DIR/$PMDA/.NeedInstall" +done +# increase default pmlogger recording frequency +sed -i 's/^\#\ PMLOGGER_INTERVAL.*/PMLOGGER_INTERVAL=10/g' "$PCP_SYSCONFIG_DIR/pmlogger" +# 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 pmie >/dev/null 2>&1 + systemctl enable pmcd >/dev/null 2>&1 + systemctl enable pmlogger >/dev/null 2>&1 + systemctl enable pmie >/dev/null 2>&1 +%else + /sbin/chkconfig --add pmcd >/dev/null 2>&1 + /sbin/chkconfig --add pmlogger >/dev/null 2>&1 + /sbin/chkconfig --add pmie >/dev/null 2>&1 + /sbin/service pmcd condrestart + /sbin/service pmlogger condrestart + /sbin/service pmie condrestart +%endif +%endif #zeroconf + + +%if !%{disable_selinux} +%post selinux +%{selinux_handle_policy "$1" "pcpupstream.pp"} + +%triggerin selinux -- docker-selinux +%{selinux_handle_policy "$1" "pcpupstream-docker.pp"} + +%triggerin selinux -- container-selinux +%{selinux_handle_policy "$1" "pcpupstream-container.pp"} +%endif + %post PCP_LOG_DIR=%{_logsdir} PCP_PMNS_DIR=%{_pmnsdir} @@ -2235,6 +2538,17 @@ cd %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig +%if !%{disable_selinux} +%preun selinux +%{selinux_handle_policy "$1" "pcpupstream"} + +%triggerun selinux -- docker-selinux +%{selinux_handle_policy "$1" "pcpupstream-docker"} + +%triggerun selinux -- container-selinux +%{selinux_handle_policy "$1" "pcpupstream-container"} + +%endif %files -f base.list # # Note: there are some headers (e.g. domain.h) and in a few cases some @@ -2303,13 +2617,13 @@ cd %config(noreplace) %{_confdir}/pmlogger/control.d/local %dir %attr(0775,pcp,pcp) %{_confdir}/nssdb +%ghost %{_localstatedir}/run/pcp %{_localstatedir}/lib/pcp/config/pmafm %dir %attr(0775,pcp,pcp) %{_localstatedir}/lib/pcp/config/pmie %{_localstatedir}/lib/pcp/config/pmie %{_localstatedir}/lib/pcp/config/pmieconf %dir %attr(0775,pcp,pcp) %{_localstatedir}/lib/pcp/config/pmlogger %{_localstatedir}/lib/pcp/config/pmlogger/* -%{_localstatedir}/lib/pcp/config/pmlogconf %{_localstatedir}/lib/pcp/config/pmlogrewrite %dir %attr(0775,pcp,pcp) %{_localstatedir}/lib/pcp/config/pmda @@ -2326,6 +2640,9 @@ cd %files collector #empty +%files zeroconf +%{_localstatedir}/lib/pcp/config/pmlogconf/zeroconf + %files conf %dir %{_includedir}/pcp %{_includedir}/pcp/builddefs @@ -2341,6 +2658,7 @@ cd %{_libdir}/libpcp_pmda.so.3 %{_libdir}/libpcp_trace.so.2 %{_libdir}/libpcp_import.so.1 +%{_libdir}/libpcp_web.so.1 %files libs-devel %{_libdir}/libpcp.so @@ -2349,6 +2667,7 @@ cd %{_libdir}/libpcp_pmda.so %{_libdir}/libpcp_trace.so %{_libdir}/libpcp_import.so +%{_libdir}/libpcp_web.so %{_includedir}/pcp/*.h %files devel -f devel.list @@ -2453,6 +2772,9 @@ cd %files pmda-bonding %{_pmdasdir}/bonding +%files pmda-bind2 +%{_pmdasdir}/bind2 + %files pmda-dbping %{_pmdasdir}/dbping @@ -2474,6 +2796,12 @@ cd %files pmda-kvm %{_pmdasdir}/kvm +%files pmda-docker +%{_pmdasdir}/docker + +%files pmda-lio +%{_pmdasdir}/lio + %files pmda-lustre %{_pmdasdir}/lustre @@ -2501,6 +2829,11 @@ cd %files pmda-nfsclient %{_pmdasdir}/nfsclient +%if !%{disable_nutcracker} +%files pmda-nutcracker +%{_pmdasdir}/nutcracker +%endif + %files pmda-oracle %{_pmdasdir}/oracle @@ -2513,6 +2846,9 @@ cd %files pmda-postgresql %{_pmdasdir}/postgresql +%files pmda-redis +%{_pmdasdir}/redis + %files pmda-rsyslog %{_pmdasdir}/rsyslog @@ -2549,8 +2885,14 @@ cd %files pmda-mic %{_pmdasdir}/mic +%files pmda-libvirt +%{_pmdasdir}/libvirt + %files export-pcp2graphite %{_bindir}/pcp2graphite + +%files export-pcp2influxdb +%{_bindir}/pcp2influxdb %endif # !%{disable_python2} || !%{disable_python3} %files export-zabbix-agent @@ -2636,7 +2978,7 @@ cd %endif %if !%{disable_qt} -%files -n pcp-gui -f pcp-gui.list +%files gui -f pcp-gui.list %{_confdir}/pmsnap %config(noreplace) %{_confdir}/pmsnap/control @@ -2646,15 +2988,40 @@ cd %{_datadir}/applications/pmchart.desktop %endif -%files -n pcp-doc -f pcp-doc.list +%files doc -f pcp-doc.list + +%if !%{disable_selinux} +%files selinux -f pcp-selinux.list +%endif %if !%{disable_python2} || !%{disable_python3} -%files -n pcp-system-tools -f pcp_system_tools.list +%files system-tools -f pcp_system_tools.list %dir %{_confdir}/pmrep %config(noreplace) %{_confdir}/pmrep/pmrep.conf %endif %changelog +* Wed Jun 14 2017 Nathan Scott - 3.11.8-7 +- Fix problems in the new pcp-zeroconf sub-package (BZ 1456609) + +* Mon May 8 2017 Lukas Berk - 3.11.8-5 +- Removed pmdalibvirt dep for collector on aarch64 (BZ 1432007) + +* Fri Apr 21 2017 Nathan Scott - 3.11.8-4 +- Enable collecting POWER9 NEST PMU perf metrics (BZ 1419490) +- SELinux policy updates (BZs 1381301,1432086,1433271,1443632) +- zeroconf package added (BZs 1211432, 1371950) + +* Thu Mar 02 2017 Nathan Scott - 3.11.8-3 +- Rebuild with the correct (previous) version of Vector. + +* Wed Mar 01 2017 Nathan Scott - 3.11.8-2 +- Drop pcp-pmda-nutcracker package, missing deps (BZ 1425880) +- Incorporate several fixes from Coverity scan review. + +* Mon Feb 20 2017 Dave Brolley - 3.11.8-1 +- Latest upstream PCP, dropping all earlier patches (BZ 1423020) + * Fri Aug 26 2016 Lukas Berk - 3.11.3-4 - pcp-pmda-ds389log uses dirsrv user instead of nobody