Skip to content
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

Enhancement: Continue log rotation for valid files when encountering ownership issues #558

Open
Frejr opened this issue Nov 9, 2023 · 1 comment

Comments

@Frejr
Copy link

Frejr commented Nov 9, 2023

Issue Summary:

The current behavior of logrotate halts the rotation process for all files when it encounters a file with an unexpected ownership, potentially leading to undetected disk space issues due to unrotated logs.

Expected Behavior:

Ideally, logrotate should continue to rotate those logs that do not present any ownership conflicts. This would ensure that manageable logs are properly rotated, preventing them from consuming excessive disk space.

Suggested Feature:

Introduce an option such as all-or-nothing which when set, logrotate will only proceed with rotation if all logs in a section can be rotated. Otherwise, it will skip the entire section. Or an option like rotate-when-possible could instruct logrotate to continue rotating files that do not have ownership or another issues, while only skipping the problematic files.

Benefits:

Prevents potential disk space issues by ensuring that at least some logs are rotated regularly.
Provides more granular control to system administrators over the log rotation process.
Allows for better handling of unexpected file ownership without halting the entire rotation process.

Additional Context:

This issue can lead to significant disk space consumption when logrotate encounters a file with incorrect ownership, causing it to stop rotating other files that are otherwise ready for rotation. By implementing a solution that allows for selective rotation, we can mitigate the risk of logs filling up disk space unnecessarily.

We have quite big list of logs gatering from remote hosts. Someone temporary created another logfile with "wrong" ownership. After few days logrotate complained not only about wrong ownership but also about all files that can't compress because due few days logs wasn't rotate and gzip had nothing to compress acording to configuration. Finding problematic folder wasn't so obvious while free disk space running away.

@cgzones
Copy link
Member

cgzones commented Jan 5, 2024

Can you show the output of the failed logrotate run?
I did a simple test and logrotate did continue to rotate logs from other configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants