puppet-logrotate icon indicating copy to clipboard operation
puppet-logrotate copied to clipboard

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

Open gregswift opened this issue 11 years ago • 3 comments
trafficstars

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 avatar Apr 03 '14 20:04 gregswift

PR 15 should address this

gregswift avatar Apr 03 '14 20:04 gregswift

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.

gregswift avatar Apr 03 '14 20:04 gregswift

+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.

scottsb avatar Oct 10 '14 16:10 scottsb