From 5a1978382b3ba14ddf9a800345a46c3f7170ec26 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Tue, 9 Aug 2011 22:25:06 -0700 Subject: [PATCH] Fix "RTNETLINK answers: No such process" when starting redundant router The issue happened quite rare, but indeed can show. And when the issue happen, the status of redundant router would be "Status: FAULT". It's due to ipassoc.sh wasn't executed before the system bring eth2 up and go to master mode, then eth2 wasn't configured correctly. Then "ip route add default xx" can't complete. This commit should fixes the issue. --- .../debian/config/etc/init.d/cloud-early-config | 11 ++++++----- .../root/redundant_router/enable_pubip.sh.templ | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index 8856b4a1568..39449f585b7 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -162,7 +162,10 @@ setup_interface() { fi ifdown $intf - ifup $intf + if [ "$RROUTER" != "1" -o "$1" != "2" ] + then + ifup $intf + fi } enable_fwding() { @@ -197,7 +200,7 @@ setup_common() { init_interfaces $1 $2 $3 setup_interface "0" $ETH0_IP $ETH0_MASK $GW setup_interface "1" $ETH1_IP $ETH1_MASK $GW - if [ -n "$ETH2_IP" -a "$RROUTER" != "1" ] + if [ -n "$ETH2_IP" ] then setup_interface "2" $ETH2_IP $ETH2_MASK $GW fi @@ -325,12 +328,10 @@ setup_router() { log_it "Setting up virtual router system vm" if [ -n "$ETH2_IP" ] then + setup_common eth0 eth1 eth2 if [ "$RROUTER" == "1" ] then - setup_common eth0 eth1 setup_redundant_router - else - setup_common eth0 eth1 eth2 fi else setup_common eth0 eth1 diff --git a/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ b/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ index 045eac7d731..93539422753 100644 --- a/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ +++ b/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ @@ -3,7 +3,5 @@ ifconfig eth2 down && \ ifconfig eth2 hw ether [ETH2MAC] && \ ifconfig eth2 up && \ -sleep 3 && \ ip route add 0/0 via [GATEWAY] && \ -sleep 3 && \ service dnsmasq restart