Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add seek needed to read a growing file on newer Perl versions.
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, seek to the current position, which clears the EOF flag. See https://groups.google.com/g/linux.debian.bugs.dist/c/ZaxLI8YufO8 for details. 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.
- Loading branch information