diff options
Diffstat (limited to 'packages/carp.xml')
-rw-r--r-- | packages/carp.xml | 68 |
1 files changed, 25 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> |