protected final void stopProcess() { if (process != null) process.stop(); }
protected final void stopProcess() { if (process != null) process.stop(); }
public static boolean isNUMAOnce(SupportConfig support, Platform platform) { if (platform == Platform.Linux) { try { ProcessControl process = ProcessControl .fromCommandLine(support, asList("grep", "NUMA=y", "/boot/config-`uname -r`"), true); Reader reader = process.getReader(); String content = Readers.readAll(reader); process.stop(); boolean isNUMA = !content.isEmpty(); if (isNUMA) { logger.warn("-----------------------------------------------\n" + "NUMA support is still alpha. If you have any Problems with it, please contact us.\n" + "-----------------------------------------------"); } return isNUMA; } catch (IOException ix) { ix.printStackTrace(); } } return false; } }
public static boolean isNUMAOnce(ISupportConfig support, Platform platform) { if (platform == Platform.Linux) { try { ProcessControl process = ProcessControl .fromCommandLine(support, Collections.newArrayList("grep", "NUMA=y", "/boot/config-`uname -r`"), true); Reader reader = process.getReader(); String content = Readers.readAll(reader); process.stop(); boolean isNUMA = !content.isEmpty(); if (isNUMA) { logger.warn("-----------------------------------------------\n" + "NUMA support is still alpha. If you have any Problems with it, please contact us.\n" + "-----------------------------------------------"); } return isNUMA; } catch (IOException ix) { logger.debug("Could not determine presence of NUMA", ix); } } return false; } }
public static boolean executeCommandLine(ISupportConfig support, String label, ProcessConfig processConfig) { boolean ret = false; List<String> commandLine = processConfig.getCommandLine(); try { ProcessControl process = fromCommandLine(support, processConfig.getCommandLine(), processConfig.getError() == null); Processors.connect(process.getReader(), processConfig.getOutput()); Thread.sleep(SLEEPT_TIMEOUT); ret = process.stop() == 0; logger.info("execSuccess: {} {}", ret, commandLine); return ret; } catch (IOException e) { logger.error("" + commandLine, e); } catch (InterruptedException e) { logger.error("" + commandLine, e); } return false; }
public static boolean executeCommandLine(SupportConfig support, String label, ProcessConfig processConfig) { boolean ret; List<String> commandLine = processConfig.getCommandLine(); try { ProcessControl process = fromCommandLine(support, processConfig.getCommandLine(), processConfig.getError() == null); Processors.connect(process.getReader(), processConfig.getOutput()); Thread.sleep(SLEEP_TIMEOUT); ret = process.stop() == 0; logger.info("execSuccess: {} {}", ret, commandLine); return ret; } catch (IOException | InterruptedException e) { logger.error("" + commandLine, e); } return false; }