|
Re: execute a command after getting/loosing a IP-Address?: msg#00013apache.mod-wackamole.general
On Nov 27, 2003, at 10:13 AM, Ryan Caudy wrote: So, we don't provide any solutions to this problem within Wackamole. However, I'm sure someone else has had to deal with it, and might answer you with something they've already developed. (This is a big holiday in the US, which means a lot of people on the list probably won't be responding for a few days). Actually, wackamole in CVS has embedded an embedded perl interpreter in it. So you can do crazy stuff like that. It is mostly untested and undocumented, but I have used it. It also has the ability to dlopen shared objects and run code in those -- if you'd rather write in C. Perl works something like this in your wackamole.conf: PerlUseLib . PerlUse example RunDynamic example::hup_named on up In the local directory (.) example.pm looks like: -- begin -- package example; use strict; use Data::Dumper; sub hup_named { my $pid; open(A,"</var/run/named.pid") && chomp($pid = <A>); close(A); kill 1, $pid if($pid); } 1; -- end -- The following will dlopen funcs.so and run the function returned by dlsym("shoutout"): RunDynamic funcs:shoutout on up A simple funcs.c is: -- begin -- #include "config.h" void killhup(struct interface p, struct interface *e, struct interface r) { fprintf(stderr, "I am here with IP %s\n", inet_ntoa(p.ipaddr)); } -- end -- All this being development work -- YMMV. // Theo Schlossnagle // Principal Engineer -- http://www.omniti.com/~jesus/ // Postal Engine -- http://www.postalengine.com/ // Ecelerity: fastest MTA on earth |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: execute a command after getting/loosing a IP-Address?: 00013, Ryan Caudy |
|---|---|
| Next by Date: | Re: execute a command after getting/loosing a IP-Address?: 00013, Oliver Fänger |
| Previous by Thread: | Re: execute a command after getting/loosing a IP-Address?i: 00013, Ryan Caudy |
| Next by Thread: | Re: execute a command after getting/loosing a IP-Address?: 00013, Oliver Fänger |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |