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

Don't override default logrotate, unless told too, and provide configuration of it #33

Open
gregswift opened this issue Apr 3, 2014 · 3 comments

Comments

@gregswift
Copy link

We just moved to using this module and an unintended consequence was that our default logrotate.conf was overwritten, which changes the expected behavior of existing systems. The default provided is dated and does not match the standard behavior on some newer systems.

I completely understand that some people might want to update the configuration, but it should not be done by default. Or at least it should be done in a configurable manner similar to the .d files.

@gregswift
Copy link
Author

PR 15 should address this

@gregswift
Copy link
Author

Example of what happened to the default logrotate.d on a CentOS 6 box:

--- /etc/logrotate.conf 2007-08-29 07:19:36.000000000 +0000
+++ /tmp/puppet-file20140403-20677-1mkrbut-0    2014-04-03 19:55:58.349216391 +0000
@@ -1,4 +1,7 @@
-# see "man logrotate" for details
+# THIS FILE IS AUTOMATICALLY DISTRIBUTED BY PUPPET.  ANY CHANGES WILL BE
+# OVERWRITTEN.
+
+# Default values
 # rotate log files weekly
 weekly

@@ -8,28 +11,5 @@
 # create new (empty) log files after rotating old ones
 create

-# use date as a suffix of the rotated file
-dateext
-
-# uncomment this if you want your log files compressed
-#compress
-
-# RPM packages drop log rotation information into this directory
+# packages drop log rotation information into this directory
 include /etc/logrotate.d
-
-# no packages own wtmp and btmp -- we'll rotate them here
-/var/log/wtmp {
-    monthly
-    create 0664 root utmp
-   minsize 1M
-    rotate 1
-}
-
-/var/log/btmp {
-    missingok
-    monthly
-    create 0600 root utmp
-    rotate 1
-}
-
-# system-specific logs may be also be configured here.

@scottsb
Copy link

scottsb commented Oct 10, 2014

+1 on this.

FWIW, in the diff above, this is the only functionally different part:

-# use date as a suffix of the rotated file
-dateext

The wtmp and btmp rules are set up by the module through logrotate.d files.

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

2 participants