Exec-Program in acct_users file
Good day! Does everyone know about Exec-Program in acct_users in Freeradius 2.1.1? I upgrade my from 1.1.7 to 2.1.1 and do not see exec in debug. I used Start and Stop in accounting for some DNS registrations of my clients, like this: ~# cat acct_users ... ... DEFAULT Realm == 'dyndns', Acct-Status-Type == Start, Acct-Type := BILL Exec-Program = "/opt/fr/bin/dyndns.acctstart.pl" DEFAULT Realm == 'dyndns', Acct-Status-Type == Stop, Acct-Type := BILL Exec-Program = "/opt/fr/bin/dyndns.acctstop.pl" and this works in 1.1.7 ! But for 2.1.1 - this does not work. Mon Dec 22 18:19:19 2008 : Info: ++[preprocess] returns ok Mon Dec 22 18:19:19 2008 : Info: [suffix] Looking up realm "dyndns" for User-Name = "12345@dyndns" Mon Dec 22 18:19:19 2008 : Info: [suffix] Found realm "dyndns" Mon Dec 22 18:19:19 2008 : Info: [suffix] Adding Stripped-User-Name = "12345" Mon Dec 22 18:19:19 2008 : Info: [suffix] Adding Realm = "dyndns" Mon Dec 22 18:19:19 2008 : Info: [suffix] Accounting realm is LOCAL. Mon Dec 22 18:19:19 2008 : Info: ++[suffix] returns ok Mon Dec 22 18:19:19 2008 : Info: [files] expand: %{NAS-IP-Address} -> 212.119.106.21 Mon Dec 22 18:19:19 2008 : Info: [files] acct_users: Matched entry DEFAULT at line 32 in this point (32 line - Realm == 'dyndns', 33 line Exec-Program = "blabla" in acct_users) doesn not work. Mon Dec 22 18:19:19 2008 : Info: ++[files] returns ok Mon Dec 22 18:19:19 2008 : Debug: Found Acct-Type BILL Mon Dec 22 18:19:19 2008 : Info: +- entering group BILL {...} Tue Dec 23 10:40:52 2008 : Info: [acct_unique] Hashing 'NAS-IP-Address = 212.119.106.21,Acct-Session-Id = "D4776A151004A3344"' Tue Dec 23 10:40:52 2008 : Info: [acct_unique] Acct-Unique-Session-ID = "eddc8ecb616eae58". Tue Dec 23 10:40:52 2008 : Info: ++[acct_unique] returns ok Tue Dec 23 10:40:52 2008 : Info: [BILL] expand: /opt/fr2/radacct/files/cdr.%Y%m%d.%H -> /opt/fr2/radacct/files/cdr.20081223.10 Tue Dec 23 10:40:52 2008 : Info: [BILL] /opt/fr2/radacct/files/cdr.%Y%m%d.%H expands to /opt/fr2/radacct/files/cdr.20081223.10 Tue Dec 23 10:40:52 2008 : Info: [BILL] Acquired filelock, tried 1 time(s) Tue Dec 23 10:40:52 2008 : Info: [BILL] expand: %t -> Tue Dec 23 10:40:52 2008 Tue Dec 23 10:40:52 2008 : Info: [BILL] Released filelock Tue Dec 23 10:40:52 2008 : Info: ++[BILL] returns ok Sending Accounting-Response of id 66 to 128.1.134.55 port 50812 in this point does not work again... Tue Dec 23 10:40:52 2008 : Info: Finished request 0. Tue Dec 23 10:40:52 2008 : Info: Cleaning up request 0 ID 66 with timestamp +3 Tue Dec 23 10:40:52 2008 : Debug: Going to the next request in 1.1.7 Tue Dec 23 10:28:56 2008 : Debug: rlm_acct_unique: Acct-Unique-Session-ID = "fd9494068cfbfd81". Tue Dec 23 10:28:56 2008 : Debug: modsingle[accounting]: returned from acct_unique (rlm_acct_unique) for request 1 Tue Dec 23 10:28:56 2008 : Debug: modcall[accounting]: module "acct_unique" returns ok for request 1 Tue Dec 23 10:28:56 2008 : Debug: modsingle[accounting]: calling BILL (rlm_detail) for request 1 Tue Dec 23 10:28:56 2008 : Debug: radius_xlat: '/opt/fr/radacct/files/cdr.20081223.10' Tue Dec 23 10:28:56 2008 : Debug: rlm_detail: /opt/fr/radacct/files/cdr.%Y%m%d.%H expands to /opt/fr/radacct/files/cdr.20081223.10 Tue Dec 23 10:28:56 2008 : Debug: rlm_detail: Acquired filelock, tried 1 time(s) Tue Dec 23 10:28:56 2008 : Debug: rlm_detail: Released filelock Tue Dec 23 10:28:56 2008 : Debug: modsingle[accounting]: returned from BILL (rlm_detail) for request 1 Tue Dec 23 10:28:56 2008 : Debug: modcall[accounting]: module "BILL" returns ok for request 1 Tue Dec 23 10:28:56 2008 : Debug: modcall: leaving group BILL (returns ok) for request 1 in this point my script is working. Sending Accounting-Response of id 232 to 128.1.134.55 port 33228 Tue Dec 23 10:28:56 2008 : Debug: Finished request 1 Tue Dec 23 10:28:56 2008 : Debug: Going to the next request -- Yours faithfully, Anton Borisov.
Anton Borisov wrote:
I used Start and Stop in accounting for some DNS registrations of my clients, like this:
~# cat acct_users ... ... DEFAULT Realm == 'dyndns', Acct-Status-Type == Start, Acct-Type := BILL ... and this works in 1.1.7 !
But for 2.1.1 - this does not work.
You need to list the "exec" module in the "post-auth" section. Alan DeKok.
Thank you for your reply. Yes, yes. I have uncommented exec in post-auth section in /etc/raddb/sites-enabled/default config. So, another way in 2.1.1 - I've configured this program only with accounting module. Some examples: /etc/raddb/sites-enabled/default accounting { ... ... Acct-Type BILL { if ( Acct-Status-Type =~ /Start|Stop/ ) { dns } } ... cat /etc/raddb/modules/exec ... ... exec dns { wait = yes program = "/path-to-my-programm.sh" input_pairs = request output_pairs = reply } This is working, but more quickly and easily only add Exec-Programm to acct_users (like in 1.7.7 version) Would you be so kind and give some examples for acct_usrs in 2.1.1? Alan DeKok wrote:
Anton Borisov wrote:
I used Start and Stop in accounting for some DNS registrations of my clients, like this:
~# cat acct_users ... ... DEFAULT Realm == 'dyndns', Acct-Status-Type == Start, Acct-Type := BILL ... and this works in 1.1.7 !
But for 2.1.1 - this does not work.
You need to list the "exec" module in the "post-auth" section.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Yours faithfully, Anton Borisov.
I'm using FR 1.1.7 with acct_users but what if you have more complicated scripts and you're using it on Interim-Updates. Every time when Interim-Update triggers, this script has to connect to do something (database connection, do this, do that.... )... Is there any other way to something like this? On Tue, Dec 23, 2008 at 11:48 AM, Anton Borisov <antonio@mccinet.ru> wrote:
Thank you for your reply.
Yes, yes. I have uncommented exec in post-auth section in /etc/raddb/sites-enabled/default config.
So, another way in 2.1.1 - I've configured this program only with accounting module. Some examples:
/etc/raddb/sites-enabled/default accounting { ... ... Acct-Type BILL { if ( Acct-Status-Type =~ /Start|Stop/ ) { dns } } ...
cat /etc/raddb/modules/exec ... ... exec dns { wait = yes program = "/path-to-my-programm.sh" input_pairs = request output_pairs = reply }
This is working, but more quickly and easily only add Exec-Programm to acct_users (like in 1.7.7 version) Would you be so kind and give some examples for acct_usrs in 2.1.1?
Alan DeKok wrote:
Anton Borisov wrote:
I used Start and Stop in accounting for some DNS registrations of my clients, like this:
~# cat acct_users ... ... DEFAULT Realm == 'dyndns', Acct-Status-Type == Start, Acct-Type := BILL
...
and this works in 1.1.7 !
But for 2.1.1 - this does not work.
You need to list the "exec" module in the "post-auth" section.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Yours faithfully, Anton Borisov.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan DeKok -
Anton Borisov -
Marinko Tarlac