try {
final Process process = new ProcessBuilder("/bin/sh", "-c", "echo $PPID").start();
try {
Preconditions.checkState(process.waitFor() == 0);
} catch (InterruptedException ie) {
throw new RuntimeInterruptedException(ie);
}
final String pidStr = IOUtils.toString(process.getInputStream()).trim();
return Integer.parseInt(pidStr);
} catch (IOException ioe) {
throw new KijiIOException(ioe);