You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by an...@apache.org on 2011/04/14 14:54:35 UTC
svn commit: r1092205 - in /incubator/ace/trunk:
ace-nodelauncher-amazon/src/main/java/org/apache/ace/nodelauncher/amazon/AmazonNodeLauncher.java
ace-target-devserver/src/main/resources/conf/org.apache.ace.nodelauncher.amazon.cfg
Author: angelos
Date: Thu Apr 14 12:54:35 2011
New Revision: 1092205
URL: http://svn.apache.org/viewvc?rev=1092205&view=rev
Log:
The NodeLauncher now contains the option to run as root; this is useful when launching an application that will need to use port 80.
Modified:
incubator/ace/trunk/ace-nodelauncher-amazon/src/main/java/org/apache/ace/nodelauncher/amazon/AmazonNodeLauncher.java
incubator/ace/trunk/ace-target-devserver/src/main/resources/conf/org.apache.ace.nodelauncher.amazon.cfg
Modified: incubator/ace/trunk/ace-nodelauncher-amazon/src/main/java/org/apache/ace/nodelauncher/amazon/AmazonNodeLauncher.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-nodelauncher-amazon/src/main/java/org/apache/ace/nodelauncher/amazon/AmazonNodeLauncher.java?rev=1092205&r1=1092204&r2=1092205&view=diff
==============================================================================
--- incubator/ace/trunk/ace-nodelauncher-amazon/src/main/java/org/apache/ace/nodelauncher/amazon/AmazonNodeLauncher.java (original)
+++ incubator/ace/trunk/ace-nodelauncher-amazon/src/main/java/org/apache/ace/nodelauncher/amazon/AmazonNodeLauncher.java Thu Apr 14 12:54:35 2011
@@ -49,7 +49,7 @@ import static org.jclouds.compute.predic
* about this.<br><br>
*
* After the node has been started up, this service will install a management agent on it. For this
- * to work, there should be an ace-launcer in the OBR of the server the node should connect to.
+ * to work, there should be an ace-launcher in the OBR of the server the node should connect to.
*/
public class AmazonNodeLauncher implements NodeLauncher, ManagedService {
public static final String PID = "org.apache.ace.nodelauncher.amazon";
@@ -110,6 +110,11 @@ public class AmazonNodeLauncher implemen
public static final String EXTRA_PORTS = "extraPorts";
/**
+ * Configuration key: Should we run the process as root?
+ */
+ public static final String RUN_AS_ROOT = "runAsRoot";
+
+ /**
* Default set of ports to open on a node.
*/
public static final int[] DEFAULT_PORTS = new int[] {22, 80, 8080};
@@ -124,6 +129,7 @@ public class AmazonNodeLauncher implemen
private String m_nodeBootstrap;
private String m_launcherArguments;
private String m_extraPorts;
+ private boolean m_runAsRoot;
private ComputeServiceContext m_computeServiceContext;
@@ -146,6 +152,7 @@ public class AmazonNodeLauncher implemen
int[] inboundPorts = mergePorts(DEFAULT_PORTS, extraPorts);
template.getOptions().as(EC2TemplateOptions.class).inboundPorts(inboundPorts);
template.getOptions().blockOnComplete(false);
+ template.getOptions().runAsRoot(m_runAsRoot);
Set<? extends NodeMetadata> tag = computeService.createNodesInGroup(m_tagPrefix + id, 1, template);
System.out.println("In case you need it, this is the key to ssh to " + id + ":\n"
@@ -238,6 +245,7 @@ public class AmazonNodeLauncher implemen
String tagPrefix = getConfigProperty(properties, TAG_PREFIX, "");
String launcherArguments = getConfigProperty(properties, LAUNCHER_ARGUMENTS, "");
String extraPorts = getConfigProperty(properties, EXTRA_PORTS, "");
+ String runAsRoot = getConfigProperty(properties, RUN_AS_ROOT, "false");
m_server = server;
m_amiId = amiId;
@@ -249,6 +257,7 @@ public class AmazonNodeLauncher implemen
m_nodeBootstrap = nodeBootstrap;
m_launcherArguments = launcherArguments;
m_extraPorts = extraPorts;
+ m_runAsRoot = "true".equals(runAsRoot);
}
}
Modified: incubator/ace/trunk/ace-target-devserver/src/main/resources/conf/org.apache.ace.nodelauncher.amazon.cfg
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-target-devserver/src/main/resources/conf/org.apache.ace.nodelauncher.amazon.cfg?rev=1092205&r1=1092204&r2=1092205&view=diff
==============================================================================
--- incubator/ace/trunk/ace-target-devserver/src/main/resources/conf/org.apache.ace.nodelauncher.amazon.cfg (original)
+++ incubator/ace/trunk/ace-target-devserver/src/main/resources/conf/org.apache.ace.nodelauncher.amazon.cfg Thu Apr 14 12:54:35 2011
@@ -15,3 +15,6 @@ nodeBootstrap=wget -Ojava.bin http://jav
# Open up any extra ports (comma separated list)
extraPorts=9090
+
+# Should we run the process as root? This only works if your account is in the sudoers file.
+runAsRoot=true
\ No newline at end of file