|
@@ -24,6 +24,8 @@ import java.io.IOException;
|
|
|
import java.io.PrintWriter;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
+import java.util.Map.Entry;
|
|
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
@@ -125,10 +127,19 @@ class LinuxTaskController extends TaskController {
|
|
|
String cmdLine =
|
|
|
TaskLog.buildCommandLine(env.setup, env.vargs, env.stdout, env.stderr,
|
|
|
env.logSize, env.pidFile);
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ //export out all the environment variable before child command.
|
|
|
+ for(Entry<String, String> entry : env.env.entrySet()) {
|
|
|
+ sb.append("export ");
|
|
|
+ sb.append(entry.getKey());
|
|
|
+ sb.append("=");
|
|
|
+ sb.append(entry.getValue());
|
|
|
+ sb.append("\n");
|
|
|
+ }
|
|
|
+ sb.append(cmdLine);
|
|
|
// write the command to a file in the
|
|
|
// task specific cache directory
|
|
|
- writeCommand(cmdLine, getTaskCacheDirectory(context));
|
|
|
-
|
|
|
+ writeCommand(sb.toString(), getTaskCacheDirectory(context));
|
|
|
// Call the taskcontroller with the right parameters.
|
|
|
List<String> launchTaskJVMArgs = buildTaskCommandArgs(context);
|
|
|
ShellCommandExecutor shExec = buildTaskControllerExecutor(
|