I am running Freeradius 0.9 and I am writing accounting records to an
Oracle DB ver 8i. If the Database goes down, the Freeradius gives a
segmentation fault error and dies. I've tried also to point to another
database as a fail-over option, but the same results were encountered. 


My configuration looks like this:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>

Radiusd.conf

accounting {
        detail
          redundant {
                        sql2            {
                                        fail     = 1
                                        notfound = return
                                        noop     = return
                                        ok       = return
                                        updated  = return
                                        reject   = return
                                        userlock = return
                                        invalid  = return
                                        handled  = return
                                        }
                        sql2_redundant  {
                                        fail     = 1
                                        notfound = return
                                        noop     = return
                                        ok       = return
                                        updated  = return
                                        reject   = return
                                        userlock = return
                                        invalid  = return
                                        handled  = return
                                        }
                }
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>

oraclesql.conf

sql sql2 {

        driver = "rlm_sql_oracle"

        # Connect info
        server = "xxx.xxx.xxx.001"
        login = "test"
        password = "testpass"
        
        # Database table configuration
        radius_db = "oracle1"
                
          ...
      }

sql sql2_redundant {

        driver = "rlm_sql_oracle"

        # Connect info
        server = "xxx.xxx.xxx.002"
        login = "test"
        password = "testpass"
        
        # Database table configuration
        radius_db = "oracle2"
                
          ...
      }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>

The debug output before accounting DB shutdown :

rad_recv: Accounting-Request packet from host xxx.xxx.xxx.xxx:38499,
id=163, length=79
Sun Aug  3 07:12:01 2003 : Debug: Thread 1 assigned request 0
Sun Aug  3 07:12:01 2003 : Debug: Thread 1 handling request 0, (1
handled so far)
        User-Name = "test"
        NAS-IP-Address = xxx.xxx.xxx.xxx
        NAS-Port = 0
        NAS-Port-Type = Async
        Service-Type = Framed-User
        Framed-Protocol = PPP
        Acct-Session-Id = "379094841"
        Acct-Status-Type = Start
        Acct-Delay-Time = 0
Sun Aug  3 07:12:01 2003 : Debug: modcall: entering group preacct
Sun Aug  3 07:12:01 2003 : Debug:   modcall[preacct]: module
"preprocess" returns noop
Sun Aug  3 07:12:01 2003 : Debug:     rlm_realm: No '@' in User-Name =
"test", looking up realm NULL
Sun Aug  3 07:12:01 2003 : Debug:     rlm_realm: No such realm "NULL"
Sun Aug  3 07:12:01 2003 : Debug:   modcall[preacct]: module "suffix"
returns noop
Sun Aug  3 07:12:01 2003 : Debug:   modcall[preacct]: module "files"
returns noop
Sun Aug  3 07:12:01 2003 : Debug: modcall: group preacct returns noop
Sun Aug  3 07:12:01 2003 : Debug: modcall: entering group accounting
Sun Aug  3 07:12:01 2003 : Debug: radius_xlat:
'/app/experimental/free-0.9/local/var/log/radius/radacct/xxx.xxx.xxx.xxx
/detail-20030803'
Sun Aug  3 07:12:01 2003 : Debug: rlm_detail:
/app/experimental/free-0.9/local/var/log/radius/radacct/%{Client-IP-Addr
ess}/detail-%Y%m%d expands to
/app/experimental/free-0.9/local/var/log/radius/radacct/xxx.xxx.xxx.xxx/
detail-20030803
Sun Aug  3 07:12:01 2003 : Debug: --- Walking the entire request list
---
Sun Aug  3 07:12:01 2003 : Debug: Threads: total/active/spare threads =
5/1/4
Sun Aug  3 07:12:01 2003 : Debug: Waking up in 5 seconds...
Sun Aug  3 07:12:01 2003 : Debug:   modcall[accounting]: module "detail"
returns ok
Sun Aug  3 07:12:01 2003 : Debug: modcall: entering group redundant
Sun Aug  3 07:12:01 2003 : Debug: radius_xlat:  'test'
Sun Aug  3 07:12:01 2003 : Debug: rlm_sql (sql2): sql_set_user escaped
user --> 'test'
Sun Aug  3 07:12:01 2003 : Debug: radius_xlat:  'INSERT into RADACCT
(RadAcctId, AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress,
NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime,
AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets,
AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause,
ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay,
AcctStopDelay) values('', '379094841', '', 'test', '',
'xxx.xxx.xxx.xxx', '0', 'Async', TO_DATE('2003-08-03
07:12:01','yyyy-mm-dd hh24:mi:ss'), '', '0', '', '', '', '0', '0', '',
'', '', 'Framed-User', 'PPP', '', '0', '0')'
Sun Aug  3 07:12:01 2003 : Debug: rlm_sql (sql2): Reserving sql socket
id: 2
Sun Aug  3 07:12:01 2003 : Debug: rlm_sql (sql2): Released sql socket
id: 2
Sun Aug  3 07:12:01 2003 : Debug:   modcall[accounting]: module "sql2"
returns ok
Sun Aug  3 07:12:01 2003 : Debug: modcall: group redundant returns ok
Sun Aug  3 07:12:01 2003 : Debug: modcall: group accounting returns ok
Sending Accounting-Response of id 163 to xxx.xxx.xxx.xxx:38499
Sun Aug  3 07:12:01 2003 : Debug: Finished request 0
Sun Aug  3 07:12:01 2003 : Debug: Going to the next request
Sun Aug  3 07:12:01 2003 : Debug: Thread 1 waiting to be assigned a
request
Sun Aug  3 07:12:06 2003 : Debug: --- Walking the entire request list
---
Sun Aug  3 07:12:06 2003 : Debug: Threads: total/active/spare threads =
5/0/5
Sun Aug  3 07:12:06 2003 : Debug: Waking up in 1 seconds...
Sun Aug  3 07:12:07 2003 : Debug: --- Walking the entire request list
---
Sun Aug  3 07:12:07 2003 : Debug: Cleaning up request 0 ID 163 with
timestamp 3f2c7d81
Sun Aug  3 07:12:07 2003 : Debug: Nothing to do.  Sleeping until we see
a request.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>

The debug output after accounting DB shutdown:

rad_recv: Accounting-Request packet from host xxx.xxx.xxx.xxx:38501,
id=164, length=79
Sun Aug  3 07:12:30 2003 : Debug: Thread 2 assigned request 1
Sun Aug  3 07:12:30 2003 : Debug: --- Walking the entire request list
---
Sun Aug  3 07:12:30 2003 : Debug: Threads: total/active/spare threads =
5/1/4
Sun Aug  3 07:12:30 2003 : Debug: Waking up in 5 seconds...
Sun Aug  3 07:12:30 2003 : Debug: Thread 2 handling request 1, (1
handled so far)
        User-Name = "test"
        NAS-IP-Address = xxx.xxx.xxx.xxx
        NAS-Port = 0
        NAS-Port-Type = Async
        Service-Type = Framed-User
        Framed-Protocol = PPP
        Acct-Session-Id = "379094841"
        Acct-Status-Type = Start
        Acct-Delay-Time = 0
Sun Aug  3 07:12:30 2003 : Debug: modcall: entering group preacct
Sun Aug  3 07:12:30 2003 : Debug:   modcall[preacct]: module
"preprocess" returns noop
Sun Aug  3 07:12:30 2003 : Debug:     rlm_realm: No '@' in User-Name =
"test", looking up realm NULL
Sun Aug  3 07:12:30 2003 : Debug:     rlm_realm: No such realm "NULL"
Sun Aug  3 07:12:30 2003 : Debug:   modcall[preacct]: module "suffix"
returns noop
Sun Aug  3 07:12:30 2003 : Debug:   modcall[preacct]: module "files"
returns noop
Sun Aug  3 07:12:30 2003 : Debug: modcall: group preacct returns noop
Sun Aug  3 07:12:30 2003 : Debug: modcall: entering group accounting
Sun Aug  3 07:12:30 2003 : Debug: radius_xlat:
'/app/experimental/free-0.9/local/var/log/radius/radacct/xxx.xxx.xxx.xxx
/detail-20030803'
Sun Aug  3 07:12:30 2003 : Debug: rlm_detail:
/app/experimental/free-0.9/local/var/log/radius/radacct/%{Client-IP-Addr
ess}/detail-%Y%m%d expands to
/app/experimental/free-0.9/local/var/log/radius/radacct/xxx.xxx.xxx.xxx/
detail-20030803
Sun Aug  3 07:12:30 2003 : Debug:   modcall[accounting]: module "detail"
returns ok
Sun Aug  3 07:12:30 2003 : Debug: modcall: entering group redundant
Sun Aug  3 07:12:30 2003 : Debug: radius_xlat:  'test'
Sun Aug  3 07:12:30 2003 : Debug: rlm_sql (sql2): sql_set_user escaped
user --> 'test'
Sun Aug  3 07:12:30 2003 : Debug: radius_xlat:  'INSERT into RADACCT
(RadAcctId, AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress,
NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime,
AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets,
AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause,
ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay,
AcctStopDelay) values('', '379094841', '', 'test', '',
'xxx.xxx.xxx.xxx', '0', 'Async', TO_DATE('2003-08-03
07:12:30','yyyy-mm-dd hh24:mi:ss'), '', '0', '', '', '', '0', '0', '',
'', '', 'Framed-User', 'PPP', '', '0', '0')'
Sun Aug  3 07:12:30 2003 : Debug: rlm_sql (sql2): Reserving sql socket
id: 1
Sun Aug  3 07:12:30 2003 : Error: rlm_sql_oracle: execute query failed
in sql_query: ORA-03113: end-of-file on communication channel 
Sun Aug  3 07:12:30 2003 : Debug: rlm_sql (sql2): Attempting to connect
rlm_sql_oracle #1
Sun Aug  3 07:12:30 2003 : Debug: rl_next:  returning NULL
Sun Aug  3 07:12:30 2003 : Debug: Waking up in 5 seconds...
Sun Aug  3 07:12:30 2003 : Error: rlm_sql_oracle: Oracle logon failed:
'ORA-01034: ORACLE not available ORA-27101: shared memory realm does not
exist SVR4 Error: 2: No such file or directory '
Sun Aug  3 07:12:30 2003 : Error: rlm_sql (sql2): Failed to connect DB
handle #1
Sun Aug  3 07:12:30 2003 : Error: rlm_sql (sql2): reconnect failed,
database down?
Segmentation Fault


Can anyone help in this regard?

Regards

Yasser Ahmed Hosny


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

Reply via email to