Mailing List Archive

post up/down dynamic handlers not being called?
Hi everyone,

I'm running 2.1.3 on Linux (FC6). In the past I've always managed
to just bind to *:$port so I didn't have to have wackamole manage
another service. Today I wanted to setup something to bind on a
handful of specific IPs and then stop and start a service as
appropriate.

In my wackamole.conf I have the following:

PerlUseLib /var/services/wackamole-foo-ext/lib
PerlUse SolWack

RunDynamic SolWack::post_up post up
RunDynamic SolWack::post_down post down
RunDynamic SolWack::on_up on up
RunDynamic SolWack::on_down on down

As far as I can tell only the "on up/down" handlers are being
called. The "post up/down" aren't.

I wanted to use the post up/down ones so I could just do my service
stop/start stuff after all the IPs had been moved.

Any hints?


- ask

--
http://develooper.com/ - http://askask.com/



_______________________________________________
wackamole-users mailing list
wackamole-users@lists.backhand.org
http://lists.backhand.org/mailman/listinfo/wackamole-users
Re: post up/down dynamic handlers not being called? [ In reply to ]
On Mar 11, 2007, at 8:46 AM, Ask Bjørn Hansen wrote:

> Hi everyone,
>
> I'm running 2.1.3 on Linux (FC6). In the past I've always managed
> to just bind to *:$port so I didn't have to have wackamole manage
> another service. Today I wanted to setup something to bind on a
> handful of specific IPs and then stop and start a service as
> appropriate.
>
> In my wackamole.conf I have the following:
>
> PerlUseLib /var/services/wackamole-foo-ext/lib
> PerlUse SolWack
>
> RunDynamic SolWack::post_up post up
> RunDynamic SolWack::post_down post down
> RunDynamic SolWack::on_up on up
> RunDynamic SolWack::on_down on down
>
> As far as I can tell only the "on up/down" handlers are being
> called. The "post up/down" aren't.
>
> I wanted to use the post up/down ones so I could just do my service
> stop/start stuff after all the IPs had been moved.
> Any hints?

It's "supposed" to work the way you had expected it.

The code for all that stuff is ugly but pretty simple:

wackamole.c:

Handle_Balance
__foreach change
____if now my responsibility
______num_acquired++
______Acquire() [which calls user loaded on_up]
____if no longer my responsibility
______num_released++
______Release() [which calls user loaded on_down]
__if num_acquired
____call user loaded post_up
__if num_released
____call user loaded post_down


Could you gdb attach to that and breakpoint at:
execute_all_user_simple, trigger a IP shift and then step through
that for anything obvious.
That function is called on the post_up and post_down to dispatch to
perl and other user-space stuff.

// Theo Schlossnagle
// Principal@OmniTI: http://omniti.com
// Esoteric Curio: http://www.lethargy.org/~jesus/


_______________________________________________
wackamole-users mailing list
wackamole-users@lists.backhand.org
http://lists.backhand.org/mailman/listinfo/wackamole-users