/** * Start the OpenNMS daemon. Never returns. */ public void start() { Starter starter = new Starter(); starter.startDaemon(); }
/** * <p>startDaemon</p> */ public void startDaemon() { try { setLogPrefix(); setDefaultProperties(); start(); } catch(Exception e) { die("Exception during startup: " + e.getMessage(), e); } }
/** * <p>startDaemon</p> */ public void startDaemon() { configureLog4j(); setLogPrefix(); setupMx4jLogger(); loadGlobalProperties(); setDefaultProperties(); start(); }
log().debug("System property '" + entry.getKey() + "' already set to value '" + entry.getValue() + "'."); File propertiesFile = getPropertiesFile(); if (!propertiesFile.exists()) { props.load(in); } catch (IOException e) { die("Error trying to read properties file '" + propertiesFile + "': " + e, e); } finally { IOUtils.closeQuietly(in); String systemValue = System.getProperty(entry.getKey().toString()); if (systemValue != null) { log().debug("Property '" + entry.getKey() + "' from " + propertiesFile + " already exists as a system property (with value '" + systemValue + "'). Not overridding existing system property."); } else { log().debug("Setting system property '" + entry.getKey() + "' to '" + entry.getValue() + "' from " + propertiesFile + "."); System.setProperty(entry.getKey().toString(), entry.getValue().toString());
public void die(String message) { die(message, null); }
private void setDefaultProperties() { setupFileResourceProperty("opennms.library.jicmp", System.mapLibraryName("jicmp"), "Initialization of ICMP socket will likely fail."); setupFileResourceProperty("opennms.library.jrrd", System.mapLibraryName("jrrd"), "Initialization of RRD code will likely fail if the JniRrdStrategy is used."); setupFileResourceProperty("jcifs.properties", "jcifs.properties", "Initialization of JCIFS will likely fail or may be improperly configured."); }
private void die(String message) { die(message, null); }
private void setDefaultProperties() { setupFileResourceProperty("opennms.library.jicmp", System.mapLibraryName("jicmp"), "Initialization of ICMP socket will likely fail."); try { setupFileResourceProperty("opennms.library.jicmp6", System.mapLibraryName("jicmp6"), "Initialization of ICMPv6 socket will likely fail."); } catch (Throwable e) { LOG.warn("Could not resolve library path for jicmp6: " + e.getMessage(), e); } setupFileResourceProperty("opennms.library.jrrd", System.mapLibraryName("jrrd"), "Initialization of RRD code will likely fail if the JniRrdStrategy is used."); setupFileResourceProperty("jcifs.properties", "jcifs.properties", "Initialization of JCIFS will likely fail or may be improperly configured."); }
/** * Start the OpenNMS daemon. Never returns. */ public void start() { Starter starter = new Starter(); starter.startDaemon(); }
private void configureLog4j() { File homeDir = new File(System.getProperty("opennms.home")); File etcDir = new File(homeDir, "etc"); File xmlFile = new File(etcDir, "log4j.xml"); if (xmlFile.exists()) { DOMConfigurator.configureAndWatch(xmlFile.getAbsolutePath()); } else { File propertiesFile = new File(etcDir, "log4j.properties"); if (propertiesFile.exists()) { PropertyConfigurator.configureAndWatch(propertiesFile.getAbsolutePath()); } else { die("Could not find a Log4j configuration file at " + xmlFile.getAbsolutePath() + " or " + propertiesFile.getAbsolutePath() + ". Exiting."); } } /* * This is causing infinite recursion on exit * CaptchaStds.captchaStdOut(); */ }