How do I tell if accounting module fails?
Hi all, I'm using an Exec-Program to do some user-specific stuff when a user logs out of our network (i.e. it is invoked with "DEFAULT Acct-Status-Type == Stop"). I'm trying to find a way for it to detect whether the database accounting module has succeedded in updating the user's accounting record or not (it will fail if the STOP packet is a duplicate). I can't find an attribute that I can test to check the status of the request at that stage. Any suggestions? Alex
create log file on disk and check does it exist or add one column to your table and write something inside ? On Wed, Oct 8, 2008 at 11:46 AM, Alex French <alex@evilal.com> wrote:
Hi all,
I'm using an Exec-Program to do some user-specific stuff when a user logs out of our network (i.e. it is invoked with "DEFAULT Acct-Status-Type == Stop").
I'm trying to find a way for it to detect whether the database accounting module has succeedded in updating the user's accounting record or not (it will fail if the STOP packet is a duplicate). I can't find an attribute that I can test to check the status of the request at that stage. Any suggestions?
Alex - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
2008/10/8 Marinko Tarlac <mangia81@gmail.com>:
create log file on disk and check does it exist or add one column to your table and write something inside ?
Yes, my fallback solution is to add a column to my radacct table (or possibly to another, more transient table) that I can do a SELECT FOR UPDATE on. However, I hoped there was a more elegant solution that did not involve an additional database connection. Perhaps not... Alex
Your program should return this. See raddb/modules/echo for instructions. Ivan Kalik Kalik Informatika ISP Dana 8/10/2008, "Alex French" <alex@evilal.com> piše:
Hi all,
I'm using an Exec-Program to do some user-specific stuff when a user logs out of our network (i.e. it is invoked with "DEFAULT Acct-Status-Type == Stop").
I'm trying to find a way for it to detect whether the database accounting module has succeedded in updating the user's accounting record or not (it will fail if the STOP packet is a duplicate). I can't find an attribute that I can test to check the status of the request at that stage. Any suggestions?
Alex - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
2008/10/8 <tnt@kalik.net>:
Your program should return this. See raddb/modules/echo for instructions.
Ivan, Sorry, I was not sufficiently clear in my explanation. My program wants to know if the sql module that ran *before* it failed or succeded. (And I'm running 1.1.7 not 2.x but the theory is the same I presume). Thanks, Alex
You will need to log that into a file or a database. Ivan Kalik Kalik Informatika ISP Dana 8/10/2008, "Alex French" <alex@evilal.com> piše:
2008/10/8 <tnt@kalik.net>:
Your program should return this. See raddb/modules/echo for instructions.
Ivan,
Sorry, I was not sufficiently clear in my explanation. My program wants to know if the sql module that ran *before* it failed or succeded. (And I'm running 1.1.7 not 2.x but the theory is the same I presume).
Thanks,
Alex - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Alex French wrote:
Sorry, I was not sufficiently clear in my explanation. My program wants to know if the sql module that ran *before* it failed or succeded. (And I'm running 1.1.7 not 2.x but the theory is the same I presume).
Each module returns a code: noop/ok/fail/etc. It's a little difficult to access this from another module in 1.1.7. In 2.x, see "man unlang" for how to access the return codes. Alan DeKok.
Thanks all for the responses. I will use a DB table for now, and look at other alternatives once we migrate to 2.x Alex 2008/10/8 Alan DeKok <aland@deployingradius.com>:
Alex French wrote:
Sorry, I was not sufficiently clear in my explanation. My program wants to know if the sql module that ran *before* it failed or succeded. (And I'm running 1.1.7 not 2.x but the theory is the same I presume).
Each module returns a code: noop/ok/fail/etc. It's a little difficult to access this from another module in 1.1.7. In 2.x, see "man unlang" for how to access the return codes.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (4)
-
Alan DeKok -
Alex French -
Marinko Tarlac -
tnt@kalik.net