Sockets disconected from DB. How reconect it?

2003-01-29 Thread Yurguen Castillo
Using Freeradius 0.8.1 and validating users using Sybase driver work fine
for us; but if for some reason we lost connection to the DB, or the DB
server is restarted we can't continue validating using the DB until radiusd
is restarted and new sockets are open again.

Is there any way to do a new connection to the DB (open new sockets) in
case that the DB is restarted? or check the connection before connect to
DB and open new sockets in case we need it?

This is the debug of the fail when freeradius lost connection to DB:

  rlm_sql (sql): Reserving sql socket id: 3
  SELECT 1,NAME,'User-Password',PASS,'==' FROM names WHERE USER  = 'jon'
  Client Library error:
  severity(0) number(6) origin(3) layer(5)
  ct_results(): network packet layer: internal net library error:
Net-Library operation terminated due to disconnect
  rlm_sql_sybase(sql_select_query): Failure retrieving query results
  Client Library error:
  severity(0) number(5) origin(3) layer(5)
  ct_cancel(): network packet layer: internal net library error:
Net-Library operation terminated due to disconnect
  rlm_sql_sybase(sql_select_query): cleaning up.
  rlm_sql_getvpdata: database query error
  rlm_sql (sql): SQL query error; rejecting user
  rlm_sql (sql): Released sql socket id: 3
modcall[authorize]: module sql returns fail
  modcall: group authorize returns fail
  There was no response configured: rejecting request 1
  Server rejecting request 1.
  Finished request 1

Some idea about how can I reconnect to the DB without restart radiusd?

Best regards,

   Yurguen
===
Este mensaje y sus anexos son confidenciales y de uso exclusivo
de las personas a las que está dirigido. En caso de que ud.
recibiera éste correo por error no podrá modificar, copiar o
distribuir parte o la totalidad del mismo; asimismo le solicitamos
que notifique tal situación al emisor  y que
que tenga a bien eliminarlo de su sistema.
El emisor no acepta responsabilidades por errores
u omisiones en el contenido de éste correo dado que
Internet no garantiza la seguridad y exactitud de las
comunicaciones.
Las opiniones vertidas en este correo son exclusivas
de su autor y no representan la opinión del Banco Galicia.





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



Using Freeradius with sybase database

2003-01-22 Thread Yurguen Castillo
We are trying to validate RAS users using Freeradius 0.8.1 against our
Sybase 12 database, but we received an error message Segmentation fault.

Our box is a LINUX SuSE 8.0 and we use rlm_sql_sybase driver compiled
using Sybase Openclient OCS 12.5.

If we try to connect directly to sybase database using sql -Sservername
-Uusername we have success.

Validating local users working fine, so we assume that Freeradius is
working.

I'm attaching a copy of the debugging message at the end of the mail and if
you can see it maybe could help.

Thanks for any help that you can send us.

   Yurguen

Starting - reading configuration files ...
reread_config:  reading radiusd.conf
Config:   including file: /etc/raddb/proxy.conf
Config:   including file: /etc/raddb/clients.conf
Config:   including file: /etc/raddb/snmp.conf
Config:   including file: /etc/raddb/sql.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: max_request_time = 30
 main: cleanup_delay = 5
 main: max_requests = 1024
 main: delete_blocked_requests = 0
 main: port = 0
 main: allow_core_dumps = no
 main: log_stripped_names = yes
 main: log_file = /var/log/radius/radius.log
 main: log_auth = yes
 main: log_auth_badpass = yes
 main: log_auth_goodpass = yes
 main: pidfile = /var/run/radiusd/radiusd.pid
 main: user = (null)
 main: group = (null)
 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
 proxy: retry_delay = 5
 proxy: retry_count = 3
 proxy: synchronous = no
 proxy: default_fallback = yes
 proxy: dead_time = 120
 proxy: servers_per_realm = 15
 security: max_attributes = 200
 security: reject_delay = 1
 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
radiusd:  entering modules setup
Module: Library search path is /usr/local/lib
Module: Loaded expr
Module: Instantiated expr (expr)
Module: Loaded PAP
 pap: encryption_scheme = crypt
Module: Instantiated pap (pap)
Module: Loaded CHAP
Module: Instantiated chap (chap)
Module: Loaded MS-CHAP
 mschap: ignore_password = no
 mschap: use_mppe = yes
 mschap: require_encryption = no
 mschap: require_strong = no
 mschap: passwd = (null)
 mschap: authtype = MS-CHAP
Module: Instantiated mschap (mschap)
Module: Loaded SQL
 sql: driver = rlm_sql_sybase
 sql: server = atila
 sql: port = 
 sql: login = egalvgn
 sql: password = egalvgn
 sql: radius_db = hegalicia
 sql: acct_table = radacct
 sql: acct_table2 = radacct
 sql: authcheck_table = radcheck
 sql: authreply_table = radreply
 sql: groupcheck_table = radgroupcheck
 sql: groupreply_table = radgroupreply
 sql: usergroup_table = usergroup
 sql: nas_table = nas
 sql: dict_table = dictionary
 sql: sqltrace = no
 sql: sqltracefile = /var/log/radius/sqltrace.sql
 sql: deletestalesessions = yes
 sql: num_sql_socks = 5
 sql: sql_user_name = %{User-Name}
 sql: default_user_profile = 
 sql: query_on_not_found = no
 sql: authorize_check_query = SELECT id,UserName,Attribute,Value,op FROM
radcheck WHERE Username = '%{SQL-User-Name}' ORDER BY id
 sql: authorize_reply_query = SELECT id,UserName,Attribute,Value,op FROM
radreply WHERE Username = '%{SQL-User-Name}' ORDER BY id
 sql: authorize_group_check_query = SELECT
radgroupcheck.id,radgroupcheck.GroupName,radgroupcheck.Attribute,radgroupcheck.Value,radgroupcheck.op

 FROM radgroupcheck,usergroup WHERE usergroup.Username = '%{SQL-User-Name}'
AND usergroup.GroupName = radgroupcheck.GroupName ORDER BY
radgroupcheck.id
 sql: authorize_group_reply_query = SELECT
radgroupreply.id,radgroupreply.GroupName,radgroupreply.Attribute,radgroupreply.Value,radgroupreply.op

 FROM radgroupreply,usergroup WHERE usergroup.Username = '%{SQL-User-Name}'
AND usergroup.GroupName = radgroupreply.GroupName ORDER BY
radgroupreply.id
 sql: accounting_onoff_query = UPDATE radacct SET AcctStopTime='%S',
AcctSessionTime=unix_timestamp('%S') - unix_timestamp(AcctStartTime),
AcctTerminateCause='%{Acct-Terminate-Cause}', AcctStopDelay
= %{Acct-Delay-Time} WHERE AcctSessionTime=0 AND AcctStopTime=0 AND
NASIPAddress= '%{NAS-IP-Address}' AND AcctStartTime = '%S'
 sql: accounting_update_query = UPDATE radacct SET FramedIPAddress
= '%{Framed-IP-Address}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND
UserName = '%{SQL-User-Name}' AND NASIPAddress= '%{NAS-IP-Address}' AND
AcctStopTime = 0
 sql: accounting_start_query = 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,