code: @Override
    void launchTaskJVM(TaskController.TaskControllerContext context) 
                                          throws IOException {
      JvmEnv env = context.env;
      // get the JVM command line.
      String cmdLine = 
        TaskLog.buildCommandLine(env.setup, env.vargs, env.stdout, env.stderr,
            env.logSize, true);
  
      StringBuffer sb = new StringBuffer();
      //export out all the environment variable before child command as
      //the setuid/setgid binaries would not be getting, any environmental
      //variables which begin with LD_*.
      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(sb.toString(), getTaskCacheDirectory(context));
      
      // Call the taskcontroller with the right parameters.
      List<String> launchTaskJVMArgs = buildLaunchTaskArgs(context);
      ShellCommandExecutor shExec =  buildTaskControllerExecutor(
                                      TaskCommands.LAUNCH_TASK_JVM, 
                                      env.conf.getUser(),
                                      launchTaskJVMArgs, env.workDir, env.env);
      context.shExec = shExec;
      try {
        shExec.execute();
      } catch (Exception e) {
        LOG.warn("Exception thrown while launching task JVM : " + 
            StringUtils.stringifyException(e));
        LOG.warn("Exit code from task is : " + shExec.getExitCode());
        LOG.warn("Output from task-contoller is : " + shExec.getOutput());
        throw new IOException(e);
      }
      if(LOG.isDebugEnabled()) {
        LOG.debug("output after executing task jvm = " + shExec.getOutput()); 
      }
    }
docs: Launch a task JVM that will run as the owner of the job.
  
  This method launches a task JVM by executing a setuid
  executable that will switch to the user and run the
  task.