You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2014/11/27 12:24:48 UTC

git commit: updated refs/heads/4.3 to 0a935a3

Repository: cloudstack
Updated Branches:
  refs/heads/4.3 8de489469 -> 0a935a336


CLOUDSTACK-2823: Loop through cmdline when patching routers

Backported from https://reviews.apache.org/r/25585/diff which did not merge
this fix on 4.3 branch. Occasionally the while loop can exit with no data (Probably
 recieving an EOF) before receiveing CMDline data from the certial port.
Continue looping until cmdline is populated

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0a935a33
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0a935a33
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0a935a33

Branch: refs/heads/4.3
Commit: 0a935a336ebf9dcc1c3b25a56f629bb9a217b56f
Parents: 8de4894
Author: David Bierce <da...@appcore.com>
Authored: Thu Nov 27 16:50:51 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Thu Nov 27 16:54:34 2014 +0530

----------------------------------------------------------------------
 .../debian/config/etc/init.d/cloud-early-config | 23 +++++++++++---------
 1 file changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0a935a33/systemvm/patches/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
index a34db68..e46db2b 100755
--- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config
+++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config
@@ -117,16 +117,19 @@ get_boot_params() {
           if [ ! -e /dev/vport0p1 ]; then
             log_it "/dev/vport0p1 not loaded, perhaps guest kernel is too old." && exit 2
           fi
-          while read line; do
-            if [[ $line == cmdline:* ]]; then
-              cmd=${line//cmdline:/}
-              echo $cmd > /var/cache/cloud/cmdline
-            elif [[ $line == pubkey:* ]]; then
-              pubkey=${line//pubkey:/}
-              echo $pubkey > /var/cache/cloud/authorized_keys
-              echo $pubkey > /root/.ssh/authorized_keys
-            fi
-          done < /dev/vport0p1
+
+          while [$cmd -eq ""]; do
+              while read line; do
+                if [[ $line == cmdline:* ]]; then
+                  cmd=${line//cmdline:/}
+                  echo $cmd > /var/cache/cloud/cmdline
+                elif [[ $line == pubkey:* ]]; then
+                  pubkey=${line//pubkey:/}
+                  echo $pubkey > /var/cache/cloud/authorized_keys
+                  echo $pubkey > /root/.ssh/authorized_keys
+                fi
+              done < /dev/vport0p1
+          done
           chmod go-rwx /root/.ssh/authorized_keys
           ;;
      vmware)