You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2015/11/27 20:05:36 UTC

[1/2] git commit: updated refs/heads/4.6 to 92913a1

Repository: cloudstack
Updated Branches:
  refs/heads/4.6 ad2bcc089 -> 92913a154


CLOUDSTACK-9077 Fix injectkeys.sh to work on CentOS7


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

Branch: refs/heads/4.6
Commit: 9b0b69d9c8cb6bdc0232c7af0efcb45974f533d2
Parents: 3f7a86d
Author: Remi Bergsma <gi...@remi.nl>
Authored: Mon Nov 23 13:22:02 2015 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Wed Nov 25 11:26:10 2015 +0100

----------------------------------------------------------------------
 scripts/vm/systemvm/injectkeys.sh | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9b0b69d9/scripts/vm/systemvm/injectkeys.sh
----------------------------------------------------------------------
diff --git a/scripts/vm/systemvm/injectkeys.sh b/scripts/vm/systemvm/injectkeys.sh
index f69e331..6f224cd 100755
--- a/scripts/vm/systemvm/injectkeys.sh
+++ b/scripts/vm/systemvm/injectkeys.sh
@@ -85,14 +85,19 @@ systemvmpath=$3
 
 command -v mkisofs > /dev/null   || (echo "$(basename $0): mkisofs not found, please install or ensure PATH is accurate" ; exit 4)
 
-# if running into Docker as unprivileges, skip ssh verification as iso cannot be mounted.
-if [ -e /dev/loop0 ]; then
+# if running into Docker as unprivileges, skip ssh verification as iso cannot be mounted due to missing loop device.
+if [ -f /.dockerinit ]; then
+  if [ -e /dev/loop0 ]; then
+    # it's a docker instance with privileges.
+    inject_into_iso systemvm.iso $newpubkey
+    [ $? -ne 0 ] && exit 5
+    copy_priv_key $newprivkey
+  else
+    # this mean it's a docker instance, ssh key cannot be verify.
+    echo "We run inside Docker, skipping ssh key insertion in systemvm.iso"
+  fi
+else
   inject_into_iso systemvm.iso $newpubkey
   [ $? -ne 0 ] && exit 5
   copy_priv_key $newprivkey
-else
-  # this mean it's a docker instance, ssh key cannot be verify.
-  echo "No loop device found, skipping ssh key insertion in systemvm.iso"
 fi
-
-exit $?


[2/2] git commit: updated refs/heads/4.6 to 92913a1

Posted by re...@apache.org.
Merge pull request #1109 from remibergsma/fix-CLOUDSTACK-9077

CLOUDSTACK-9077 Fix injectkeys.sh to work on CentOS7Fix regression from commit 3381154fafb7fa4f0a61d538f7c2550e48247787

The error seen on CentOS 7:

```
2015-11-20 21:51:16,161 DEBUG [c.c.s.ConfigurationServerImpl] (localhost-startStop-1:null) No loop device found, skipping ssh key insertion in systemvm.iso
```

Instead of detecting `/dev/loop0` this checks if we run inside Docker.

Tested on CentOS 7 and that now works again as expected.

```
2015-11-23 16:20:16,777 DEBUG [c.c.s.ConfigurationServerImpl] (localhost-startStop-1:null) Executing: /bin/bash /var/lib/tomcat/webapps/client/WEB-INF/classes/scripts/vm/systemvm/injectkeys.sh /home/cloud/.ssh/id_rsa.pub /home/cl
oud/.ssh/id_rsa /var/lib/tomcat/webapps/client/WEB-INF/classes/vms/systemvm.iso
2015-11-23 16:20:16,821 DEBUG [c.c.s.ConfigurationServerImpl] (localhost-startStop-1:null) Execution is successful.
2015-11-23 16:20:16,827 INFO  [c.c.s.ConfigurationServerImpl] (localhost-startStop-1:null) Injected public and private keys into systemvm iso with result : null
```

Pinging @pdion891 to have a look.

* pr/1109:
  CLOUDSTACK-9077 Fix injectkeys.sh to work on CentOS7

Signed-off-by: Remi Bergsma <gi...@remi.nl>


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

Branch: refs/heads/4.6
Commit: 92913a154c00cb57a51e90c9622720062eb6a9cb
Parents: ad2bcc0 9b0b69d
Author: Remi Bergsma <gi...@remi.nl>
Authored: Fri Nov 27 20:05:11 2015 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Fri Nov 27 20:05:11 2015 +0100

----------------------------------------------------------------------
 scripts/vm/systemvm/injectkeys.sh | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------