private void findServerProcess(List servers, String query, String version) { long[] pids = getPids(query); for (int i = 0; i < pids.length; i++) { String httpd; if ((httpd = getProcExe(pids[i])) == null) { httpd = getConfigProperty("exe"); } if (httpd == null) { continue; } String[] args = getProcArgs(pids[i]); if (!new File(httpd).isAbsolute()) { String exe = findAbsoluteExe(httpd, args); if (exe == null) { log.warn( "Unable to get absolute path for pid=" + pids[i] + ", args=" + java.util.Arrays.asList(args)); if (!new File(httpd).exists()) { continue; } // else fallthru.. unlikely, but permit an ln -s workaround } else { httpd = exe; } } ApacheBinaryInfo info = ApacheBinaryInfo.getInfo(httpd, version); if (info == null) { continue; } info.pid = pids[i]; getServerInfo(info, args); if (info.root == null) { continue; } servers.add(info); } }