Hi,
running FreeRADIUS Version 1.0.0-pre0 (Debian-package from cvs20040421)
with accounting to mysql 3.23.49.
When I understood things right, the accounting_update_query_alt should
come into action when accounting_update_query fails because no
start-record was ever inserted, right ?
However, if I'm right ;) when the start-record gets recorded, accounting
including updates works fine, but when the according row is missing in
table radacct (due to the start-record got lost or accounting started
after the session was created - ok, this is really uncommon) then
accounting_update_query_alt doens't kick in.
From what I understood the problem lies in rlm_sql not reporting an
error somehow when the update fails; complete debug-output from one
update and the stop-record below (both with changed IP's.
The stop-record finally creates a row in radacct, so
accounting_stop_query_alt works fine.
As soon as the according start-entry in table radacct exists also the
update work fine, but I thought of this as a way to recover missing
accounting packets to at least have the updates creating records when
the start goes wrong.
regards
Michael
--- cut acct-update ---
rad_recv: Accounting-Request packet from host 1.2.3.46:1646, id=208,
length=226
Acct-Session-Id = 0012
Cisco-AVPair = isakmp-group-id=grpname
Framed-IP-Address = 1.2.3.36
Cisco-AVPair = isakmp-initator-ip=3.2.1.10
User-Name = username
Cisco-AVPair = connect-progress=Auth Open
Acct-Session-Time = 10785
Acct-Input-Octets = 1303176
Acct-Output-Octets = 1219984
Acct-Input-Packets = 10839
Acct-Output-Packets = 10839
Acct-Authentic = RADIUS
Acct-Status-Type = Alive
Cisco-NAS-Port = Dialer1
NAS-Port = 1
NAS-IP-Address = 1.2.3.46
Acct-Delay-Time = 0
rad_lowerpair: User-Name now 'username'
Processing the preacct section of radiusd.conf
modcall: entering group preacct for request 36
modcall[preacct]: module preprocess returns noop for request 36
rlm_realm: No '#' in User-Name = username, looking up realm NULL
rlm_realm: No such realm NULL
modcall[preacct]: module realmhash returns noop for request 36
rlm_realm: No '@' in User-Name = username, looking up realm NULL
rlm_realm: No such realm NULL
modcall[preacct]: module suffix returns noop for request 36
modcall[preacct]: module files returns noop for request 36
modcall: group preacct returns noop for request 36
Processing the accounting section of radiusd.conf
modcall: entering group accounting for request 36
rlm_acct_unique: Hashing 'NAS-Port = 1,Client-IP-Address =
1.2.3.46,NAS-IP-Address = 1.2.3.46,Acct-Session-Id =
0012,User-Name = username'
rlm_acct_unique: Acct-Unique-Session-ID = f13ebac0de4ea35c.
modcall[accounting]: module acct_unique returns ok for request 36
radius_xlat: '/var/log/freeradius/radacct/1.2.3.46/detail-20040517'
rlm_detail:
/var/log/freeradius/radacct/%{Client-IP-Address}/detail-%Y%m%d expands
to /var/log/freeradius/radacct/1.2.3.46/detail-20040517
modcall[accounting]: module detail returns ok for request 36
modcall[accounting]: module unix returns noop for request 36
radius_xlat: 'username'
rlm_sql (sql): sql_set_user escaped user -- 'username'
radius_xlat: 'UPDATE radacct ? SET FramedIPAddress = '1.2.3.36', ?
AcctSessionTime = '10785', ? AcctInputOctets = '1303176', ?
AcctOutputOctets = '1219984' ? WHERE AcctSessionId = '0012' ? AND
UserName = 'username' ? AND NASIPAddress= '1.2.3.46''
rlm_sql (sql): Reserving sql socket id: 1
rlm_sql (sql): Released sql socket id: 1
modcall[accounting]: module sql returns ok for request 36
radius_xlat: '/var/log/freeradius/radutmp'
radius_xlat: 'username'
modcall[accounting]: module radutmp returns ok for request 36
--- cut acct-stop ---
rad_recv: Accounting-Request packet from host 1.2.3.46:1646, id=230,
length=264
Acct-Session-Id = 0012
Cisco-AVPair = isakmp-group-id=grpname
Framed-IP-Address = 1.2.3.36
Cisco-AVPair = isakmp-initator-ip=3.2.1.10
User-Name = username
Acct-Authentic = RADIUS
Cisco-AVPair = connect-progress=Auth Open
Acct-Session-Time = 11376
Acct-Input-Octets = 1374720
Acct-Output-Octets = 1287360
Acct-Input-Packets = 11433
Acct-Output-Packets = 11433
Acct-Terminate-Cause = 0
Cisco-AVPair = disc-cause-ext=No Reason
Acct-Status-Type = Stop
Cisco-NAS-Port = Dialer1
NAS-Port = 1
NAS-IP-Address = 1.2.3.46
Acct-Delay-Time = 0
rad_lowerpair: User-Name now 'username'
Processing the preacct section of radiusd.conf
modcall: entering group preacct for request 65
modcall[preacct]: module preprocess returns noop for request 65
rlm_realm: No '#' in User-Name = username, looking up realm NULL
rlm_realm: No such realm NULL
modcall[preacct]: module realmhash returns noop for request 65