diff options
author | Ermal Luçi <eri@pfsense.org> | 2014-03-13 23:28:06 +0100 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2014-03-13 23:28:06 +0100 |
commit | 97f6aea7ce1261e2420763bb0468d45a0050326a (patch) | |
tree | e1643c69570cfb6819951f8b6202236942a359f0 /config/haproxy-devel | |
parent | 244467c9c1e7208874868deb4ebaa5038f565982 (diff) | |
parent | 0f5097ab454e1458dd7e17eaab4e2cc0f2490056 (diff) | |
download | pfsense-packages-97f6aea7ce1261e2420763bb0468d45a0050326a.tar.gz pfsense-packages-97f6aea7ce1261e2420763bb0468d45a0050326a.tar.bz2 pfsense-packages-97f6aea7ce1261e2420763bb0468d45a0050326a.zip |
Merge pull request #623 from PiBa-NL/hap_carp_eventhandling
haproxy-devel, handle carp master/backup plugin event for faster response when the haproxy process needs to be started
Diffstat (limited to 'config/haproxy-devel')
-rw-r--r-- | config/haproxy-devel/haproxy.inc | 11 | ||||
-rw-r--r-- | config/haproxy-devel/haproxy.xml | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc index 47a85604..517b4801 100644 --- a/config/haproxy-devel/haproxy.inc +++ b/config/haproxy-devel/haproxy.inc @@ -1132,6 +1132,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..bf1430b8 100644 --- a/config/haproxy-devel/haproxy.xml +++ b/config/haproxy-devel/haproxy.xml @@ -58,6 +58,11 @@ <executable>haproxy</executable> <description>The Reliable, High Performance TCP/HTTP Load Balancer</description> </service> + <plugins> + <item> + <type>plugin_carp</type> + </item> + </plugins> <configpath>installedpackages->haproxy->config</configpath> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> |