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 93F6BDD21 for ; Fri, 24 May 2013 10:09:52 +0000 (UTC) Received: (qmail 46351 invoked by uid 500); 24 May 2013 10:09:52 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 45407 invoked by uid 500); 24 May 2013 10:09:50 -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 43858 invoked by uid 99); 24 May 2013 10:09:48 -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, 24 May 2013 10:09:48 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4215EE02D; Fri, 24 May 2013 10:09:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: widodh@apache.org To: commits@cloudstack.apache.org Date: Fri, 24 May 2013 10:09:52 -0000 Message-Id: <4698aedf6592484997d1e53aba5b7714@git.apache.org> In-Reply-To: <190347fd66064795bfee9f2f2ec8903b@git.apache.org> References: <190347fd66064795bfee9f2f2ec8903b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/15] git commit: updated refs/heads/rbd-snap-clone to 75c272d CLOUDSTACK-2639: Add flag for booting complete Don't execute any command before VR complete booting up process. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/07715b91 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/07715b91 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/07715b91 Branch: refs/heads/rbd-snap-clone Commit: 07715b91afd44c1ebc0a6977923a0de0f5c1b1ee Parents: 780b45e Author: Sheng Yang Authored: Thu May 23 18:45:38 2013 -0700 Committer: Sheng Yang Committed: Thu May 23 18:46:43 2013 -0700 ---------------------------------------------------------------------- .../debian/config/etc/init.d/cloud-early-config | 3 ++ patches/systemvm/debian/config/etc/rc.local | 3 ++ .../config/opt/cloud/bin/get_template_version.sh | 26 +++++++++++++++ 3 files changed, 32 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07715b91/patches/systemvm/debian/config/etc/init.d/cloud-early-config ---------------------------------------------------------------------- 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 d918670..ca3b970 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -33,6 +33,9 @@ PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" # Fix haproxy directory issue mkdir -p /var/lib/haproxy +# Clear boot up flag, it would be created by rc.local after boot up done +rm /var/cache/cloud/boot_up_done + [ -x /sbin/ifup ] || exit 0 . /lib/lsb/init-functions http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07715b91/patches/systemvm/debian/config/etc/rc.local ---------------------------------------------------------------------- diff --git a/patches/systemvm/debian/config/etc/rc.local b/patches/systemvm/debian/config/etc/rc.local index cb434a2..6119497 100755 --- a/patches/systemvm/debian/config/etc/rc.local +++ b/patches/systemvm/debian/config/etc/rc.local @@ -13,3 +13,6 @@ do logger -t cloud "Stopping $svc" service $svc stop done + +date > /var/cache/cloud/boot_up_done +logger -t cloud "Boot up process done" http://git-wip-us.apache.org/repos/asf/cloudstack/blob/07715b91/patches/systemvm/debian/config/opt/cloud/bin/get_template_version.sh ---------------------------------------------------------------------- diff --git a/patches/systemvm/debian/config/opt/cloud/bin/get_template_version.sh b/patches/systemvm/debian/config/opt/cloud/bin/get_template_version.sh index 298bc38..233ec98 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/get_template_version.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/get_template_version.sh @@ -16,5 +16,31 @@ # specific language governing permissions and limitations # under the License. +# As the last command send to router before any rules operation, wait until boot up done + +__TIMEOUT=60 +__FLAGFILE=/var/cache/cloud/boot_up_done +done=0 +for i in `seq 1 $(($__TIMEOUT * 10))` +do + if [ -e $__FLAGFILE ] + then + done=1 + break + fi + sleep 0.1 + if [ $((i % 10)) -eq 0 ] + then + logger -t cloud "Waiting for VM boot up done for one second" + fi +done + +if [ -z $done ] +then + # declare we failed booting process + echo "Waited 60 seconds but boot up haven't been completed" + exit +fi + echo -n `cat /etc/cloudstack-release`'&' cat /var/cache/cloud/cloud-scripts-signature