diff --git a/SOURCES/bz1919318-01-remove-unwanted-logging-to-system-log.patch b/SOURCES/bz1919318-01-remove-unwanted-logging-to-system-log.patch new file mode 100644 index 0000000..e5b48c5 --- /dev/null +++ b/SOURCES/bz1919318-01-remove-unwanted-logging-to-system-log.patch @@ -0,0 +1,42 @@ +From e802f0c419ca3ff12a75045f57ed3ab535ff1c46 Mon Sep 17 00:00:00 2001 +From: Tomas Jelinek +Date: Thu, 7 Jan 2021 16:33:12 +0100 +Subject: [PATCH] remove unwanted logging to system log + +In commit 966959ac54d80c4cdeeb0fac40dc7ea60c1a0a82, pcs/app.py got +imported into pcs/run.py. The intention was to unify running various pcs +parts (cli, daemon, snmp). This caused logging.basicConfigure() located +in app.py to be run every time run.py was executed. Due to this, pcs +daemon was configured to log to stderr. All those stderr logs were +propagated to system log by systemd / system logger. +--- + pcs/app.py | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/pcs/app.py b/pcs/app.py +index 4806c2d0..c3de179b 100644 +--- a/pcs/app.py ++++ b/pcs/app.py +@@ -111,7 +111,6 @@ def _non_root_run(argv_cmd): + sys.exit(exitcode) + + +-logging.basicConfig() + usefile = False + filename = "" + +@@ -227,9 +226,8 @@ def main(argv=None): + ).format(val) + ) + +- logger = logging.getLogger("pcs") +- logger.propagate = 0 +- logger.handlers = [] ++ # initialize logger ++ logging.getLogger("pcs") + + if (os.getuid() != 0) and (argv and argv[0] != "help") and not usefile: + _non_root_run(argv) +-- +2.26.2 + diff --git a/SPECS/pcs.spec b/SPECS/pcs.spec index 3a5e3fd..a9a8f9a 100644 --- a/SPECS/pcs.spec +++ b/SPECS/pcs.spec @@ -1,6 +1,6 @@ Name: pcs Version: 0.10.6 -Release: 4%{?dist} +Release: 4%{?dist}.1 # https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/ # https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses # GPLv2: pcs @@ -122,6 +122,7 @@ Patch5: bz1867516-01-rule-fix-mixing-and-and-or-expressions.patch # Downstream patches do not come from upstream. They adapt pcs for specific # RHEL needs. Patch101: do-not-support-cluster-setup-with-udp-u-transport.patch +Patch102: bz1919318-01-remove-unwanted-logging-to-system-log.patch # git for patches BuildRequires: git @@ -290,6 +291,7 @@ update_times_patch %{PATCH3} update_times_patch %{PATCH4} update_times_patch %{PATCH5} update_times_patch %{PATCH101} +update_times_patch %{PATCH102} cp -f %SOURCE1 pcsd/public/images # prepare dirs/files necessary for building web ui @@ -623,6 +625,10 @@ remove_all_tests %license pyagentx_LICENSE.txt %changelog +* Mon Feb 08 2021 Miroslav Lisik - 0.10.6-4.el8_3.1 +- Remove unwanted logging to system log +- Resolves: rhbz#1919318 + * Tue Aug 11 2020 Miroslav Lisik - 0.10.6-4 - Fixed invalid CIB error caused by resource and operation defaults with mixed and-or rules - Updated pcs-web-ui