On Wed, May 19, 2004 at 01:56:55PM +0200, Michael Markstaller wrote:
> (still) running FreeRADIUS Version 1.0.0-pre0 (Debian-package from
> cvs20040421) with accounting to mysql 3.23.49. 

> Now while testing/checking accounting data validity I came over another
> curious thing ;)
> If no Stop record is ever received/gets lost or whatever, the entry
> remains with AcctStopTime = '' in the radacct-table - ok so far.
> What I look for now is to somehow "close" (rather than delete) these
> sesssion when either some time has passed since the last update and/or a
> new login happens. I think of using the last AcctSessionTime and insert
> the AcctStoptime based on this which would be quite safe if I haven't
> receved any acct-update for let's say 1-2h (checkrad is no option anyway
> for me because to most NASes I have no access)

> Is there a "best-practice" way somewhere out here for doing this ?
> Whats about "deletestalesessions = yes" in sql.conf ? It seems to be
> prepared to do something like this but I found nothing further in the
> sources (maybe simply not yet implemented)? 

> I'm aware that this can be done by a regular SQL-query - that's also
> what I'll look at if there's no smoother way..

I think you'd have to do it this way since the method of identifying a 
session that didn't get the stop packet varies so much... I use a perl
script here which calculates minutes since last Alive packet, and if I
haven't seen one in 3x Alive-packet interval (varies by realm :-( then
I call radzap, and put the current time into AcctStopTime if it is has
remained 0.

Your own handling depends on frequency of Alive packets, or even if no
Alive packets are sent, some other criteria you can use. Way too site-
specific for FreeRADIUS, I think. Goes into the category of FreeRADIUS-
controlled user disconnections.

Ideally, if a new Acct-Start comes in on the same NAS/port combination
as an old session, the old one should be effectively radzap'd. rlm_sql
may or may not do this, I can't remember. The main problem with radzap
is that it zeros the octet counters which may have had valid data from
Alive packets in 'em.

-- 
Paul "TBBle" Hampson, on an alternate email client.

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

Reply via email to