Modernise logrotate configuration files and use copytruncate for the main server...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 23 Jan 2015 17:46:37 +0000 (00:46 +0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 23 Jan 2015 17:47:19 +0000 (00:47 +0700)
debian/freeradius.logrotate
redhat/radiusd-logrotate
scripts/logrotate/freeradius
suse/radiusd-logrotate

index 1be995a..3c007cd 100644 (file)
@@ -1,7 +1,51 @@
-/var/log/freeradius/*.log {
-        weekly
-        rotate 52
-        compress
-        notifempty
+# You can use this to rotate the /var/log/radius/* files, simply copy
+# it to /etc/logrotate.d/radiusd
+
+#
+#    Global options for all logfiles
+#
+daily
+rotate 52
+missingok
+compress
+delaycompress
+notifempty
+
+#
+#  The main server log
+#
+/var/log/radius/radius.log {
+       copytruncate
 }
 
+#
+#  Session monitoring utilities
+#
+/var/log/radius/checkrad.log /var/log/radius/radwatch.log {
+       nocreate
+}
+
+#
+#  Session database modules
+#
+/var/log/radius/radutmp /var/log/radius/radwtmp {
+       nocreate
+}
+
+#
+#  SQL log files
+#
+/var/log/radius/sqllog.sql {
+       nocreate
+}
+
+# There are different detail-rotating strategies you can use.  One is
+# to write to a single detail file per IP and use the rotate config
+# below.  Another is to write to a daily detail file per IP with:
+#     detailfile = ${radacctdir}/%{Client-IP-Address}/%Y%m%d-detail
+# (or similar) in radiusd.conf, without rotation.  If you go with the
+# second technique, you will need another cron job that removes old
+# detail files.  You do not need to comment out the below for method #2.
+/var/log/radius/radacct/*/detail {
+       nocreate
+}
index 843f641..d50be2b 100644 (file)
@@ -1,6 +1,43 @@
 # You can use this to rotate the /var/log/radius/* files, simply copy
 # it to /etc/logrotate.d/radiusd
 
+#
+#    Global options for all logfiles
+#
+daily
+rotate 28
+missingok
+compress
+delaycompress
+
+#
+#  The main server log
+#
+/var/log/radius/radius.log {
+       copytruncate
+}
+
+#
+#  Session monitoring utilities
+#
+/var/log/radius/checkrad.log /var/log/radius/radwatch.log {
+       nocreate
+}
+
+#
+#  Session database modules
+#
+/var/log/radius/radutmp /var/log/radius/radwtmp {
+       nocreate
+}
+
+#
+#  SQL log files
+#
+/var/log/radius/sqllog.sql {
+       nocreate
+}
+
 # There are different detail-rotating strategies you can use.  One is
 # to write to a single detail file per IP and use the rotate config
 # below.  Another is to write to a daily detail file per IP with:
@@ -9,48 +46,5 @@
 # second technique, you will need another cron job that removes old
 # detail files.  You do not need to comment out the below for method #2.
 /var/log/radius/radacct/*/detail {
-       monthly
-       rotate 4
        nocreate
-       missingok
-       compress
-}
-
-/var/log/radius/checkrad.log {
-       monthly
-       rotate 4
-       create
-       missingok
-       compress
-}
-
-/var/log/radius/radius.log {
-       monthly
-       rotate 4
-       create
-       missingok
-       compress
-}
-
-/var/log/radius/radutmp {
-       monthly
-       rotate 4
-       create
-       compress
-       missingok
-}
-
-/var/log/radius/radwtmp {
-       monthly
-       rotate 4
-       create
-       compress
-       missingok
-}
-/var/log/radius/sqllog.sql {
-        monthly
-        rotate 4
-        create
-        compress
-        missingok
 }
index 8bb9280..cbeeb5f 100644 (file)
@@ -1,16 +1,54 @@
 #
-#  Sample logrotate file for FreeRADIUS.
+#  Sample logrotate file for FreeRADIUS
 #
-#  It needs to be edited for your local configuration.
+#  You can use this to rotate the /var/log/radius/* files, simply copy it to /etc/logrotate.d/radiusd
+#
+
+#
+#    Global options for all files
+#
+daily
+rotate 14
+missingok
+compress
+delaycompress
+notifempty
+
+#
+#  The main server log
 #
 /var/log/radius/radius.log {
-       daily
-       rotate 14
-       compress
-       delaycompress
-       missingok
-       notifempty
-       postrotate
-               kill -HUP `cat /var/run/radiusd.pid` > /dev/null 2>&1
-       endscript
+       copytruncate
+}
+
+#
+#  Session monitoring utilities
+#
+/var/log/radius/checkrad.log /var/log/radius/radwatch.log {
+       nocreate
+}
+
+#
+#  Session database modules
+#
+/var/log/radius/radutmp /var/log/radius/radwtmp {
+       nocreate
+}
+
+#
+#  SQL log files
+#
+/var/log/radius/sqllog.sql {
+       nocreate
+}
+
+# There are different detail-rotating strategies you can use.  One is
+# to write to a single detail file per IP and use the rotate config
+# below.  Another is to write to a daily detail file per IP with:
+#     detailfile = ${radacctdir}/%{Client-IP-Address}/%Y%m%d-detail
+# (or similar) in radiusd.conf, without rotation.  If you go with the
+# second technique, you will need another cron job that removes old
+# detail files.  You do not need to comment out the below for method #2.
+/var/log/radius/radacct/*/detail {
+       nocreate
 }
index f2b3911..b72267b 100644 (file)
@@ -1,63 +1,56 @@
-# There are different detail-rotating strategies you can use.  One is
-# to write to a single detail file per IP and use the rotate config
-# below.  Another is to write to a daily detail file per IP with:
-#     detailfile = ${radacctdir}/%{Client-IP-Address}/%Y%m%d-detail
-# (or similar) in radiusd.conf, without rotation.  If you go with the
-# second technique, you will need another cron job that removes old
-# detail files.  You do not need to comment out the below for method #2.
-/var/log/radius/radacct/*/detail {
-    compress
-    dateext
-    maxage 365
-    rotate 99
-    size=+1024k
-    notifempty
-    missingok
-}
+# You can use this to rotate the /var/log/radius/* files, simply copy
+# it to /etc/logrotate.d/radiusd
 
+#
+#    Global options for all files
+#
+dateext
+maxage 365
+rotate 99
+missingok
+compress
+delaycompress
+notifempty
+
+#
+#  The main server log
+#
 /var/log/radius/radius.log {
-    compress
-    dateext
-    maxage 365
-    rotate 99
-    size=+1024k
-    notifempty
-    missingok
-    create
-    postrotate
-       kill -HUP `cat /var/run/radiusd/radiusd.pid`
-    endscript
+       copytruncate
 }
 
-/var/log/radius/radwatch.log {
-    compress
-    dateext
-    maxage 365
-    rotate 99
-    size=+1024k
-    notifempty
-    missingok
-    copytruncate
+#
+#  Session monitoring utilities
+#
+/var/log/radius/checkrad.log /var/log/radius/radwatch.log {
+       nocreate
+       size=+1024k
 }
 
-/var/log/radius/radwtmp {
-    compress
-    dateext
-    maxage 365
-    rotate 99
-    size=+2048k
-    notifempty
-    missingok
-    create
+#
+#  Session database modules
+#
+/var/log/radius/radutmp /var/log/radius/radwtmp {
+       nocreate
+       size=+2048k
 }
 
+#
+#  SQL log files
+#
 /var/log/radius/sqllog.sql {
-    compress
-    dateext
-    maxage 365
-    rotate 99
-    size=+2048k
-    notifempty
-    missingok
-    create
+       nocreate
+       size=+2048k
 }
+
+# There are different detail-rotating strategies you can use.  One is
+# to write to a single detail file per IP and use the rotate config
+# below.  Another is to write to a daily detail file per IP with:
+#     detailfile = ${radacctdir}/%{Client-IP-Address}/%Y%m%d-detail
+# (or similar) in radiusd.conf, without rotation.  If you go with the
+# second technique, you will need another cron job that removes old
+# detail files.  You do not need to comment out the below for method #2.
+/var/log/radius/radacct/*/detail {
+       nocreate
+}
+