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

logrotate config file invalid file mode in RPM #3490

Closed
m1keil opened this issue Jun 23, 2015 · 3 comments
Closed

logrotate config file invalid file mode in RPM #3490

m1keil opened this issue Jun 23, 2015 · 3 comments
Assignees

Comments

@m1keil
Copy link

m1keil commented Jun 23, 2015

Hey,
This was tested under 1.5.0 and 1.5.1 RPM package and CentOS 7:

[vagrant@localhost ~]$ ll /etc/logrotate.d/
total 20
-rw-rw-r--. 1 root root 156 Jun 15 08:33 logstash
-rw-r--r--. 1 root root 136 Jun 10  2014 ppp
-rw-r--r--. 1 root root 210 Mar 26  2014 syslog
-rw-r--r--. 1 root root 100 Jun  9  2014 wpa_supplicant
-rw-r--r--. 1 root root 100 Jun 27  2014 yum
[vagrant@localhost ~]$ sudo logrotate -d /etc/logrotate.d/logstash
Ignoring /etc/logrotate.d/logstash because of bad file mode.

Handling 0 logs

fixing file mode:

[vagrant@localhost ~]$ sudo chmod 644 /etc/logrotate.d/logstash
[vagrant@localhost ~]$ sudo logrotate -d /etc/logrotate.d/logstash
reading config file /etc/logrotate.d/logstash

Handling 1 logs

rotating pattern: /var/log/logstash/*.log  after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/logstash/*.log
  log /var/log/logstash/*.log does not exist -- skipping

basically Iogstash's own log file rotation doesn't work out of the box.

@alanivey
Copy link

👍

Ran into this with both 1.5.1 and 1.5.3. Here's my persisting workaround:

yum -y -q install yum-plugin-post-transaction-actions

cat > /etc/yum/post-actions/logstash.action <<EOF
logstash:install:/bin/chmod --quiet 0644 /etc/logrotate.d/logstash
logstash:update:/bin/chmod --quiet 0644 /etc/logrotate.d/logstash
EOF

@alanivey
Copy link

Looks like logrotate.conf already has the correct permissions after a fresh git clone. My suspicion is the umask of the packaging user perhaps?

untergeek added a commit to untergeek/logstash that referenced this issue Nov 3, 2015
In some cases it seems that the file permissions for the logrotate
configuration file are not set properly.  This should address those
cases.

fixes elastic#3490
untergeek added a commit that referenced this issue Nov 4, 2015
In some cases it seems that the file permissions for the logrotate
configuration file are not set properly.  This should address those
cases.

fixes #3490

Fixes #4135
@m1keil
Copy link
Author

m1keil commented Nov 4, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants