Blame SOURCES/redhat-bugzilla-2101574-farm-config.patch

5823b6
From 73c024c64f7db68fdcd224c27c1711fa6dd1d254 Mon Sep 17 00:00:00 2001
5823b6
From: Nathan Scott <nathans@redhat.com>
5823b6
Date: Tue, 28 Jun 2022 10:06:06 +1000
5823b6
Subject: [PATCH] pmlogger_farm: add default configuration file for farm
5823b6
 loggers
5823b6
5823b6
Provide a mechanism whereby the farm loggers can be configured.
5823b6
There has been reluctance in the past to sharing configuration
5823b6
of the local primary logger, so these are now done separately.
5823b6
Makes sense to me as the primary pmlogger may need to use more
5823b6
frequent sampling, may not want to allow remote pmlc, etc.
5823b6
5823b6
Resolves Red Hat BZ #2101574
5823b6
---
5823b6
 src/pmlogger/GNUmakefile            |  1 +
5823b6
 src/pmlogger/pmlogger.defaults      |  2 ++
5823b6
 src/pmlogger/pmlogger_check.sh      |  5 +++--
5823b6
 src/pmlogger/pmlogger_farm.defaults | 27 +++++++++++++++++++++++++++
5823b6
 4 files changed, 33 insertions(+), 2 deletions(-)
5823b6
 create mode 100644 src/pmlogger/pmlogger_farm.defaults
5823b6
5823b6
diff -Naurp pcp-5.3.7.orig/src/pmlogger/GNUmakefile pcp-5.3.7/src/pmlogger/GNUmakefile
5823b6
--- pcp-5.3.7.orig/src/pmlogger/GNUmakefile	2022-02-02 11:53:05.000000000 +1100
5823b6
+++ pcp-5.3.7/src/pmlogger/GNUmakefile	2022-08-31 11:23:08.758672970 +1000
5823b6
@@ -45,6 +45,7 @@ install:: $(SUBDIRS)
5823b6
 
5823b6
 install:: default
5823b6
 	$(INSTALL) -m 775 -o $(PCP_USER) -g $(PCP_GROUP) -d $(PCP_VAR_DIR)/config/pmlogger
5823b6
+	$(INSTALL) -m 644 pmlogger_farm.defaults $(PCP_SYSCONFIG_DIR)/pmlogger_farm
5823b6
 	$(INSTALL) -m 644 pmlogger.defaults $(PCP_SYSCONFIG_DIR)/pmlogger
5823b6
 	$(INSTALL) -m 755 -d $(PCP_SHARE_DIR)/zeroconf
5823b6
 	$(INSTALL) -m 644 pmlogger.zeroconf $(PCP_SHARE_DIR)/zeroconf/pmlogger
5823b6
diff -Naurp pcp-5.3.7.orig/src/pmlogger/pmlogger_check.sh pcp-5.3.7/src/pmlogger/pmlogger_check.sh
5823b6
--- pcp-5.3.7.orig/src/pmlogger/pmlogger_check.sh	2022-04-05 09:05:43.000000000 +1000
5823b6
+++ pcp-5.3.7/src/pmlogger/pmlogger_check.sh	2022-08-31 11:23:08.758672970 +1000
5823b6
@@ -1,6 +1,6 @@
5823b6
 #! /bin/sh
5823b6
 #
5823b6
-# Copyright (c) 2013-2016,2018,2020-2021 Red Hat.
5823b6
+# Copyright (c) 2013-2016,2018,2020-2022 Red Hat.
5823b6
 # Copyright (c) 1995-2000,2003 Silicon Graphics, Inc.  All Rights Reserved.
5823b6
 #
5823b6
 # This program is free software; you can redistribute it and/or modify it
5823b6
@@ -24,6 +24,7 @@
5823b6
 PMLOGGER="$PCP_BINADM_DIR/pmlogger"
5823b6
 PMLOGCONF="$PCP_BINADM_DIR/pmlogconf"
5823b6
 PMLOGGERENVS="$PCP_SYSCONFIG_DIR/pmlogger"
5823b6
+PMLOGGERFARMENVS="$PCP_SYSCONFIG_DIR/pmlogger_farm"
5823b6
 PMLOGGERZEROCONFENVS="$PCP_SHARE_DIR/zeroconf/pmlogger"
5823b6
 
5823b6
 # error messages should go to stderr, not the GUI notifiers
5823b6
@@ -972,8 +973,8 @@ END				{ print m }'`
5823b6
 		    continue
5823b6
 		fi
5823b6
 	    else
5823b6
+		envs=`grep -h ^PMLOGGER "$PMLOGGERFARMENVS" 2>/dev/null`
5823b6
 		args="-h $host $args"
5823b6
-		envs=""
5823b6
 		iam=""
5823b6
 	    fi
5823b6
 
5823b6
diff -Naurp pcp-5.3.7.orig/src/pmlogger/pmlogger.defaults pcp-5.3.7/src/pmlogger/pmlogger.defaults
5823b6
--- pcp-5.3.7.orig/src/pmlogger/pmlogger.defaults	2022-02-03 16:11:40.000000000 +1100
5823b6
+++ pcp-5.3.7/src/pmlogger/pmlogger.defaults	2022-08-31 11:23:08.758672970 +1000
5823b6
@@ -1,5 +1,7 @@
5823b6
 # Environment variables for the primary pmlogger daemon.  See also
5823b6
 # the pmlogger control file and pmlogconf(1) for additional details.
5823b6
+# Also see separate pmlogger_farm configuration for the non-primary
5823b6
+# logger configuration settings, separate to this file.
5823b6
 # Settings defined in this file will override any settings in the
5823b6
 # pmlogger zeroconf file (if present).
5823b6
 
5823b6
diff -Naurp pcp-5.3.7.orig/src/pmlogger/pmlogger_farm.defaults pcp-5.3.7/src/pmlogger/pmlogger_farm.defaults
5823b6
--- pcp-5.3.7.orig/src/pmlogger/pmlogger_farm.defaults	1970-01-01 10:00:00.000000000 +1000
5823b6
+++ pcp-5.3.7/src/pmlogger/pmlogger_farm.defaults	2022-08-31 11:23:08.758672970 +1000
5823b6
@@ -0,0 +1,27 @@
5823b6
+# Environment variables for the pmlogger farm daemons.  See also
5823b6
+# pmlogger control file(s) and pmlogconf(1) for additional details.
5823b6
+# Also see separate pmlogger configuration for the primary logger
5823b6
+# configuration settings, separate to this file.
5823b6
+
5823b6
+# Behaviour regarding listening on external-facing interfaces;
5823b6
+# unset PMLOGGER_LOCAL to allow connections from remote hosts.
5823b6
+# A value of 0 permits remote connections, 1 permits local only.
5823b6
+# PMLOGGER_LOCAL=1
5823b6
+
5823b6
+# Max length to which the queue of pending connections may grow
5823b6
+# A value of 5 is the default.
5823b6
+# PMLOGGER_MAXPENDING=5
5823b6
+
5823b6
+# Default sampling interval pmlogger uses when no more specific
5823b6
+# interval is requested.  A value of 60 seconds is the default.
5823b6
+# Both pmlogger command line (via control file) and also pmlogger
5823b6
+# configuration file directives will override this value.
5823b6
+# PMLOGGER_INTERVAL=60
5823b6
+
5823b6
+# The default behaviour, when pmlogger configuration comes from
5823b6
+# pmlogconf(1), is to regenerate the configuration file and check for
5823b6
+# changes whenever pmlogger is started from pmlogger_check(1).
5823b6
+# If the PMDA configuration is stable, this is not necessary, and
5823b6
+# setting PMLOGGER_CHECK_SKIP_LOGCONF to yes disables the regeneration
5823b6
+# and checking.
5823b6
+# PMLOGGER_CHECK_SKIP_LOGCONF=yes