From fba4849c8e82d17951ee634446fe75bc10087111 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 5 May 2005 03:32:55 +0000 Subject: Setup carp interfaces before setting preempt and bringing them up. --- packages/carp.xml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'packages/carp.xml') diff --git a/packages/carp.xml b/packages/carp.xml index cdf7d11a..13e3b752 100644 --- a/packages/carp.xml +++ b/packages/carp.xml @@ -222,24 +222,8 @@ global $config; $carp_instances_counter = 0; $pfsync_instances_counter = 0; - if($config['installedpackages']['carpsettings']['config'] != "") - foreach($config['installedpackages']['carpsettings']['config'] as $carp) - if($carp['pfsyncenabled'] != "") { - $pfsync = 1; - if($carp['premption'] != "") - fwrite($fout, "/sbin/sysctl net.inet.carp.preempt=1\n"); - if($carp['balancing'] != "") - fwrite($fout, "/sbin/sysctl net.inet.arpbalance=1\n"); - $carp_sync_int = convert_friendly_interface_to_real_interface_name($carp['pfsyncinterface']); - fwrite($fout, "/sbin/ifconfig pfsync0 create\n"); - fwrite($fout, "/sbin/ifconfig pfsync0 syncdev " . $carp_sync_int . "\n"); - fwrite($fout, "/sbin/ifconfig {$carp_sync_int} up\n"); - fwrite($fout, "/sbin/ifconfig pfsync0 up\n"); - fwrite($fout, "sleep 10\n"); - $pfsync_instances_counter++; - } if($config['installedpackages']['carp']['config'] != "") { - foreach($config['installedpackages']['carp']['config'] as $carp) { + foreach($config['installedpackages']['carp']['config'] as $carp) { /* * create the carp interface */ @@ -254,9 +238,25 @@ fwrite($fout, $carp_command . "\n"); fwrite($fout, "/sbin/ifconfig carp{$carp_instances_counter} up\n"); $carp_instances_counter++; - } - } - + } + } + if($config['installedpackages']['carpsettings']['config'] != "") { + foreach($config['installedpackages']['carpsettings']['config'] as $carp) + if($carp['pfsyncenabled'] != "") { + $pfsync = 1; + if($carp['premption'] != "") + fwrite($fout, "/sbin/sysctl net.inet.carp.preempt=1\n"); + if($carp['balancing'] != "") + fwrite($fout, "/sbin/sysctl net.inet.arpbalance=1\n"); + $carp_sync_int = convert_friendly_interface_to_real_interface_name($carp['pfsyncinterface']); + fwrite($fout, "/sbin/ifconfig pfsync0 create\n"); + fwrite($fout, "/sbin/ifconfig pfsync0 syncdev " . $carp_sync_int . "\n"); + fwrite($fout, "/sbin/ifconfig {$carp_sync_int} up\n"); + fwrite($fout, "/sbin/ifconfig pfsync0 up\n"); + fwrite($fout, "sleep 10\n"); + $pfsync_instances_counter++; + } + } fclose($fout); chmod("/usr/local/pkg/pf/carp.sh", 0755); mwexec("/usr/local/pkg/pf/carp.sh"); -- cgit v1.2.3