diff options
author | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2018-01-20 22:57:12 +0000 |
---|---|---|
committer | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2018-01-20 22:57:12 +0000 |
commit | 3102a72455b2d7d1fd9401d744d8ec69f67f8920 (patch) | |
tree | 7391336a84c345009b00a74f075b4c51232a9c84 | |
parent | 3d9ab49a23a927eb6817affe517d46bd5b0d222e (diff) |
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@.
-rw-r--r-- | usr.sbin/ifstated/ifstated.conf.5 | 21 |
1 files changed, 11 insertions, 10 deletions
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 <sturm@openbsd.org> .\" Copyright (c) 2005 Marco Pfatschbacher <mpf@openbsd.org> @@ -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 |