Log Rotation

barry steyn jack.j.allan at gmail.com
Fri May 18 12:13:44 CEST 2007


I'm trying to use newsyslog on FreeBSD 6.2/freeradius-1.1.6 to rotate my log
files an ensure I will never exceed a certain logfile size. My
newsyslog.conf file says

/var/log/radius/radius.log              barry:admin     640  10    10000
*    J    /var/run/radiusd/radiusd.pid
/var/log/radius/*tmp                    barry:admin     600  10    10000
*    JBG
/var/log/radius/sqltrace.sql            barry:admin     640  10    10000
*    J
/var/log/radius/radacct/*/*             barry:admin     640  10    10000
*    JG

Now in my particular case when newsyslog runs from cron it finds that
radius.log, sqltrace.sql and one of the radacct/*/* files have exceeded
their filesize, so it renames them (*.log.n), touches a new file, in the
case of radius.log sends a SIGHUP to radiusd and then proceeds to bzip the
renamed logfiles. As you would expect.

The problem is that when radiusd is running normally it starts to chew up
98% CPU from this point onwards and completely stops responding to
accounting packets. I have to killall -9 radiusd, it won't even respond to
my SIGTERM. Running in debug mode unfortunately just causes radiusd to
segfault a few seconds after the log rotation (see output below).

What could be the problem? Does freeradius actually close and reopen its log
files when receiving SIGHUP? I can't find any documentation on other
signals... :-(

radiusd: FreeRADIUS Version 1.1.6, for host i386-portbld-freebsd6.2, built
on May 13 2007 at 22:44:09

radiusd -X output

(...)
Sending Accounting-Response of id 223 to 165.145.226.12 port 3799
Finished request 4
Going to the next request
--- Walking the entire request list ---
Cleaning up request 4 ID 223 with timestamp 464cddb9
Nothing to do.  Sleeping until we see a request.
--- Walking the entire request list ---
Nothing to do.  Sleeping until we see a request.
Reloading configuration files.
reread_config:  reading radiusd.conf
Config:   including file: /usr/local/etc/raddb/clients.conf
Config:   including file: /usr/local/etc/raddb/postgresql.conf
 main: prefix = "/usr/local"
 main: localstatedir = "/var"
 main: logdir = "/var/log/radius"
 main: libdir = "/usr/local/lib"
 main: radacctdir = "/var/log/radius/radacct"
 main: hostname_lookups = no
 main: snmp = no
 main: max_request_time = 30
 main: cleanup_delay = 5
 main: max_requests = 1024
 main: delete_blocked_requests = 0
 main: port = 62515
 main: allow_core_dumps = no
 main: log_stripped_names = no
 main: log_file = "/var/log/radius/radius.log"
 main: log_auth = yes
 main: log_auth_badpass = yes
 main: log_auth_goodpass = no
 main: pidfile = "/var/run/radiusd/radiusd.pid"
 main: user = "barry"
 main: group = "barry"
 main: usercollide = no
 main: lower_user = "no"
 main: lower_pass = "no"
 main: nospace_user = "no"
 main: nospace_pass = "no"
 main: checkrad = "/usr/local/sbin/checkrad"
 main: proxy_requests = no
 security: max_attributes = 20
 security: reject_delay = 2
 security: status_server = no
 main: debug_level = 0
read_config_files:  reading dictionary
read_config_files:  reading naslist
read_config_files:  reading clients
read_config_files:  reading realms
Fri May 18 00:57:01 2007 : Info: rlm_exec: Wait=yes but no output defined.
Did you mean output=none?
Fri May 18 00:57:01 2007 : Error: radiusd.conf[262] Auth-Type PAP already
configured - skipping
Fri May 18 00:57:01 2007 : Info: rlm_sql (auth): Driver rlm_sql_postgresql
(module rlm_sql_postgresql) loaded and linked
Fri May 18 00:57:01 2007 : Info: rlm_sql (auth): Attempting to connect to
radiusd at localhost:/mydb
Fri May 18 00:57:01 2007 : Info: rlm_sql (acct): Driver rlm_sql_postgresql
(module rlm_sql_postgresql) loaded and linked
Fri May 18 00:57:01 2007 : Info: rlm_sql (acct): Attempting to connect to
radiusd at localhost:/mydb
Fri May 18 00:57:01 2007 : Info: Ready to process requests.
Segmentation fault: 11
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20070518/066ec0be/attachment.html>


More information about the Freeradius-Users mailing list