Executing External Program
Hi am trying to excecute a program before autentification so I could deny access if it is on a callingstationnumber ban list on mysql.. But Script is not being Excecuting.. what seems the problem? radiud.conf exec test{ wait = yes program = "/usr/local/bin/php -f /scriptest/test.php" input_pairs = request output_pairs = reply packet_type = Access-Request } Test.php - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
executing external program
Hello guys and girls, While executing a script of mine in the radiusd.conf file I get a very strange error that worries me. /radius_xlat: '/home/vicky/finalprog/compAttrs Access-Request' Exec-Program: /home/vicky/finalprog/compAttrs Access-Request MASTER: Child PID 28050 failed to catch signal 11: killing all active servers./ The script it self is tested aside and it work. What seems to be the problem. I've never seen anything like this before... Thanks for all the suggestions! -- Vicky - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
executing external program
Hi all! I have a huge problem. When executing an external script I get strange error messages and my server shuts down. I find this strange because the script is tested a side and it works. Plus I have other similar scripts running and they run perfectly. I get this in the log (radiusd.log) : /Tue Jun 14 09:52:48 2005 : Error: Exec-Program: Abnormal child exit: Interrupted system call Tue Jun 14 09:52:48 2005 : Error: rlm_exec (getaccounting): External script failed/ And this in the debug mode : /radius_xlat: '/home/vicky/finalprog/compAttrs Accounting-Request' Exec-Program: /home/vicky/finalprog/compAttrs Accounting-Request MASTER: Child PID 1842 failed to catch signal 11: killing all active servers./ Has anyone encountered the same problem or has anyone any idea what may be causing this? Thanks a lot in advance! -- Vicky - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: Executing External Program
Hello, If my understanding is correct, your authorize section should look similar to this: authorize { ... test ... } Have you done this? Best Regards, [EMAIL PROTECTED] wrote: Hi am trying to excecute a program before autentification so I could deny access if it is on a callingstationnumber ban list on mysql.. But Script is not being Excecuting.. what seems the problem? radiud.conf exec test{ wait = yes program = "/usr/local/bin/php -f /scriptest/test.php" input_pairs = request output_pairs = reply packet_type = Access-Request } Test.php //log to txt function logtotxt($somecontent) { $filename = 'log.txt'; $handle = fopen($filename, 'a'); fwrite($handle, $somecontent); fclose($handle); } logtotxt("Script Was Excecuted"); // Make a test if (!empty($clientcallingstation) && !empty($calledstationid)) { logtotxt("$clientcallingstation:$calledstationid"); $retval = 0; } else { // otherwise reject $retval = 1; } exit ($retval); ?> - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html -- George Chelidze - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: Executing External Program
Yeah, did that, but no signs of php execution, I added to users with exec-wait and it worked ok.. the only problem is I try to send a Time-Out, with the php script, and it seems to not work.. and making some more tests. On 11 Sep 2004 at 16:48, George Chelidze wrote: > Hello, > > If my understanding is correct, your authorize section should look > similar to this: > > authorize { > ... > test > ... > } > > Have you done this? > > Best Regards, > > [EMAIL PROTECTED] wrote: > > Hi am trying to excecute a program before autentification so I could deny access > > if it > > is on a callingstationnumber ban list on mysql.. > > > > But Script is not being Excecuting.. what seems the problem? > > > > radiud.conf > > > >exec test{ > >wait = yes > >program = "/usr/local/bin/php -f /scriptest/test.php" > >input_pairs = request > >output_pairs = reply > >packet_type = Access-Request > > } > > > > > > > > Test.php > > > > > ob_start(); > > $clientcallingstation = $_ENV['CALLING_STATION_ID']; > > $calledstationid = $_ENV['CALLED_STATION_ID']; > > ob_end_clean(); > > > > //log to txt > > function logtotxt($somecontent) > > { > > $filename = 'log.txt'; > > $handle = fopen($filename, 'a'); > > fwrite($handle, $somecontent); > > fclose($handle); > > } > > logtotxt("Script Was Excecuted"); > > // Make a test > > if (!empty($clientcallingstation) && !empty($calledstationid)) > > { > > logtotxt("$clientcallingstation:$calledstationid"); > > $retval = 0; > > } else { > > // otherwise reject > > $retval = 1; > > } > > exit ($retval); > > ?> > > > > > > - > > List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html > > > > -- > George Chelidze > > > - > List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
executing external program after accounting_stop_query
Hello, I need to add one column to radacct table and set it according to values inserted into table on stop packet receipt. The external program is coded in C. What if I place acct_users after sql in accounting section? Will it work? The example of possible accounting section from radiusd.conf is listed below: accounting { sql acct_users } section from acct_users DEFAULT Acct-Status-Type == Stop Exec-Program = "/path/program arguments" Sure I can test it myself but would be great to hear your input. If it won't work, is there any other way? Thanks in advance and best Regards, -- George Chelidze - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: executing external program after accounting_stop_query
On Mon, Jun 21, 2004 at 03:15:29PM +0500, George Chelidze wrote: > Hello, > > I need to add one column to radacct table and set it according to values > inserted into table on stop packet receipt. The external program is > coded in C. What if I place acct_users after sql in accounting section? > Will it work? The example of possible accounting section from > radiusd.conf is listed below: > accounting { > sql > acct_users > } > > section from acct_users > > DEFAULT Acct-Status-Type == Stop > Exec-Program = "/path/program arguments" > Sure I can test it myself but would be great to hear your input. If it > won't work, is there any other way? You might be better off using rlm_exec (if you're using a recent enough FreeRADIUS version) and testing for 'Stop' or otherwise in that script, rather than using Exec-Program, which is somewhat deprecated, and known to have threading issues (on some platforms...) -- Paul "TBBle" Hampson, on an alternate email client. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Re: executing external program after accounting_stop_query
Hello, Paul Hampson wrote: On Mon, Jun 21, 2004 at 03:15:29PM +0500, George Chelidze wrote: Hello, I need to add one column to radacct table and set it according to values inserted into table on stop packet receipt. The external program is coded in C. What if I place acct_users after sql in accounting section? Will it work? The example of possible accounting section from radiusd.conf is listed below: accounting { sql acct_users } section from acct_users DEFAULT Acct-Status-Type == Stop Exec-Program = "/path/program arguments" Sure I can test it myself but would be great to hear your input. If it won't work, is there any other way? You might be better off using rlm_exec (if you're using a recent enough FreeRADIUS version) and testing for 'Stop' or otherwise in that script, rather than using Exec-Program, which is somewhat deprecated, and known to have threading issues (on some platforms...) Paul thanks for your quick response. I use freeradius 0.9.3. it's recent enough isn't it? I wonder if the schema I described will work or not. If it will, it will prove my understanding is correct. I'll read some docs for rlm_exec. Thanks Best Regards, -- George Chelidze - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html