incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [11/29] git commit: refs/heads/ui-multiple-nics - CLOUDSTACK-1362: Put a workaround fix to set excutable attribute of injectkys.sh at runtime
Date Wed, 06 Mar 2013 18:00:04 GMT
CLOUDSTACK-1362: Put a workaround fix to set excutable attribute of injectkys.sh at runtime


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

Branch: refs/heads/ui-multiple-nics
Commit: 72e6fd6e8d6c846057362cd390851d0f70b757c8
Parents: 7602997
Author: Kelven Yang <kelveny@gmail.com>
Authored: Thu Feb 21 14:32:47 2013 -0800
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Tue Mar 5 19:03:30 2013 -0500

----------------------------------------------------------------------
 .../com/cloud/server/ConfigurationServerImpl.java  |   20 +++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/72e6fd6e/server/src/com/cloud/server/ConfigurationServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java
index 9566285..c5ae1e2 100755
--- a/server/src/com/cloud/server/ConfigurationServerImpl.java
+++ b/server/src/com/cloud/server/ConfigurationServerImpl.java
@@ -151,6 +151,8 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
     @DB
     public void persistDefaultValues() throws InternalErrorException {
 
+    	fixupScriptFileAttribute();
+    	
         // Create system user and admin user
         saveUser();
 
@@ -703,6 +705,24 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
         }
 
     }
+    
+	private void fixupScriptFileAttribute() {
+		// TODO : this is a hacking fix to workaround that executable bit is not preserved in WAR
package 
+        String scriptPath = Script.findScript("", "scripts/vm/systemvm/injectkeys.sh");
+        if(scriptPath != null) {
+        	File file = new File(scriptPath);
+        	if(!file.canExecute()) {
+        		s_logger.info("Some of the shell script files may not have executable bit set.
Fixup...");
+        		
+        		String cmd = "chmod ugo+x " + scriptPath;
+        		s_logger.info("Executing " + cmd);
+                String result = Script.runSimpleBashScript(cmd);
+                if (result != null) {
+                    s_logger.warn("Failed to fixup shell script executable bits " + result);
+                }
+        	}
+        }
+	}
 
     private void updateKeyPairsOnDisk(String homeDir) {
         File keyDir = new File(homeDir + "/.ssh");


Mime
View raw message