From: mpf Date: Sat, 20 Jan 2018 22:57:11 +0000 (+0000) Subject: Improve the config example. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0d2274c8df37e0e796e7d40fd653e2e63bb0c4ca;p=openbsd Improve the config example. Suggest using carpdemote instead of tweaking the advskew setting. Also add a check for a non-carp link state. Prodded by jmc@. OK jmc@, rob@. --- diff --git a/usr.sbin/ifstated/ifstated.conf.5 b/usr.sbin/ifstated/ifstated.conf.5 index 2721871926c..5f1cc8321c6 100644 --- a/usr.sbin/ifstated/ifstated.conf.5 +++ b/usr.sbin/ifstated/ifstated.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ifstated.conf.5,v 1.9 2012/04/24 14:56:09 jmc Exp $ +.\" $OpenBSD: ifstated.conf.5,v 1.10 2018/01/20 22:57:11 mpf Exp $ .\" .\" Copyright (c) 2005 Nikolay Sturm .\" Copyright (c) 2005 Marco Pfatschbacher @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: April 24 2012 $ +.Dd $Mdocdate: January 20 2018 $ .Dt IFSTATED.CONF 5 .Os .Sh NAME @@ -94,7 +94,7 @@ keyword. .Pp For example: .Bd -literal -offset indent -carp_up = "carp0.link.up && carp1.link.up" +links_up = "em0.link.up && em1.link.up" net = '( "ping -q -c 1 -w 1 192.168.0.1 > /dev/null" every 10 && \e "ping -q -c 1 -w 1 192.168.0.2 > /dev/null" every 10 )' .Ed @@ -138,17 +138,18 @@ For example: .Bd -literal -offset indent state one { init { - run "ifconfig carp0 advskew 10" - run "ifconfig carp1 advskew 10" + run "logger -t ifstated entering state one" + run "ifconfig -g carp -carpdemote" } - if ! $net + if ! $net || urndis0.link.up set-state two - if ! $carp_up { - run "ifconfig carp0 advskew 254" - run "ifconfig carp1 advskew 254" - set-state three + if ! $links_up { + run "ifconfig -g carp carpdemote" + + if urndis0.link.down + set-state three } } .Ed