fluent / fluent/fluentd

in_unix plugin does not work with --under-supervisor (permission denied with var/run/fluent/fluent.sock)

Open
#4,333 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Ruby
Stars
13.6k
Forks
1.4k
Avg merge
1d 3h
Merged PRs (30d)
20

Description

### Describe the bug

We run fluentd without any the command line option(automatically with --under-supervisor). the `in_unix` plugin didn't work because the socket file's permission was insufficient.

```
$ ls -l /var/run/fluent/fluent.sock
srwxr-xr-x 1 _fluentd _fluentd 0 Oct 26 08:27 /var/run/fluent/fluent.sock
```

### To Reproduce

1. Install fluent with the following command
```
# fluent-package 5 (LTS)
curl -fsSL https://toolbelt.treasuredata.com/sh/install-ubuntu-jammy-fluent-package5-lts.sh | sh
```
2. add configuration
```

@type unix
path /var/run/fluent/fluent.sock

```
3. restart fluentd with the following command
```
$ sudo systemctl restart fluentd.service
```
4. The created `/var/run/fluent/fluent.sock` file can not be written
```
$ ls -l /var/run/fluent/fluent.sock
srwxr-xr-x 1 _fluentd _fluentd 0 Oct 26 08:27 /var/run/fluent/fluent.sock
```

### Expected behavior

The permission should be `srwxrwxrwx`.

### Your Environment

```markdown
- Fluentd version:

$ sudo fluent-gem list | grep fluentd
fluentd (1.16.2)
```

- TD Agent version:
- Operating system:
```
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
```

- Kernel version:
```
$ uname -r
6.2.0-1017-gcp
```

### Your Configuration

```apache

@type unix
path /var/run/fluent/fluent.sock

```

### Your Error Log

nothing

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.