Forum Discussion

Brandon_High_10's avatar
Brandon_High_10
Icon for Nimbostratus rankNimbostratus
Dec 23, 2004

"detach" command

I'm trying to use the "detach" command in an iRule and receive the following error when entering it:

 

 

line 25: [undefined procedure: detach] [detach]

 

 

Is there another way to achieve the same effect, or will I have to wait for a fix from F5?
  • bl0ndie_127134's avatar
    bl0ndie_127134
    Historic F5 Account
    The error code indicates that you may be using the wrong syntax. Try this out.

     

     

     
     ONECONNECT::detach [enable | disable]
  • I'm not trying to use the ONECONNECT::detach. I'm trying to use the detach command listed on p. 13-9 of the LTM_config_guide.pdf:

    detach

    Discontinues evaluating this iRule event on this connection. However, the iRule continues to run.

    In order to keep the rules from being too huge we have split certain features into different iRules. One example is a rule for our intranet. Because some clients will not store cookies that map to a hostname only, there is a rule that turns a hostname into a FQDN. This allows cookie persistance to work. It does this by using a HTTP::redirect, followed by a return.

    There are multiple iRules being applied, each with HTTP_REQUEST a handler. The next file begins to be processed and could potentially send another HTTP::redirect (which fails with IE6), or select a different pool, etc. I want all iRule processing for that event to stop after certain conditions. Using return works in a single iRule, but doesn't work with multiple iRules.

    The work around that I've come up with is to have a global variable called $FINISHED, which I set to 1 before calling a return. In each of the iRules, the HTTP_REQUEST handler starts with

    if { $FINISHED } { 
         return 
     }

    to skip the contents of that file. Obviously this is a kludge to emulate the behaviour of the missing detach command.
  • drteeth_127330's avatar
    drteeth_127330
    Historic F5 Account
    Due to a conflict with ONECONNECT::detach, this functionality was moved to the event command. Try this:

    event disable all
  • Where can I find more info on the event command? It's not in the LTM_config_guide.pdf or the 9.0.x release notes.
  • drteeth_127330's avatar
    drteeth_127330
    Historic F5 Account
    The event command will be documented in a future release. However, I reviewed the code, and I don't believe that it will discontinue processing handlers for the same rule event. In fact, I don't see a better way of doing this than what you have done. I have filed a change request so this will be addressed in a future release. Thanks!
  • Will there be a "detach" or "event disable all" command added back into the 9.x tree? Our current work around works, but isn't exactly elegant.
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    Yes, the "event disable" command has been fixed in 9.0.5 (TBR anyday now). The previous command did mostly work except that if you had multiple rules, subsequent event scripts from other rules were still evaluated and the event was only disabled from a new trigger. The command now completely stops processing for any subsequent scripts.

    The command has the following syntax:

     
     event disable - disable the current event from being evaluated again. 
     event  disable - disable a specific event from being evaluated. 
     event disable all - disable all events from being evaluated. 
     event  enable - (re)enable a specific event. 
     event enable all - (re)enable all events.