org.linkedin.util-core/src/main/java/org/linkedin/util/concurrent/ExternalCommand.java
public int waitFor() throws InterruptedException
  {
    if(_process == null)
      throw new IllegalStateException("you must call start first");

    _out.join();
    _err.join();
    return _process.waitFor();
  }
public int waitFor() throws InterruptedException
  {
    if(_process == null)
      throw new IllegalStateException("you must call start first");

    _out.join();
    _err.join();
    return _process.waitFor();
  }
Properly waits until everything is complete: joins on the thread that
reads the output, joins on the thread that reads the error and finally
wait for the process to be finished.
@return the status code of the process.

@throws InterruptedException