aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/carp.xml68
-rw-r--r--packages/carp_settings.xml22
2 files changed, 47 insertions, 43 deletions
diff --git a/packages/carp.xml b/packages/carp.xml
index 596240f5..383cfc50 100644
--- a/packages/carp.xml
+++ b/packages/carp.xml
@@ -58,19 +58,9 @@
<fieldname>advskew</fieldname>
</columnitem>
<columnitem>
- <fielddescr>Load Balancing</fielddescr>
- <fieldname>balancing</fieldname>
- <type>checkbox</type>
- </columnitem>
- <columnitem>
<fielddescr>Netmask</fielddescr>
<fieldname>netmask</fieldname>
</columnitem>
- <columnitem>
- <fielddescr>Preemption</fielddescr>
- <fieldname>premption</fieldname>
- <type>checkbox</type>
- </columnitem>
</adddeleteeditpagefields>
<!-- fields gets invoked when the user adds or edits a item. the following items
will be parsed and rendered for the user as a gui with input, and selectboxes. -->
@@ -207,18 +197,6 @@
<option><value>30</value><name>30</name></option>
</options>
</field>
- <field>
- <fielddescr>Load Balancing</fielddescr>
- <fieldname>balancing</fieldname>
- <description>If this feature is enabled, CARP source-hashes the originating IP of a request. The hash is then used to select a virtual host from the available pool to handle the request. This is disabled by default.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Preemption</fielddescr>
- <fieldname>premption</fieldname>
- <description>When preemption is enabled, each CARP host will look at the advskew (Advertising Frequency) parameter in the advertisements it receives from the master, to try to determine whether it can advertise more frequently. If so, it will begin advertising, and the current master, seeing that there is another host with a lower advskew, will bow out.</description>
- <type>checkbox</type>
- </field>
</fields>
<custom_php_command_before_form>
function sync_package_carp() {
@@ -231,8 +209,6 @@
$fout = fopen("/usr/local/etc/rc.d/carp.sh","w");
fwrite($fout, "#!/bin/sh \n");
global $config;
- $using_arp_balance = 0;
- $using_preempt = 0;
$carp_instances_counter = 0;
$pfsync_instances_counter = 0;
if($config['installedpackages']['carp']['config'] != "") {
@@ -257,25 +233,31 @@
$carp_instances_counter++;
}
}
- if($pfsync != 0) {
- /*
- * user has selected pfsync, bring it up.
- */
- $carp_sync_int = convert_friendly_interface_to_real_interface_name($config['installedpackages']['carpsettings']['config']['pfsyncinterface']);
- $carp_sync_ip = $config['installedpackages']['carpsettings']['config']['pfsyncip'];
- fwrite($fout, "/sbin/ifconfig pfsync0 create\n");
- fwrite($fout, "/sbin/ifconfig pfsync0 {$carp_sync_ip}/24\n");
- fwrite($fout, "/sbin/ifconfig pfsync0 up syncif " . carp_sync_ip . "\n");
- $pfsync_instances_counter++;
- }
- fwrite($fout, "/etc/rc.filter_configure");
- fclose($fout);
- mwexec("chmod a+x /usr/local/etc/rc.d/carp.sh");
- mwexec("/usr/local/etc/rc.d/carp.sh");
- if($using_arp_balance == 1) system("sysctl net.inet.arpbalance=1");
- if($preempt == 1) system("sysctl net.inet.carp.preempt=1");
- conf_mount_ro();
- config_unlock();
+ if($pfsync != 0) {
+ /*
+ * user has selected pfsync, bring it up.
+ */
+ $carp_sync_int = convert_friendly_interface_to_real_interface_name($config['installedpackages']['carpsettings']['config']['pfsyncinterface']);
+ $carp_sync_ip = $config['installedpackages']['carpsettings']['config']['pfsyncip'];
+ fwrite($fout, "/sbin/ifconfig pfsync0 create\n");
+ fwrite($fout, "/sbin/ifconfig pfsync0 {$carp_sync_ip}/24\n");
+ fwrite($fout, "/sbin/ifconfig pfsync0 up syncif " . carp_sync_ip . "\n");
+ $pfsync_instances_counter++;
+ }
+ $using_arp_balance = 0;
+ $preempt = 0;
+ if($config['installedpackages']['carpsettings']['premption'] != "")
+ $preempt = 1;
+ if($config['installedpackages']['carpsettings']['balancing'] != "")
+ $using_arp_balance = 1;
+ fwrite($fout, "/etc/rc.filter_configure");
+ fclose($fout);
+ mwexec("chmod a+x /usr/local/etc/rc.d/carp.sh");
+ mwexec("/usr/local/etc/rc.d/carp.sh");
+ if($using_arp_balance == 1) system("sysctl net.inet.arpbalance=1");
+ if($preempt == 1) system("sysctl net.inet.carp.preempt=1");
+ conf_mount_ro();
+ config_unlock();
}
</custom_php_command_before_form>
<custom_php_resync_config_command>
diff --git a/packages/carp_settings.xml b/packages/carp_settings.xml
index 2ec27719..2c6a4fe1 100644
--- a/packages/carp_settings.xml
+++ b/packages/carp_settings.xml
@@ -42,6 +42,16 @@
<fielddescr>PFSync Interface</fielddescr>
<fieldname>pfsyncinterface</fieldname>
</columnitem>
+ <columnitem>
+ <fielddescr>Load Balancing</fielddescr>
+ <fieldname>balancing</fieldname>
+ <type>checkbox</type>
+ </columnitem>
+ <columnitem>
+ <fielddescr>Preemption</fielddescr>
+ <fieldname>premption</fieldname>
+ <type>checkbox</type>
+ </columnitem>
</adddeleteeditpagefields>
<!-- fields gets invoked when the user adds or edits a item. the following items
will be parsed and rendered for the user as a gui with input, and selectboxes. -->
@@ -64,6 +74,18 @@
<type>interfaces_selection</type>
<description>If Synchronize State is enabled, it will utilize this interface for communication.</description>
</field>
+ <field>
+ <fielddescr>Load Balancing</fielddescr>
+ <fieldname>balancing</fieldname>
+ <description>If this feature is enabled, CARP source-hashes the originating IP of a request. The hash is then used to select a virtual host from the available pool to handle the request. This is disabled by default.</description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Preemption</fielddescr>
+ <fieldname>premption</fieldname>
+ <description>When preemption is enabled, each CARP host will look at the advskew (Advertising Frequency) parameter in the advertisements it receives from the master, to try to determine whether it can advertise more frequently. If so, it will begin advertising, and the current master, seeing that there is another host with a lower advskew, will bow out.</description>
+ <type>checkbox</type>
+ </field>
</fields>
<custom_php_command_before_form>
</custom_php_command_before_form>