Description of problem:
When switching to persistent journald storage (section 2.10.5 of the Red Hat Enterprise System Admin Guide), rsyslog does not appear to see any additional journal messages until rsyslog itself is restarted.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Start with non-persistent journald config (no /var/log/journal directory)
2. Do something that would log to /var/log/secure (like "ssh localhost" and give a bogus password).
3. Observe that /var/log/secure has some entries for the failed sshd session
4. Configure persistent logging, with "mkdir /var/log/journal; systemctl restart systemd-journald"
5. Repeat step 2 above (another ssh connection)
6. /var/log/secure does not have any additional logging until rsyslog is restarted (but journalctl will show them)
Missing entries in files written to by rsyslogd
Complete log entries
Created attachment 1262471 [details]
could you please describe in more detail what changes for rsyslog when persistent journald storage is configured? Does rsyslog continue reading messages from the socket? Is it really expected that rsyslog would handle this configuration change without a restart?
(In reply to Karel Srot from comment #4)
> Hi Radovan,
> could you please describe in more detail what changes for rsyslog when
> persistent journald storage is configured? Does rsyslog continue reading
> messages from the socket? Is it really expected that rsyslog would handle
> this configuration change without a restart?
> Thank you.
when we are switching journal between runtime and persistent, it changes file descriptor/s so imjournal is not able to read anything and it polls forever.
This patch handles return values from journal API better and after systemd fix above imjournal is able to distinguish whether journal changed file descriptor/s or not.
I think that is a bug but tolerated one so far.
It could be simply tested like in description.
After switching journal files, rsyslog is trying to apply last valid cursor from statefile so few messages can appear again it depends on persist state interval.
It is because when rsyslog find out that journal has been changed it is impossible to get cursor. Journal structure is something like undefined so this is why we are using last valid cursor form statefile.
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, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.