diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2008-01-21 21:56:49 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2008-01-21 21:56:49 -0800 |
commit | 16031470e620e2310935795cd110eceec7995712 (patch) | |
tree | 0d09c41004a1fe774eb32081ab068d0395fb56a9 | |
parent | c3f28ce3332dfa5ccc3ac658df876d7cd444eea5 (diff) | |
download | vyatta-cfg-system-16031470e620e2310935795cd110eceec7995712.tar.gz vyatta-cfg-system-16031470e620e2310935795cd110eceec7995712.zip |
At bootup vrrp needs to skip vlan interfaces that haven't been instantiated yet
-rwxr-xr-x | scripts/keepalived/vyatta-keepalived.pl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/keepalived/vyatta-keepalived.pl b/scripts/keepalived/vyatta-keepalived.pl index f024f88a..e70732a7 100755 --- a/scripts/keepalived/vyatta-keepalived.pl +++ b/scripts/keepalived/vyatta-keepalived.pl @@ -111,7 +111,7 @@ sub keepalived_get_values { $output .= "\"$state_transition_script master $intf $group @vips\" \n"; $output .= "\tnotify_backup "; $output .= "\"$state_transition_script backup $intf $group @vips\" \n"; - $output .= "\t notify_fault "; + $output .= "\tnotify_fault "; $output .= "\"$state_transition_script fault $intf $group @vips\" \n"; $output .= "\}\n"; } @@ -154,10 +154,20 @@ sub vrrp_update_config { $config->setLevel($path); my @vifs = $config->listNodes(); foreach my $vif (@vifs) { + # + # keepalived gets real grumpy with interfaces that don't + # exist, so skip vlans that haven't been instantiated + # yet (typically occurs at boot up). + # + my $vif_intf = $eth . "." . $vif; + if (!(-d "/sys/class/net/$vif_intf")) { + VyattaKeepalived::vrrp_log("skipping $vif_intf"); + next; + } my $vif_path = "$path $vif"; $config->setLevel($vif_path); if ($config->exists("vrrp")) { - $output .= keepalived_get_values("$eth.$vif", $vif_path); + $output .= keepalived_get_values($vif_intf, $vif_path); $vrrp_instances++; } } |