code: public static boolean isProcessRunning(String baseDir)
      {
          File pidFile = new File(baseDir, "pid");
          boolean exists = pidFile.isFile();
          return exists;
      }
docs: Check whether the PID file created by the ES process exists or not.
  @param baseDir the ES base directory
  @return true if the process is running, false otherwise