Help on using exec modules
Hello, I'm using FreeRADIUS version 2.1.7 on a CentOS 5.5 distro. I'm trying to execute a simple shell script when RADIUS send an Access-Accept packet, but failed. I'm modified /modules/echo like this: ... program = "/bin/echo %{User-Name} >> /a.txt" ... and have add to sites-available/default, under post-auth: ... post-auth { exec echo ... the log is: +- entering group post-auth {...} ++[exec] returns noop [echo] expand: %{User-Name} -> test ++[echo] returns ok Sending Access-Accept of id 224 to 127.0.0.1 port 60465 Reply-Message = "Hello, %{User-Name}" Finished request 1. Going to the next request Waking up in 4.9 seconds. Cleaning up request 1 ID 224 with timestamp +15 Ready to process requests. However, find no output file anywhere. What have I forgotten to configure? Please help, Thanks in advance. -- View this message in context: http://freeradius.1045715.n5.nabble.com/Help-on-using-exec-modules-tp3234663... Sent from the FreeRadius - User mailing list archive at Nabble.com.
UPDATE: Ok, I managed to get it running, I must have misconfigured something, reload the fresh configuration worked. I have another question though, how can I pass an attributes from the Access-Accept packet to the external executable? I have tried putting the exec echo in Post-Auth, Pre-Accounting, Authorize, etc. but when I pass %{Session-Timeout} (Attribute from Access-Accept), it resolves to nothing. (Also have set the input_pairs in the exec echo to Reply). Can you point me to where to put the exec echo and what more to configure to get a access-accept packet attribute ? Thanks in advance. -- View this message in context: http://freeradius.1045715.n5.nabble.com/Help-on-using-exec-modules-tp3234663... Sent from the FreeRadius - User mailing list archive at Nabble.com.
Alan DeKok-2 wrote:
nghiapt wrote:
I have another question though, how can I pass an attributes from the Access-Accept packet to the external executable?
$ man unlang
It documents how to reference attributes.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Wow, never thought it would be documented there. Thanks, you're the man, Alan! -- View this message in context: http://freeradius.1045715.n5.nabble.com/Help-on-using-exec-modules-tp3234663... Sent from the FreeRadius - User mailing list archive at Nabble.com.
participants (2)
-
Alan DeKok -
nghiapt