Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2039106

Summary: Logging role "logging_purge_confs" option not properly working
Product: Red Hat Enterprise Linux 9 Reporter: Noriko Hosoi <nhosoi>
Component: rhel-system-rolesAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Jakub Haruda <jharuda>
Severity: unspecified Docs Contact: Gabi Fialová <gfialova>
Priority: unspecified    
Version: 9.0CC: djez, gfialova, jafiala, jharuda, nhosoi, rmeggins, spetrosi
Target Milestone: rcKeywords: Triaged
Target Release: 9.0Flags: gfialova: needinfo-
pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:logging
Fixed In Version: rhel-system-roles-1.12.0-1.el9 Doc Type: Bug Fix
Doc Text:
.The `logging_purge_confs` option correctly deletes unnecessary configuration files With the `logging_purge_confs` option set to `true`, it should delete unnecessary logging configuration files. Previously, however, unnecessary configuration files were not deleted from the configuration directory even if `logging_purge_confs` was set to `true`. This issue is now fixed and the option has been redefined as follows: if `logging_purge_confs` is set to `true`, Rsyslog removes files from the `rsyslog.d` directory which do not belong to any rpm packages. This includes configuration files generated by previous runs of the Logging role. The default value of `logging_purge_confs` is `false`.
Story Points: ---
Clone Of:
: 2039107 (view as bug list) Environment:
Last Closed: 2022-05-17 13:03:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1990985, 2039107    

Description Noriko Hosoi 2022-01-11 01:09:26 UTC
Description of problem:
When "logging_purge_confs: true" is set in the playbook as [0], if the cleanup task is executed as in [1], all the config files in /etc/rsyslog.d are wiped out.

Then the cleanup task tries to restart rsyslogd to fail with the broken configuration. 

[0]- https://github.com/linux-system-roles/logging/blob/master/tests/tests_basics_files.yml#L286
[1] - https://github.com/linux-system-roles/logging/blob/master/tests/tests_basics_files.yml#L387

To avoid the broken configuration problem, the logging role generates a backup file of /etc/rsyslog.conf and files in /etc/rsyslog.d prior to running the logging role and store it in /var/lib/rsyslog.

Then, if logging_restore_confs is set to true, the configuration files in the backup file are restored in /etc.

This is useful to reset the rsyslog configration as in [1].


To verify, run TEST CASE 3 in tests_basics_files.yml.
https://github.com/linux-system-roles/logging/blob/master/tests/tests_basics_files.yml#L282

Comment 1 Noriko Hosoi 2022-01-18 20:51:41 UTC
Note: this bz is a rhel-9 counterpart of Bug 2040812.

Comment 2 Noriko Hosoi 2022-01-18 21:32:55 UTC
*** Bug 1990971 has been marked as a duplicate of this bug. ***

Comment 18 errata-xmlrpc 2022-05-17 13:03:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: rhel-system-roles), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2443