You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/03/06 19:00:04 UTC
[11/29] git commit: refs/heads/ui-multiple-nics - CLOUDSTACK-1362:
Put a workaround fix to set excutable attribute of injectkys.sh at runtime
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 <ke...@gmail.com>
Authored: Thu Feb 21 14:32:47 2013 -0800
Committer: Kelven Yang <ke...@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");