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

Feature pos file permissions #4825

Closed

Conversation

egemenkus
Copy link

Which issue(s) this PR fixes
Fixes #4822

What this PR does / why we need it
This PR adds new configuration options for the tail input plugin to control the pos_file directory permissions and ownership.

New Configuration Options:

  • pos_dir_perm: Sets directory permissions (chmod).
  • pos_dir_owner: Defines the directory owner (chown user).
  • pos_dir_group: Defines the directory group (chown :group).

Example Configuration:

<source>
  @type tail
  pos_file /var/log/td-agent/httpd/file.pos
  pos_dir_perm 0770
  pos_dir_owner 'root'
  pos_dir_group 'wheel'
</source>

Docs Changes:
Documentation updates will be needed to include the new parameters.

Release Note:
Added pos_dir_perm, pos_dir_owner, and pos_dir_group options for better control over pos_file directory permissions.

Before and After Permission Changes:
Before (0700 - Restricted Access)
fluent.conf

Terminal Output:
terminal

After (0770 - Group Access Enabled)
fluent.conf

Terminal Output:
terminal

- Implemented 'umask' option in system config to address fluent#4810.
- Users can now define 'umask' in Fluentd configuration instead of CLI args.
- Improves usability for services and container images by removing reliance on '--umask' argument.

Signed-off-by: kushynoda <egemen.utku3@gmail.com>
This commit adds new configuration options for the tail input plugin
to control the pos_file directory permissions and ownership:

- Add pos_dir_perm parameter for directory permissions
- Add pos_dir_owner parameter for directory owner
- Add pos_dir_group parameter for directory group
- Use Etc.getpwnam and Etc.getgrnam for proper user/group resolution

Example config:
<source>
  @type tail
  pos_file /var/log/td-agent/httpd/file.pos
  pos_dir_perm 0770
  pos_dir_owner 'root'
  pos_dir_group 'wheel'
</source>

Closes fluent#4822

Signed-off-by: kushynoda <egemen.utku3@gmail.com>
@egemenkus egemenkus closed this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set permissions and ownership of parent directories of ".pos" files
1 participant