*/
private class SigKillThread extends Thread {
public void run() {
this.setName(this.getClass().getName() + "-" + String.valueOf(pid));
ShellCommandExecutor shexec = null;
try {
// Sleep for some time before sending SIGKILL
Thread.sleep(sleepTimeBeforeSigKill);
} catch (InterruptedException i) {
LOG.warn("Thread sleep is interrupted.");
}
// Kill the root process with SIGKILL if it is still alive
if (ProcfsBasedProcessTree.this.isAlive(pid)) {
try {
String[] args = { "kill", "-9", pid.toString() };
shexec = new ShellCommandExecutor(args);
shexec.execute();
} catch (IOException ioe) {
LOG.warn("Error executing shell command " + ioe);
} finally {
LOG.info("Killing " + pid + " with SIGKILL. Exit code "
+ shexec.getExitCode());
}
}
}