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.
Description of problem:
When using default rsyslog and systemd parameters, rsyslog cannot open files /var/log/secure, /var/log/messages, etc for writing if a persistent journal is used and ~1000 files are listed in /var/log/journal/<machine_id>
The issue happens if there are a lot of users accessing the system, as default journald.conf "SplitMode=uid" or "SplitMode=login" is used.
If there was not many journal files at the time rsyslogd started, then, upon reaching the number of files limit, logs for newly connecting users will be lost.
Version-Release number of selected component (if applicable):
rsyslog-8.24.0-12.el7.x86_64
How reproducible:
Always
Steps to Reproduce:
1. Create persistent journal
# mkdir -p /var/log/journal
# systemctl restart systemd-journald
2. Create 2000 users
# for i in $(seq 1 2000); do useradd user$i; passwd --stdin user$i <<< pass; done
3. Create the journal files for the users (e.g. connect to the system as the user using ssh)
Actual results:
Upon reaching 1024 files, new user's log in /var/log/secure is lost because rsyslogd doesn't process the user-XXX.journal file.
Upon restarting rsyslogd, no log goes into /var/log/messages or /var/log/secure:
# ll /proc/$(pgrep rsyslogd)/fd | grep -vw journal
total 0
lr-x------. 1 root root 64 Jan 30 11:28 0 -> /dev/null
l-wx------. 1 root root 64 Jan 30 11:28 1 -> /dev/null
l-wx------. 1 root root 64 Jan 30 11:28 2 -> /dev/null
lrwx------. 1 root root 64 Jan 30 11:28 3 -> socket:[794974]
lr-x------. 1 root root 64 Jan 30 11:28 4 -> anon_inode:inotify
The issue is not withing rsyslogd, but the systemd library rsyslogd is linking against (due to imjournal plugin).
The library opens all files in the /var/log/journal/<machineid> even though they will likely not be used later.
See BZ 1550575 for corresponding systemd issue.
At the rsyslog level, we may "fix" somehow the issue by delaying imjournal initialization until the internal FDs are opened, this would at least enable to have FDs to /var/log/{message,|secure,...}
Ok, so I changed this to RFE as you described, that is to delay imjournal initialization after the "core" files are opened.
Other option for the use case you described in initial comment is to do the file splitting in rsyslog using dynamic files.