lists.freeradius.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview
thread

Abu

Nadir Aliyev

13 Mar 2014 13 Mar '14
3:32 a.m.

Hello, I use rlm_sql module and have problems with stale sessions. Sometimes users (more than 4k-5k) disconnects without accounting_stop_query and they can't connect again because session is not closed by normal way and session still active in database. My accounting time is 45 minutes, if new alive-update packets not coming for user from NAS side I close this session manually with a little script. After this process (after 45 minute) user can connects again. I used stale_sessions but it not helped. In my case I want to close for user existing staled session in database if new accounting_start_query (insert query) occurs. How can i realize this? accounting_start_query = "INSERT into ${acct_table1} \ (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctAuthentic, \ ConnectInfo_start, CalledStationId, CallingStationId, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, XAscendSessionSvrKey, mac_address, agent, vlan) \ values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', \ '%{NAS-Port}', '%{NAS-Port-Type}', ('%S'::timestamp - '%{%{Acct-Delay-Time}:-0}'::interval), '%{Acct-Authentic}', '%{Connect-Info}', \ '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}', \ NULLIF('%{Framed-IP-Address}', '')::inet, 0, '%{X-Ascend-Session-Svr-Key}', \ (case when length('%{client-mac-address}')>0 then '%{client-mac-address}' else '%{Calling-Station-Id}' end), \ (case when '%{NAS-IP-Address}' = '10.10.10.10' then '%{Nas-Port-Id}' else '%{circuit-id-tag}' end), \ '%{Nas-Port-Id}')" accounting_start_query_alt = "UPDATE ${acct_table1} \ SET AcctStartTime = ('%S'::timestamp - '%{Acct-Delay-Time:-0}'::interval), AcctStartDelay = 0, \ ConnectInfo_start = '%{Connect-Info}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' \ AND NASIPAddress = '%{NAS-IP-Address}' AND AcctStopTime IS NULL" Thanks! Nadir

Attachments:

  • attachment.html (text/html — 3.4 KB)
0 0
Reply
Sign in to reply online Use email software

Back to the thread

Back to the list

HyperKitty Powered by HyperKitty version 1.3.12.