Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5E68310D6B for ; Fri, 23 Aug 2013 18:58:43 +0000 (UTC) Received: (qmail 305 invoked by uid 500); 23 Aug 2013 18:58:43 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 99983 invoked by uid 500); 23 Aug 2013 18:58:42 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 99969 invoked by uid 99); 23 Aug 2013 18:58:42 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Aug 2013 18:58:42 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0DA308C3EE0; Fri, 23 Aug 2013 18:58:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yasker@apache.org To: commits@cloudstack.apache.org Date: Fri, 23 Aug 2013 18:58:42 -0000 Message-Id: <448be1109f26431dbbb973b19635bb61@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: updated refs/heads/4.2-forward to 064f6c0 Updated Branches: refs/heads/4.2-forward 829dbaccb -> 064f6c01b CLOUDSTACK-4199: Only use ifdown/ifup for the un-configured eth2 Seems the behavior of ifdown/ifup changed in new version, that it would only enable the default IP of eth2, regardless we can configure additional ips for it. So we would always use ifconfig for interface control whenever possible(a.k.a eth2 already got ip addresses). When VR is booting up, ipassoc command hasn't been delivered, it's possible that eth2 doesn't have any ip address, then ifconfig would fail because it doesn't know how to find the ip for eth2. So in this only case, we would use ifdown/ifup to set the ip address according to /etc/network/interfaces. It can potentially racy againest ipassoc command, but biglock should prevent racy condition from happening. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/82b89338 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/82b89338 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/82b89338 Branch: refs/heads/4.2-forward Commit: 82b8933854517a9f0acd21daba669d155153f9a0 Parents: 829dbac Author: Sheng Yang Authored: Thu Aug 22 17:45:12 2013 -0700 Committer: Sheng Yang Committed: Fri Aug 23 11:58:22 2013 -0700 ---------------------------------------------------------------------- .../config/root/redundant_router/enable_pubip.sh.templ | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/82b89338/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ ---------------------------------------------------------------------- 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 3e22c0d..0e2d03a 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 @@ -16,14 +16,18 @@ # specific language governing permissions and limitations # under the License. +ip link|grep BROADCAST|grep -v eth0|grep -v eth1|cut -d ":" -f 2 > /tmp/iflist +ip addr show eth2 | grep "inet" 2>&1 > /dev/null +is_init=$? + set -e -ip link|grep BROADCAST|grep -v eth0|grep -v eth1|cut -d ":" -f 2 > /tmp/iflist while read i do - if [ "$i" == "eth2" ] + # if eth2'ip has already been configured, we would use ifconfig rather than ifdown/ifup + if [ "$i" == "eth2" -a "$is_init" != "0" ] then - ifdown $i --force + ifdown $i ifup $i else ifconfig $i down