It appears that rlm_sql_postgresql (or rlm_sql) is core dumping at odd 
intervals)... I am yet to determine exactly when/why... The bottom of this 
message contains a debug log from radiusd...    

This is causing radwatch to restart radius very frequently, and it's causing 
a ~5-10 second delay in authentication when the server dies.

I am running the CVS snapshot as of yesterday (20011218).  I upgraded from 
the standard release hoping to fix the problem.

If anyone can help with this it would be much appreciated....

On a smiliar note, the other thing I did notice was that rlm_sql_postgres was 
incorrectly reporting that the connection to the database had failed when 
indeed it didn't.  This problem was overcome by changing the following line 
of code (from src/modules/rlm_sql/drivers/sql_postgresql.c):

if (PQstatus(sqlsocket->conn) == CONNECTION_BAD) {

to 

if (PQstatus(pg_sock->conn) == CONNECTION_BAD) { 

the lines of code above it are:

      sqlsocket->conn = (rlm_sql_postgres_sock 
*)rad_malloc(sizeof(rlm_sql_postgres_sock));
 
        pg_sock = sqlsocket->conn;
 
        snprintf(connstring, sizeof(connstring),
                        "dbname=%s%s%s%s%s user=%s password=%s",
                        config->sql_db, host, config->sql_server,
                        port, config->sql_port,
                        config->sql_login, config->sql_password);
        pg_sock->row=NULL;
        pg_sock->result=NULL;
        pg_sock->conn=PQconnectdb(connstring);

which is suggesting to me that sqlsocket->conn is not the actual connection, 
but pg_sock is..  does that make sense?  anyway the change above has fixed 
the incorrect error reporting.   

=== debug log follows ===

root@waterfall> /usr/local/sbin/radiusd -f -x
Starting - reading configuration files ...
Module: Loaded SQL
rlm_sql: Driver rlm_sql_postgresql loaded and linked
rlm_sql: Attempting to connect to RADIUS-DATABASE
rlm_sql:  Connected new DB handle, #0
rlm_sql:  Connected new DB handle, #1
rlm_sql:  Connected new DB handle, #2
rlm_sql:  Connected new DB handle, #3
Module: Instantiated sql (sql)
Module: Loaded preprocess
Module: Instantiated preprocess (preprocess)
Module: Loaded realm
Module: Instantiated realm (suffix)
Module: Loaded files
Module: Instantiated files (files)
Module: Loaded detail
Module: Instantiated detail (detail)
Module: Loaded System
Module: Instantiated unix (unix)
Module: Loaded radutmp
Module: Instantiated radutmp (radutmp)
Initializing the thread pool...
Listening on IP address *, ports 1812/udp and 1813/udp, with proxy on 
1814/udp.
Ready to process requests.
rad_recv: Access-Request packet from host ROUTER-IP:1645, id=225, 
length=80
        NAS-IP-Address = ROUTER-IP
        NAS-Port = 18
        NAS-Port-Type = Virtual
        User-Name = "router"
        Calling-Station-Id = "SERVER-IP"
        Password = "\010\225\247\035I\0231v\307\200\264\341ygH\212"
rlm_sql: Reserving sql socket id: 3
query: SELECT id,UserName,Attribute,Value FROM radcheck WHERE Username = 
'router' ORDER BY id
rlm_postgresql Status: PGRES_TUPLES_OK
sql_postgresql: affected rows =
query: SELECT 
radgroupcheck.id,radgroupcheck.GroupName,radgroupcheck.Attribute,radgroupcheck.Value 
FROM radgroupcheck,usergroup WHERE usergroup.Username = 'router' AND 
usergroup.GroupName = radgroupcheck.GroupName ORDER BY radgroupcheck.id
rlm_postgresql Status: PGRES_TUPLES_OK
sql_postgresql: affected rows =
query: SELECT id,UserName,Attribute,Value FROM radreply WHERE Username = 
'router' ORDER BY id
rlm_postgresql Status: PGRES_TUPLES_OK
sql_postgresql: affected rows =
query: SELECT 
radgroupreply.id,radgroupreply.GroupName,radgroupreply.Attribute,radgroupreply.Value 
FROM radgroupreply,usergroup WHERE usergroup.Username = 'router' AND 
usergroup.GroupName = radgroupreply.GroupName ORDER BY radgroupreply.id
rlm_postgresql Status: PGRES_TUPLES_OK
sql_postgresql: affected rows =
rlm_sql: Released sql socket id: 3
Login OK: [router] (from nas as2 port 18 cli SERVER-IP)
Sending Access-Accept of id 225 to ROUTER-IP:1645
        Service-Type = Login-User
        Cisco-AVPair = "shell:priv-lvl=15"
rad_recv: Access-Request packet from host ROUTER-IP:1645, id=226, 
length=80
        NAS-IP-Address = ROUTER-IP
        NAS-Port = 18
        NAS-Port-Type = Virtual
        User-Name = "router"
        Calling-Station-Id = SERVER-IP"
        Password = "\023{\345_\034\r\311\353\326\023ON\027\nS\243"
rlm_sql: Reserving sql socket id: 3
query: SELECT id,UserName,Attribute,Value FROM radcheck WHERE Username = 
'router' ORDER BY id
rlm_postgresql Status: PGRES_TUPLES_OK
sql_postgresql: affected rows =
Segmentation fault


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to