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

in_unix plugin does not work without supervisor (permission denied with var/run/td-agent/td-agent.sock) #2984

Closed
qingling128 opened this issue May 8, 2020 · 2 comments · Fixed by #2987
Labels
bug Something isn't working

Comments

@qingling128
Copy link

Check CONTRIBUTING guideline first and here is the list to help us investigate the problem.

Describe the bug
We we run Fluentd without the supervisor mode (in order to save some memory), the in_unix plugin no longer works because chumask is not set without the supervisor mode and there is a permission denied error with var/run/td-agent/td-agent.sock.

$ ls -l /var/run/google-fluentd/google-fluentd.sock
srwxr-xr-x 1 root root 0 Jan 14 04:28 /var/run/google-fluentd/google-fluentd.sock

To Reproduce

  1. Add this configuration
<source>
  @type unix
  path /var/run/google-fluentd/google-fluentd.sock
</source>
  1. Start Fluentd without supervisor
  2. The generated /var/run/google-fluentd/google-fluentd.sock file can not be written:
$ ls -l /var/run/google-fluentd/google-fluentd.sock
srwxr-xr-x 1 root root 0 Jan 14 04:28 /var/run/google-fluentd/google-fluentd.sock

Expected behavior
The permission should be srwxrwxrwx.

Your Environment

  • Fluentd or td-agent version:
$ gem list | grep  fluentd
fluentd (1.7.4)
  • Operating system:
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.4 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

Additional context

It seems like that for standalone worker mode, we are setting chuser and chgroup, but not chumask.

ServerEngine::Privilege.change(@chuser, @chgroup) if @standalone_worker

@repeatedly
Copy link
Member

Here is simple patch: #2987

@qingling128
Copy link
Author

Thanks @repeatedly ! Looking forward to the fix.

repeatedly added a commit that referenced this issue May 12, 2020
supervisor: Call File.umask for standalone worker. fix #2984
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants