-
Notifications
You must be signed in to change notification settings - Fork 30
tmpfiles.d: ensure tmp dir for lock files not be cleaned up #921
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
Merged
Watson1978
merged 1 commit into
fluent:master
from
daipom:ensure-the-tmp-dir-for-lockfiles-is-not-cleaned-up-by-tmpfiles.d
Oct 3, 2025
Merged
tmpfiles.d: ensure tmp dir for lock files not be cleaned up #921
Watson1978
merged 1 commit into
fluent:master
from
daipom:ensure-the-tmp-dir-for-lockfiles-is-not-cleaned-up-by-tmpfiles.d
Oct 3, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We should exclude `/tmp/fluentd-lock-*` directory.
If `/tmp/fluentd-lock-*` is cleaned up while Fluentd is running:
* out_file can fail flushing.
* out_secondary can fail flushing.
* The supervisor process exit abnormally when Fluentd stops.
At least, RHEL 8 has the following default conf for tmpfiles.d:
/usr/lib/tmpfiles.d/tmp.conf
q /tmp 1777 root root 10d
This can delete directories under `/tmp` if they are not used
for more than 10 days.
We don't need to protect the old lock files under
`/tmp/fluentd-lock-*/`, so use `X` instead of `x`.
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.
Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
d4fbe06 to
c9cb698
Compare
Contributor
Author
|
Tests for tmpfiles have passed. |
Watson1978
approved these changes
Oct 3, 2025
Contributor
Watson1978
left a comment
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.
👍🏻
Watson1978
pushed a commit
that referenced
this pull request
Oct 3, 2025
We should exclude `/tmp/fluentd-lock-*` directory.
If `/tmp/fluentd-lock-*` is cleaned up while Fluentd is running:
* out_file can fail flushing.
* out_secondary can fail flushing.
* The supervisor process exit abnormally when Fluentd stops.
At least, RHEL 8 has the following default conf for tmpfiles.d:
/usr/lib/tmpfiles.d/tmp.conf
q /tmp 1777 root root 10d
This can delete directories under `/tmp` if they are not used for more
than 10 days.
We don't need to protect the old lock files under
`/tmp/fluentd-lock-*/`, so use `X` instead of `x`.
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.
Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Watson1978
pushed a commit
that referenced
this pull request
Oct 3, 2025
We should exclude `/tmp/fluentd-lock-*` directory.
If `/tmp/fluentd-lock-*` is cleaned up while Fluentd is running:
* out_file can fail flushing.
* out_secondary can fail flushing.
* The supervisor process exit abnormally when Fluentd stops.
At least, RHEL 8 has the following default conf for tmpfiles.d:
/usr/lib/tmpfiles.d/tmp.conf
q /tmp 1777 root root 10d
This can delete directories under `/tmp` if they are not used for more
than 10 days.
We don't need to protect the old lock files under
`/tmp/fluentd-lock-*/`, so use `X` instead of `x`.
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.
Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
daipom
added a commit
that referenced
this pull request
Oct 3, 2025
…d up (#921) (#925) Backport #921 We should exclude `/tmp/fluentd-lock-*` directory. If `/tmp/fluentd-lock-*` is cleaned up while Fluentd is running: * out_file can fail flushing. * out_secondary can fail flushing. * The supervisor process exit abnormally when Fluentd stops. At least, RHEL 8 has the following default conf for tmpfiles.d: /usr/lib/tmpfiles.d/tmp.conf q /tmp 1777 root root 10d This can delete directories under `/tmp` if they are not used for more than 10 days. We don't need to protect the old lock files under `/tmp/fluentd-lock-*/`, so use `X` instead of `x`. 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. Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com> Signed-off-by: Shizuo Fujita <fujita@clear-code.com> Co-authored-by: Daijiro Fukuda <fukuda@clear-code.com>
daipom
added a commit
that referenced
this pull request
Oct 3, 2025
…d up (#921) (#924) Backport #921 We should exclude `/tmp/fluentd-lock-*` directory. If `/tmp/fluentd-lock-*` is cleaned up while Fluentd is running: * out_file can fail flushing. * out_secondary can fail flushing. * The supervisor process exit abnormally when Fluentd stops. At least, RHEL 8 has the following default conf for tmpfiles.d: /usr/lib/tmpfiles.d/tmp.conf q /tmp 1777 root root 10d This can delete directories under `/tmp` if they are not used for more than 10 days. We don't need to protect the old lock files under `/tmp/fluentd-lock-*/`, so use `X` instead of `x`. 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. --------- Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com> Signed-off-by: Shizuo Fujita <fujita@clear-code.com> Co-authored-by: Daijiro Fukuda <fukuda@clear-code.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport to v5.0
Need to be backported LTS
backport to v6.0
Need to be backported LTS
backported
Already backported to LTS branch (e.g. fluent-package-v5)
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.
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.