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.
DescriptionOrion Poplawski
2014-08-23 19:30:20 UTC
Description of problem:
fail2ban is being prevented by SELinux to read the journal:
type=AVC msg=audit(1408819296.642:22362): avc: denied { read } for pid=14066 comm="fail2ban-server" name="journal" dev="tmpfs" ino=6280 scontext=system_u:system_r:fail2ban_t:s0 tcontext=system_u:object_r:syslogd_var_run_t:s0 tclass=dir
specifically trying to read the directory /run/log/journal. However no error appears to be returned back up to fail2ban that it cannot access the journal, which results in much confusion.
Version-Release number of selected component (if applicable):
systemd-python-208-11.el7_0.2.x86_64
Comment 4Zbigniew Jędrzejewski-Szmek
2016-06-30 13:50:03 UTC
That's more or less on purpose: there's no way to easily distinguish (in general) between the cases of a) not having a journal files yet because it's too early, b) not having any journal files that we have privileges to read yet, c) not having any journal files because of some error.
journalctl does some fairly complicated heuristics to try to determine the reasons for failure and possibly emit some hints (see https://github.com/systemd/systemd/blob/master/src/journal/journalctl.c#L1864). But this code is closely related to the way that systemd is installed, and we update it when we change ACLs and other details of systemd installation. So I don't think including this level of detail in an external API is possible.
Currently there's an API to check whether the runtime or persistent journals were opened (sd_journal_has_{runtime,persistent}_files). fail2ban could error out if both return 0 after it has been started.
I think we could add an API (in libsystemd) which returns a list of errors encountered when opening files, I see how that would be useful. I don't know if there would be interest in that.
Description of problem: fail2ban is being prevented by SELinux to read the journal: type=AVC msg=audit(1408819296.642:22362): avc: denied { read } for pid=14066 comm="fail2ban-server" name="journal" dev="tmpfs" ino=6280 scontext=system_u:system_r:fail2ban_t:s0 tcontext=system_u:object_r:syslogd_var_run_t:s0 tclass=dir specifically trying to read the directory /run/log/journal. However no error appears to be returned back up to fail2ban that it cannot access the journal, which results in much confusion. Version-Release number of selected component (if applicable): systemd-python-208-11.el7_0.2.x86_64