Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2024 17:21:05 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 283419] rc.d script to make carp start late during bootup and stop early during shutdown
Message-ID:  <bug-283419-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D283419

            Bug ID: 283419
           Summary: rc.d script to make carp start late during bootup and
                    stop early during shutdown
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: conf
          Assignee: bugs@FreeBSD.org
          Reporter: thomas@gibfest.dk

Created attachment 255956
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D255956&action=
=3Dedit
rc.d script to enable carp late when booting and disable carp early when
shutting down

Hello :)

For a while I have been running with the attached rc.d script on my carp
routers and I wanted to share it in case it makes sense to include it in
FreeBSD.

The script tries to solve two related problems. carp(4) tends to start
announcing too early during bootup, and it tends to stop announcing too late
during shutdown.

During bootup carp(4) is pretty eager to start sending carp packets to the
network, announcing itself, possibly taking the MASTER role (depending on
preempt and advskew of course). Depending on the system this will likely be
before other software is ready to handle connections, like my bird2 routing
daemon but it could also be a webserver or something.

During shutdown carp(4) keeps sending carp announcements until the very last
second before the reboot, long after other software has shutdown. If the
software shuts down 10 seconds before the carp announcements that means 10
seconds of gap in whatever service is being handled.

The script has REQUIRE: securelevel since that seems to be the last thing in
rcorder on my systems, and it just sets net.inet.carp.allow=3D1 when run wi=
th
start. During shutdown it runs first, sets net.inet.carp.allow=3D0 which me=
ans
the machine stops sending carp packets, and the other system takes over
immediately.

This script has noticeably reduced failover times when we reboot routers du=
ring
upgrades, we used to have 20-30 seconds gap in traffic when rebooting and t=
hat
is now down to a couple of seconds.

The script requires net.inet.carp.allow=3D0 to be set to work properly.

Have a nice day :)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-283419-227>