Backport(v5): tmpfiles.d: ensure tmp dir for lock files not be cleaned up (#921) #924
+71
−0
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.
Backport #921
We should exclude
/tmp/fluentd-lock-*directory. If/tmp/fluentd-lock-*is cleaned up while Fluentd is running:At least, RHEL 8 has the following default conf for tmpfiles.d:
/usr/lib/tmpfiles.d/tmp.conf
This can delete directories under
/tmpif they are not used for more than 10 days.We don't need to protect the old lock files under
/tmp/fluentd-lock-*/, so useXinstead ofx.In configs where lock files are not used, there is no problem even if this directory is deleted.
In configurations that do use lock files, it’s unlikely that this directory would not be updated for more than 10 days. Therefore, the cases where this actually becomes an issue should be quite limited. If only out_secondary_file uses lock files, this can become an issue.