[Bug 283419] rc.d script to make carp start late during bootup and stop early during shutdown
Date: Thu, 19 Dec 2024 17:21:05 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283419 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=255956&action=edit 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=1 when run with start. During shutdown it runs first, sets net.inet.carp.allow=0 which means the machine stops sending carp packets, and the other system takes over immediately. This script has noticeably reduced failover times when we reboot routers during upgrades, we used to have 20-30 seconds gap in traffic when rebooting and that is now down to a couple of seconds. The script requires net.inet.carp.allow=0 to be set to work properly. Have a nice day :) -- You are receiving this mail because: You are the assignee for the bug.