getWatchdogAddress(),
getWatchdogPort()));
log.fine(this + " starting ResinWatchdogManager");
Path resinHome = getResinHome();
Path resinRoot = getRootDirectory();
ProcessBuilder builder = new ProcessBuilder();
builder.directory(new File(resinRoot.getNativePath()));
Map<String,String> env = builder.environment();
env.putAll(System.getenv());
String classPath = WatchdogArgs.calculateClassPath(resinHome);
env.put("CLASSPATH", classPath);
String libexecPath;
if (is64bit()) {
libexecPath = resinHome.lookup("libexec64").getNativePath();
appendEnvPath(env, "LD_LIBRARY_PATH", libexecPath);
appendEnvPath(env, "LD_LIBRARY_PATH_64", libexecPath);
appendEnvPath(env, "DYLD_LIBRARY_PATH", libexecPath);
if (CauchoSystem.isWindows())
appendEnvPath(env, "Path", resinHome.lookup("win64").getNativePath());
}
else {
libexecPath = resinHome.lookup("libexec").getNativePath();
appendEnvPath(env, "LD_LIBRARY_PATH", libexecPath);
appendEnvPath(env, "DYLD_LIBRARY_PATH", libexecPath);
if (CauchoSystem.isWindows())
appendEnvPath(env, "Path", resinHome.lookup("win32").getNativePath());
}
ArrayList<String> list = new ArrayList<String>();
list.add(_config.getJavaExe());
// #3759 - user args are first so they're displayed by ps
list.addAll(_config.getWatchdogJvmArgs());
list.add("-Dresin.watchdog=" + _id);
list.add("-Djava.util.logging.manager=com.caucho.log.LogManagerImpl");
list.add("-Djavax.management.builder.initial=com.caucho.jmx.MBeanServerBuilderImpl");
list.add("-Djava.awt.headless=true");
list.add("-Dresin.home=" + resinHome.getFullPath());
list.add("-Dresin.root=" + resinRoot.getFullPath());
for (int i = 0; i < argv.length; i++) {
if (argv[i].startsWith("-Djava.class.path=")) {
// IBM JDK startup issues
}