diff options
Diffstat (limited to 'scripts/keepalived')
-rwxr-xr-x | scripts/keepalived/vyatta-keepalived.pl | 7 | ||||
-rwxr-xr-x | scripts/keepalived/vyatta-show-vrrp.pl | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/scripts/keepalived/vyatta-keepalived.pl b/scripts/keepalived/vyatta-keepalived.pl index ada5e367..c41fa7e2 100755 --- a/scripts/keepalived/vyatta-keepalived.pl +++ b/scripts/keepalived/vyatta-keepalived.pl @@ -74,6 +74,10 @@ sub keepalived_get_values { if (!defined $preempt) { $preempt = "true"; } + my $preempt_delay = $config->returnValue("preempt-delay"); + if (defined $preempt_delay and $preempt eq "false") { + print "Warning: preempt delay is ignored when preempt=false\n"; + } my $advert_int = $config->returnValue("advertise-interval"); if (!defined $advert_int) { $advert_int = 1; @@ -121,6 +125,9 @@ sub keepalived_get_values { if ($preempt eq "false") { $output .= "\tnopreempt\n"; } + if (defined $preempt_delay) { + $output .= "\tpreempt_delay $preempt_delay\n"; + } $output .= "\tadvert_int $advert_int\n"; if (defined $auth_type) { $output .= "\tauthentication {\n"; diff --git a/scripts/keepalived/vyatta-show-vrrp.pl b/scripts/keepalived/vyatta-show-vrrp.pl index 98fb376e..e8157d21 100755 --- a/scripts/keepalived/vyatta-show-vrrp.pl +++ b/scripts/keepalived/vyatta-show-vrrp.pl @@ -130,8 +130,8 @@ sub get_master_info { } if ( -f $master_file) { - my $master_ip = `grep ip.src $master_file`; - my $master_mac = `grep eth.src $master_file`; + my $master_ip = `grep ip.src $master_file 2> /dev/null`; + my $master_mac = `grep eth.src $master_file 2> /dev/null`; chomp $master_ip; chomp $master_mac; # regex for show="xx:xx:xx:xx:xx:xx @@ -141,7 +141,7 @@ sub get_master_info { $master_mac = uc($1); if ($arp_mac ne $master_mac) { VyattaKeepalived::snoop_for_master($intf, $group, $vip, 2); - $master_ip = `grep ip.src $master_file`; + $master_ip = `grep ip.src $master_file 2> /dev/null`; } } @@ -154,7 +154,7 @@ sub get_master_info { system("mv $master_file /tmp"); } - my $priority = `grep vrrp.prio $master_file`; + my $priority = `grep vrrp.prio $master_file 2> /dev/null`; chomp $priority; if (defined $priority and $priority =~ m/show=\"(\d+)\"/) { $priority = $1; |