fluent / fluent/fluent-package-builder

fluent-package logrotate configuration causes logrotate failure if fluentd has never run

Open
#796 6 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Shell
Stars
25
Forks
29
Avg merge
12h 20m
Merged PRs (30d)
3

Description

`fluent-package` ships a logrotate configuration on a log file that is not guaranteed to exist.
```
$ cat /etc/logrotate.d/fluentd
/var/log/fluent/fluentd.log {
daily
rotate 30
compress
delaycompress
notifempty
create 640 _fluentd _fluentd
sharedscripts
postrotate
pid=/var/run/fluent/fluentd.pid
if [ -s "$pid" ]
then
kill -USR1 "$(cat $pid)"
fi
endscript
}
```
This can cause invocations of `logrotate` to fail with:
```
$ sudo logrotate /etc/logrotate.conf
error: stat of /var/log/fluent/fluentd.log failed: No such file or directory.
```

While not having fluentd running may not be a common scenario, I do believe this to be a bug in the package.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.