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 1540132 - [RFE]: Delay loading imjournal after opening omfile FDs
Summary: [RFE]: Delay loading imjournal after opening omfile FDs
Keywords:
Status: CLOSED DUPLICATE of bug 1553700
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rsyslog
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Jiří Vymazal
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-30 10:40 UTC by Renaud Métrich
Modified: 2021-12-10 15:37 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-23 08:44:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3339431 0 None None None 2018-01-31 09:45:08 UTC

Description Renaud Métrich 2018-01-30 10:40:11 UTC
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

Comment 6 Renaud Métrich 2018-03-01 13:50:23 UTC
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,...}

Comment 8 Jiří Vymazal 2018-03-02 13:25:42 UTC
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.

Comment 9 Renaud Métrich 2018-03-09 11:01:47 UTC
See also BZ 1553700, maybe this RFE will not be needed after all.


Note You need to log in before you can comment on or make changes to this bug.