]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
logrotate config file: don't change global logrotate options (#3829)
authorMatthias Gerstner <matthias.gerstner@suse.com>
Thu, 21 Jan 2021 13:48:20 +0000 (14:48 +0100)
committerGitHub <noreply@github.com>
Thu, 21 Jan 2021 13:48:20 +0000 (13:48 +0000)
Global options in files in /etc/logrotate.d/ potentially influence all
other configurations parsed after the "radiusd" configuration file.
Especially the 'su radiusd radiusd' line can break things for other
packages, but also the other settings may lead to surprising behaviour,
depending on the context.

Therefore move global options into the logfile specific blocks, grouping
together equal settings to avoid a high degree of redundance.

scripts/logrotate/freeradius

index 7d846bd749e18c3725edc8ead4faa44b9c93922d..ca3ca604e7be8fa9deaeedf3a369bb5f3eff8bec 100644 (file)
@@ -4,45 +4,32 @@
 #  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
-su radiusd radiusd
-
 #
 #  The main server log
 #
 /var/log/radius/radius.log {
        copytruncate
+       daily
+       rotate 14
+       missingok
+       compress
+       delaycompress
+       notifempty
+       su radiusd radiusd
 }
 
 #
 #  Session monitoring utilities
 #
-/var/log/radius/checkrad.log /var/log/radius/radwatch.log {
-       nocreate
-}
-
+/var/log/radius/checkrad.log /var/log/radius/radwatch.log
 #
-#  Session database modules
+#  SQL log files
 #
-/var/log/radius/radutmp /var/log/radius/radwtmp {
-       nocreate
-}
-
+/var/log/radius/sqllog.sql
 #
-#  SQL log files
+#  Session database modules
 #
-/var/log/radius/sqllog.sql {
-       nocreate
-}
-
+/var/log/radius/radutmp /var/log/radius/radwtmp
 # 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:
@@ -52,4 +39,11 @@ su radiusd radiusd
 # detail files.  You do not need to comment out the below for method #2.
 /var/log/radius/radacct/*/detail {
        nocreate
+       daily
+       rotate 14
+       missingok
+       compress
+       delaycompress
+       notifempty
+       su radiusd radiusd
 }