From 9ea8f935bcdce2e99462b04c65dc242755e2d88c Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Thu, 13 Mar 2014 16:05:14 +0100 Subject: haproxy-devel, handle carp master/backup plugin event for faster response when the haproxy process needs to be started --- config/haproxy-devel/haproxy.inc | 11 +++++++++++ config/haproxy-devel/haproxy.xml | 5 +++++ 2 files changed, 16 insertions(+) (limited to 'config') diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc index 9bc0dd80..c3ccc498 100644 --- a/config/haproxy-devel/haproxy.inc +++ b/config/haproxy-devel/haproxy.inc @@ -1131,6 +1131,17 @@ function load_ipfw_rules() { mwexec("/sbin/ipfw -x $ipfw_zone_haproxy -q {$g['tmp_path']}/ipfw_{$ipfw_zone_haproxy}.haproxy.rules", true); } +function haproxy_plugin_carp($pluginparams) { + // called by pfSense when a CARP interface changes its state (called multiple times when multiple interfaces change state) + // $pluginparams['type'] always 'carp' + // $pluginparams['event'] either 'rc.carpmaster' or 'rc.carpbackup' + // $pluginparams['interface'] contains the affected interface + $type = $pluginparams['type']; + $event = $pluginparams['event']; + $interface = $pluginparams['interface']; + haproxy_check_run(0); +} + function haproxy_check_run($reload) { global $config, $g, $haproxy_run_message; diff --git a/config/haproxy-devel/haproxy.xml b/config/haproxy-devel/haproxy.xml index bbc32575..25949392 100644 --- a/config/haproxy-devel/haproxy.xml +++ b/config/haproxy-devel/haproxy.xml @@ -58,6 +58,11 @@ haproxy The Reliable, High Performance TCP/HTTP Load Balancer + + + plugin_carp + + installedpackages->haproxy->config /usr/local/pkg/ -- cgit v1.2.3