code: public void destroy(boolean inBackground) {
      LOG.debug("Killing ProcfsBasedProcessTree of " + pid);
      if (pid == -1) {
        return;
      }
      if (isAlive(pid.toString())) {
        if (isSetsidAvailable && setsidUsed) {
          // In this case, we know that pid got created using setsid. So kill the
          // whole processGroup.
          try {
            assertAndDestroyProcessGroup(pid.toString(), sleeptimeBeforeSigkill,
                                inBackground);
          } catch (IOException e) {
            LOG.warn(StringUtils.stringifyException(e));
          }
        }
        else {
          //TODO: Destroy all the processes in the subtree in this case also.
          // For the time being, killing only the root process.
          destroyProcess(pid.toString(), sleeptimeBeforeSigkill, inBackground);
        }
      }
    }
docs: Destroy the process-tree.
  @param inBackground Process is to be killed in the back ground with
  a separate thread