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

Do not use "hourly" directive on logrotate < v3.8.5 #153

Open
rickatnight11 opened this issue Apr 29, 2019 · 0 comments
Open

Do not use "hourly" directive on logrotate < v3.8.5 #153

rickatnight11 opened this issue Apr 29, 2019 · 0 comments

Comments

@rickatnight11
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: All
  • Ruby: All
  • Distribution: CentOS 6 (or anything w/ logrotate < v3.8.5)
  • Module version: 3.4.0

How to reproduce (e.g Puppet code you use)

  1. Add logrotate::rule w/ rotate_every => 'hour' to a system running logrotate < v3.8.5
  2. Puppet lays down the rule, including an hourly directive
  3. Run that config through logrotate

What are you seeing

An error like:

# logrotate -f /etc/logrotate.d/hourly/nginx
error: /etc/logrotate.d/hourly/nginx:9 unknown option 'hourly' -- ignoring line
error: found error in /var/log/nginx.log , skipping

What behaviour did you expect instead

Puppet to not add the hourly directive on a system running an older version of logrotate that does not support the hourly directive.

Output log

n/a

Any additional information you'd like to impart

This affects distros like CentOS 6, which ships with an older logrotate 3.7.8. This is not an issue on CentOS 7, for example, which ships with logrotate 3.8.6. The hourly directive was added in logrotate 3.8.5:

https://github.com/logrotate/logrotate/blob/master/ChangeLog.md#385---2013-06-10

Older systems, like CentOS 6, implement hourly jobs via cron.

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

No branches or pull requests

1 participant