@Override public boolean matches(Version version) { return Platform.detect().isUnixLike(); }
@Override public boolean matches(Platform platform, Version version) { return platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.6"); }
@Override public ArchiveType getArchiveType(Distribution distribution) { return distribution.getPlatform().isUnixLike() ? TGZ : ZIP; }
@Override public boolean matches(Platform platform, Version version) { return platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.5"); }
@Override public boolean matches(Platform platform, Version version) { return !platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.6"); }
@Override public boolean matches(Platform platform, Version version) { return platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.7") && version.getMinorVersion() > 17; }
@Override public boolean matches(Platform platform, Version version) { return !platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.7") && version.getMinorVersion() > 17; }
@Override public boolean matches(Platform platform, Version version) { return !platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.7") && version.getMinorVersion() <= 17; }
@Override public boolean matches(Platform platform, Version version) { return platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.7") && version.getMinorVersion() <= 17; }
public static boolean termProcess(SupportConfig support,Platform platform, StreamProcessor output, long pid) { return platform.isUnixLike() && ProcessControl.executeCommandLine(support, "[term process]", new ProcessConfig(asList("kill", "" + pid), output)); }
public static boolean killProcess(SupportConfig support,Platform platform, StreamProcessor output, long pid) { return platform.isUnixLike() && ProcessControl.executeCommandLine(support, "[kill process]", new ProcessConfig(asList("kill", "-2", "" + pid), output)); }
@Override public boolean matches(Version version) { return Platform.detect().isUnixLike() && (version.getMajorVersion().equals("5.6") || version.getMajorVersion().equals("5.5")); }
public static boolean killProcess(ISupportConfig support,Platform platform, IStreamProcessor output, long pid) { if (platform.isUnixLike()) { return ProcessControl.executeCommandLine(support, "[kill process]", new ProcessConfig(Collections.newArrayList("kill", "-2", "" + pid), output)); } return false; }
public static boolean termProcess(ISupportConfig support,Platform platform, IStreamProcessor output, long pid) { if (platform.isUnixLike()) { return ProcessControl.executeCommandLine(support, "[term process]", new ProcessConfig(Collections.newArrayList("kill", "" + pid), output)); } return false; }
if (platform.isUnixLike()) { pidof = Runtime.getRuntime().exec( new String[] { "kill", "-0", "" + pid });
public static boolean isProcessRunning(Platform platform, long pid) { try { final Process pidof; if (platform.isUnixLike()) { pidof = Runtime.getRuntime().exec( new String[] { "kill", "-0", "" + pid }); return pidof.waitFor() == 0; } else { // windows // process might be in either NOT RESPONDING due to // firewall blocking, or could be RUNNING final String[] cmd = { "tasklist.exe", "/FI", "PID eq " + pid ,"/FO", "CSV" }; logger.trace("Command: {}", Arrays.asList(cmd)); ProcessBuilder processBuilder = ProcessControl .newProcessBuilder(Arrays.asList(cmd), true); Process process = processBuilder.start(); // look for the PID in the output, pass it in for 'success' state LogWatchStreamProcessor logWatch = new LogWatchStreamProcessor(""+pid, new HashSet<String>(), StreamToLineProcessor.wrap(Processors.silent())); Processors.connect(new InputStreamReader(process.getInputStream()), logWatch); logWatch.waitForResult(2000); logger.trace("logWatch output: {}", logWatch.getOutput()); return logWatch.isInitWithSuccess(); } } catch (IOException | InterruptedException e) { logger.error("Trying to get process status", e); } return false; }
@Override public FileSet getFileSet(Distribution distribution) { String executableName = "influxd"; if (!distribution.getPlatform().isUnixLike()) { executableName += ".exe"; } return FileSet.builder().addEntry(FileType.Executable, executableName).build(); }