karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf git commit: [KARAF-3016] Add support of a variable to redirect the instance stdout
Date Tue, 23 Dec 2014 15:27:45 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-3.0.x f455dd3d3 -> 6cd75c91e


[KARAF-3016] Add support of a variable to redirect the instance stdout


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/6cd75c91
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/6cd75c91
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/6cd75c91

Branch: refs/heads/karaf-3.0.x
Commit: 6cd75c91e02be7ee6b9fdc20e072f79044185241
Parents: f455dd3
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Tue Dec 23 16:27:14 2014 +0100
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Tue Dec 23 16:27:14 2014 +0100

----------------------------------------------------------------------
 .../karaf/instance/core/internal/InstanceServiceImpl.java      | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/6cd75c91/instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
----------------------------------------------------------------------
diff --git a/instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
b/instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
index 8afb9ac..fc6ff4d 100644
--- a/instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
+++ b/instance/core/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
@@ -273,6 +273,7 @@ public class InstanceServiceImpl implements InstanceService {
                 mkdir(karafBase, "system", printOutput);
                 mkdir(karafBase, "deploy", printOutput);
                 mkdir(karafBase, "data", printOutput);
+                mkdir(karafBase, "data/log", printOutput);
 
                 copyResourceToDir(karafBase, "etc/all.policy", printOutput);
                 copyResourceToDir(karafBase, "etc/config.properties", printOutput);
@@ -449,7 +450,10 @@ public class InstanceServiceImpl implements InstanceService {
                         + " -Dkaraf.startLocalConsole=false"
                         + " -Dkaraf.startRemoteShell=true"
                         + " -classpath \"" + classpath.toString() + "\""
-                        + " org.apache.karaf.main.Main";
+                        + " org.apache.karaf.main.Main server";
+                if (System.getenv("KARAF_REDIRECT") != null && !System.getenv("KARAF_REDIRECT").isEmpty())
{
+                    command = command + " >> " + System.getenv("KARAF_REDIRECT");
+                }
                 LOGGER.debug("Starting instance " + name + " with command: " + command);
                 org.apache.karaf.jpm.Process process = new ProcessBuilderFactoryImpl().newBuilder()
                         .directory(new File(location))


Mime
View raw message