boolean (int processId, int signal, int ourPid) { if (LOG.isDebugEnabled()) { LOG.debug("Sending signal " + signal + " to process tree with root PID " + processId); } final Ref<Integer> foundPid = new Ref<>(); final ProcessInfo processInfo = new ProcessInfo(); final List<Integer> childrenPids = new ArrayList<>(); findChildProcesses(ourPid, processId, foundPid, processInfo, childrenPids); // result is true if signal was sent to at least one process final boolean result; if (!foundPid.isNull()) { processInfo.killProcTree(foundPid.get(), signal); result = true; } else { for (Integer pid : childrenPids) { processInfo.killProcTree(pid, signal); } result = !childrenPids.isEmpty(); //we've tried to kill at least one process } if (LOG.isDebugEnabled()) { LOG.debug("Done sending signal " + signal + "; found: " + foundPid.get() + ", children: " + childrenPids + ", result: " + result); } return result; }