-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not use copytruncate for xcat log rotation #7425
Conversation
PR #6510 tried to fix missing logs for goconserver, but also added copytruncate to all xcat logs in /var/log/xcat*.log. This is not needed because these logs are written by rsyslog and xcat itself, not goconserver. The main rsyslog developer does not recommend to use copytruncate for rsyslog: https://serverfault.com/a/901366 For HA setups with logs on NFS etc. copytruncate can be very slow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When logrotate runs are log files correctly written to post rotate?
I have seen issues in other software where logrorate runs and the process is still writing to the old inode. To resolve these issues, I implemented copytruncate.
Yes but this shouldn't be the case here because we do:
The official rsyslog-logrotate package is doing the same:
I tested the change and for me it's working fine. And before #6510 there was no issue with xCAT logs either. But please test on your system, too. |
Given that rsyslog honors the Ubuntu 20.04 uses the following:
Ubuntu 22.04 uses the following:
Debian 12 Bookworm uses the following:
I'd suggest adding the debian/ubuntu check+execute into the postrotate section of xCAT/etc/logrotate.d/xcat , or I can create a PR for this change this is merged. |
There is no |
@Obihoernchen Yes that script doesn't exist for the RH based distributions. However:
What I am proposing is to add the following to the list in the
This fixes a hole in Ubuntu support, as well as increases Debian compatibility. It's also possible that |
@samveen Very good point thank you! Added. |
@Obihoernchen Trying to get closet to the tip than the base in Graham's Hierarchy of Disagreement 🤣 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the additional comments above. Changes approved.
PR #6510 tried to fix missing logs for goconserver, but also added copytruncate to all xcat logs in
/var/log/xcat*.log
. This is not needed because these logs are written by rsyslog and xcat itself, not goconserver.The main rsyslog developer does not recommend to use copytruncate for rsyslog: https://serverfault.com/a/901366
For HA setups with logs on NFS etc. copytruncate can be very slow. A simple move/rename is way faster and cleaner.
I'm keeping
delaycompress
because I think it's nice to have some more days/weeks of logs uncompressed. Furthermore, some users might be used to it already.