From owner-freebsd-questions@FreeBSD.ORG Tue Feb 7 14:36:10 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47EA21065677 for ; Tue, 7 Feb 2012 14:36:10 +0000 (UTC) (envelope-from peter.knezel@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id C40438FC1C for ; Tue, 7 Feb 2012 14:36:09 +0000 (UTC) Received: by lagz14 with SMTP id z14so5634042lag.13 for ; Tue, 07 Feb 2012 06:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=l/inZ/xX07wWQaF+PQgXRN/EsGBy3dyVPaNAyYndzSg=; b=wZvMu9tfVur0Fd3mq3+FmKvpREhBiXPTrulSGu0+KUNSdv5vAh5oBoub0cCG/iWqFi zlcYRlZo8EnAkJEtI10gkfkcs+E3/oyoh+FBpW79gRrMs/peOQ2ukebZIeyzcz2VTgEr yEQOATaPgza51dauLmI2MPm5yzZozs4KVB/ag= MIME-Version: 1.0 Received: by 10.152.109.161 with SMTP id ht1mr12498780lab.33.1328625368507; Tue, 07 Feb 2012 06:36:08 -0800 (PST) Received: by 10.152.43.71 with HTTP; Tue, 7 Feb 2012 06:36:08 -0800 (PST) Date: Tue, 7 Feb 2012 15:36:08 +0100 Message-ID: From: peter knezel To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: From analysis of a simple ifstated.conf to more compex example X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 14:36:10 -0000 Hello all, I would like to ask somebody to explain me how the ifstated works according to the following configuration file. I have three virtual carp interfaces carp0,carp1 and carp2. I try to understand the following setting: The server is in state one (all carp interfaces are up) and if there is carp down of any: one (carp0 or carp1 or carp2), two ([carp0 and carp1] or [carp0 and carp2] or [carp1 and carp2]), three interfaces (carp 0 and carp1 and carp2), server runs the script testdown.sh and put the server into state two. If all carp interfaces are up, the server runs the testup.sh and set the state to one. Is it the way the system works? Or am I wrong? === init-state one net = '( "ifconfig -a -u |grep carp0 > /dev/null" every 3 && "ifconfig -a -u |grep carp1 > /dev/null" every 3 && "ifconfig -a -u |grep carp2 > /dev/null" every 3)' state one { if ( ! $net ) { run "/usr/local/testdown.sh" set-state two } } state two { if ( $net ) { run "/usr/local/testup.sh" set-state one } } === Is there any possibility to define and set ifstated.conf that reacts when: any one of the carp interfaces is down - followed by another any other carp interface down I tried to define states: duu ="!carp0.link.up && carp1.link.up && carp2.link.up" udu ="carp0.link.up && !carp1.link.up && carp2.link.up" uud ="carp0.link.up && carp1.link.up && !carp2.link.up" ddu ="!carp0.link.up && !carp1.link.up" dud ="!carp0.link.up && !carp2.link.up" udd ="!carp1.link.up && !carp2.link.up" and used them but somehow I cannot incorporate all state changes and include it in ifstated.conf. Thanks and regards, Peter Knezel