Re: Freeradius 1.1.7 no DB handles
Hi, I made a change in sql.c now, but do not really understand the problem: function sql_get_socket if (pthread_mutex_trylock(cur-mutex) != 0) { radlog(L_INFO, rlm_sql (%s): goto next %d, inst-config-xlat_name, cur-id); /* goto next; */ } /* else we now have the lock */ The radius inserts accountingdata now into my DB, but this cannot really be a solution. What happens now when there is no socket free? What is the problem of pthread_mutex_trylock()? Any ideas? steven meyer wrote: Everybody can connect, I started mysql even with skip-grants... The mysql-log tells me Connect on radiusLOG when I start radiusd, but nothing else when I login into the switch. A.L.M.Buxey wrote: Hi, I set max_connections to 200, but that didnt help. That cannt really be a reason, because I am the only user by now. My partner gave up on this Problem. But I need to get this thing running! Maybe its the mysql-Version? We run mysql 3.23 on suse 8.1... Any Ideas? can freeradius actually USE the MySQL? ie if you put values into the tables - check values, or username - or even use the naslist, does freeradius show such tables being put to use? ..does the accouting table get filled as you use the system? have you get eg selinux running? if so, check the logs...change it to warn mode instead and check the logs... alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html -- View this message in context: http://www.nabble.com/Freeradius-1.1.7-no-DB-handles-tf4757305.html#a13742563 Sent from the FreeRadius - User mailing list archive at Nabble.com. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: Freeradius 1.1.7 no DB handles
Hey, non-threaded works! Is it a problem of the server or mysql? I don't really know, what non-threaded means. Can I run the server in non-threaded mode or is that just for testing? A.L.M.Buxey wrote: Hi, if (pthread_mutex_trylock(cur-mutex) != 0) { radlog(L_INFO, rlm_sql (%s): goto next %d, inst-config-xlat_name, cur-id); /* goto next; */ } /* else we now have the lock */ The radius inserts accountingdata now into my DB, but this cannot really be a solution. What happens now when there is no socket free? What is the problem of pthread_mutex_trylock()? Any ideas? ouch. looks like your system is having problems with allowing access to a DB handle in a thread. what happens, eg when you run radius in non-threaded mode? alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html -- View this message in context: http://www.nabble.com/Freeradius-1.1.7-no-DB-handles-tf4757305.html#a13743743 Sent from the FreeRadius - User mailing list archive at Nabble.com. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: Freeradius 1.1.7 no DB handles
I set max_connections to 200, but that didnt help. That cannt really be a reason, because I am the only user by now. My partner gave up on this Problem. But I need to get this thing running! Maybe its the mysql-Version? We run mysql 3.23 on suse 8.1... Any Ideas? A.L.M.Buxey wrote: Hi, My DB-tables are empty, just accounting should be put into it. I do not need anything in usergroup for accounting etc, or do I? you are probably running more radius threads than you have DB handles - change the value in sql.conf - and make sure you enable enough max_connections in your mysql (my.cnf) file alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html -- View this message in context: http://www.nabble.com/Freeradius-1.1.7-no-DB-handles-tf4757305.html#a13712775 Sent from the FreeRadius - User mailing list archive at Nabble.com. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: Freeradius 1.1.7 no DB handles
Everybody can connect, I started mysql even with skip-grants... The mysql-log tells me Connect on radiusLOG when I start radiusd, but nothing else when I login into the switch. A.L.M.Buxey wrote: Hi, I set max_connections to 200, but that didnt help. That cannt really be a reason, because I am the only user by now. My partner gave up on this Problem. But I need to get this thing running! Maybe its the mysql-Version? We run mysql 3.23 on suse 8.1... Any Ideas? can freeradius actually USE the MySQL? ie if you put values into the tables - check values, or username - or even use the naslist, does freeradius show such tables being put to use? ..does the accouting table get filled as you use the system? have you get eg selinux running? if so, check the logs...change it to warn mode instead and check the logs... alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html -- View this message in context: http://www.nabble.com/Freeradius-1.1.7-no-DB-handles-tf4757305.html#a13713815 Sent from the FreeRadius - User mailing list archive at Nabble.com. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Freeradius 1.1.7 no DB handles
I have searched now for several weeks, but do not find a solution: Installed freeradius 1.1.7 on suse configured mysql on the same server I can start radiusd fine, I can login into nas, but I want accounting put into mysql and that just does not work. My DB-tables are empty, just accounting should be put into it. I do not need anything in usergroup for accounting etc, or do I? radiusd -X | grep sql : Config: including file: /usr/local/etc/raddb/sql.conf sql: driver = rlm_sql_mysql sql: server = localhost sql: port = sql: login = root sql: password = sql: radius_db = radiusLOG sql: nas_table = nas sql: sqltrace = no sql: sqltracefile = /rzf/protokolle/radiusd/sqltrace.sql sql: readclients = no 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}', AcctSessionTime = '%{Acct-Session-Time}', AcctInputOctets = '%{Acct-Input-Gigawords:-0}' 32 | '%{Acct-Input-Octets:-0}', AcctOutputOctets= '%{Acct-Output-Gigawords:-0}' 32 | '%{Acct-Output-Octets:-0}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName= '%{SQL-User-Name}' AND NASIPAddress= '%{NAS-IP-Address}' sql: accounting_update_query_alt =INSERT INTO radacct (AcctSessionId,AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctSessionTime, AcctAuthentic,ConnectInfo_start, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, XAscendSessionSvrKey) VALUES ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', DATE_SUB('%S', INTERVAL (%{Acct-Session-Time:-0} + %{Acct-Delay-Time:-0}) SECOND), '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{Acct-Input-Gigawords: -0}' 32 | '%{Acct-Input-Octets:-0}', '%{Acct-Output-Gigawords:-0}' 32 | '%{Acct-Output-Octets:-0}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', '%{X-Ascend-Session-Svr-Key}') sql: accounting_start_query =INSERT INTO radacct (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, XAscendSessionSvrKey) VALUES ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', '%S', '0', '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}',