Add seek needed to read a growing file on newer Perl versions. #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The issue of interest:
https://groups.google.com/g/linux.debian.bugs.dist/c/ZaxLI8YufO8
As of Perl 5.36, it appears that they have fixed the broken EOF handling and pgaudit_analyze will not continue to read the log after it parses it the first time. This means that it is unable to get any new log entries that are added to a file after it opens it the first time. To fix this, the PR includes a change to reset the file handler which clears the EOF flag.
This specific issue was found because on Debian 12 (Bookworm) the default Perl version is now 5.36.0-7, which during our testing we found that the daemon was no longer updating. After debugging and thinking that the daemon was dying, we realized that if we started the daemon again it would update the analyze DB to the current state of the log files, but not get any new updates. After troubleshooting further, we found that it was related to the above bug and this small change appears to fix the issue.
We have tested various fixes and this one appears to be the least impactful on CPU utilization, but still resolves the issue in question.