From: Matthew Newton Date: Wed, 16 Jun 2021 10:43:23 +0000 (+0100) Subject: logrotate: keep options in local scope X-Git-Tag: release_3_0_24~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2af8a9328a3504b8d83f5668487609d1d8c3b6c;p=thirdparty%2Ffreeradius-server.git logrotate: keep options in local scope make all configs more consistent --- diff --git a/debian/freeradius.logrotate b/debian/freeradius.logrotate index a8d29b7adf8..28cbf15e5c8 100644 --- a/debian/freeradius.logrotate +++ b/debian/freeradius.logrotate @@ -1,51 +1,59 @@ +# # The main server log +# /var/log/freeradius/radius.log { - # common options + # Common options daily rotate 14 missingok compress delaycompress notifempty + su freerad freerad copytruncate - su freerad freerad } -# (in order) -# Session monitoring utilities -# SQL log files + +# +# Session monitoring utilities and SQL log files (in order) +# /var/log/freeradius/checkrad.log /var/log/freeradius/radwatch.log /var/log/freeradius/sqllog.sql { - # common options + # Common options daily rotate 14 missingok compress delaycompress notifempty + su freerad freerad nocreate - su freerad freerad } -# 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: + +# +# 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. +# +# (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/freeradius/radacct/*/detail { - # common options + # Common options daily rotate 14 missingok compress delaycompress notifempty + su freerad freerad nocreate - su freerad freerad } diff --git a/redhat/freeradius-logrotate b/redhat/freeradius-logrotate index bb97ca55478..776780603ed 100644 --- a/redhat/freeradius-logrotate +++ b/redhat/freeradius-logrotate @@ -1,44 +1,61 @@ -# You can use this to rotate the /var/log/radius/* files, simply copy -# it to /etc/logrotate.d/radiusd - # -# Global options for all logfiles +# You can use this to rotate the /var/log/radius/* files, simply copy +# it to /etc/logrotate.d/radiusd # -monthly -rotate 4 -missingok -compress -delaycompress -su radiusd radiusd # # The main server log # /var/log/radius/radius.log { + # Common options + monthly + rotate 4 + missingok + compress + delaycompress + su radiusd radiusd + copytruncate } + # -# Session monitoring utilities -# -/var/log/radius/checkrad.log /var/log/radius/radwatch.log { +# Session monitoring utilities and SQL log files (in order) +# +/var/log/radius/checkrad.log /var/log/radius/radwatch.log +/var/log/radius/sqllog.sql +{ + # Common options + monthly + rotate 4 + missingok + compress + delaycompress + su radiusd radiusd + nocreate } + # -# SQL log files +# 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: # -/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. +# +# (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 { + # Common options + monthly + rotate 4 + missingok + compress + delaycompress + su radiusd radiusd + nocreate } diff --git a/suse/radiusd-logrotate b/suse/radiusd-logrotate index be5a797684c..5ebfcf3295a 100644 --- a/suse/radiusd-logrotate +++ b/suse/radiusd-logrotate @@ -1,49 +1,68 @@ -# You can use this to rotate the /var/log/radius/* files, simply copy -# it to /etc/logrotate.d/radiusd - # -# Global options for all files +# You can use this to rotate the /var/log/radius/* files, simply copy +# it to /etc/logrotate.d/radiusd # -dateext -maxage 365 -rotate 99 -missingok -compress -delaycompress -notifempty -su radiusd radiusd # # The main server log # /var/log/radius/radius.log { + # Common options + dateext + maxage 365 + rotate 99 + missingok + compress + delaycompress + notifempty + su radiusd radiusd + copytruncate } -# -# Session monitoring utilities -# -/var/log/radius/checkrad.log /var/log/radius/radwatch.log { - nocreate - size=+1024k -} # -# SQL log files +# Session monitoring utilities and SQL log files (in order) # -/var/log/radius/sqllog.sql { +/var/log/radius/checkrad.log /var/log/radius/radwatch.log +/var/log/radius/sqllog.sql +{ + # Common options + dateext + maxage 365 + rotate 99 + missingok + compress + delaycompress + notifempty + su radiusd radiusd + 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: + +# +# 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. +# +# (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 { + # Common options + dateext + maxage 365 + rotate 99 + missingok + compress + delaycompress + notifempty + su radiusd radiusd + nocreate } -