Forum Discussion

Robert_Reznicek's avatar
Icon for Nimbostratus rankNimbostratus
Apr 22, 2010

How to force RULE_INIT

Is it somehow possible to fire RULE_INIT, without modifying the code, or restarting the process?


I have a global variable initialized in RULE_INIT and I need it to be visible immediately on the standby host in case that failover occurs.


Or is there any better method how to initialize global variable, maybe without using RULE_INIT?


Thank you


3 Replies

  • Hi Robert,



    Can you clarify when you'd need to have RULE_INIT run (or initialize a global variable)? Is it only on the standby unit? Only after a failover? Or are you wanting to make a change on the active unit and have that change synch'd and initialized on the standby?



  • Hi Aaron,



    This is still related to the ProxyPass implementation i've described in my previous posts.



    I need a global variable - an array containing internal and external hosts, to be loaded in memory. I put initialization of the array (loop, which goes through a datagroup and fills the array) in iRule. I also created a bash script, which handles modifying of the datagroup (adding and removing hosts). This script connects to the VIP, where the iRule is configured and fires the initialization.


    We also need to be sure, that the array will be loaded, when the LB is rebooted, so I added the same piece of code in RULE_INIT.


    The problem is, that the array is only loaded on active host. I need some mechanism, which fires initialization on the standby host. When synchronizing both units (this is run from the same bash script automatically) the array is not loaded on the standby unit. I've a workaround - i can restart the tmm process remotely, but this is not very elegant.


    So my question is, whether some another option, how to fire the RULE_INIT exists. Or is it somehow possible to initialize the variable using bash/perl script?