version 1.56, 2002/05/31 18:13:24
|
version 1.57, 2002/06/01 00:25:05
|
|
|
// | // |
String hostStr = System::getHostName(); | String hostStr = System::getHostName(); |
| |
// Put server shutdown message to the logger |
|
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
|
"Stopping $0 version $1", PEGASUS_NAME, PEGASUS_VERSION); |
|
|
|
// | // |
// open connection to CIMOM | // open connection to CIMOM |
// | // |
|
|
// Might be more logical to clean before set. | // Might be more logical to clean before set. |
// ATTN: Need tool to completely disable logging. | // ATTN: Need tool to completely disable logging. |
| |
|
#ifndef PEGASUS_OS_HPUX |
Logger::setHomeDirectory(logsDirectory); | Logger::setHomeDirectory(logsDirectory); |
|
#endif |
| |
// | // |
// Check to see if we need to shutdown CIMOM | // Check to see if we need to shutdown CIMOM |
|
|
httpsPort = configManager->getCurrentValue("httpsPort"); | httpsPort = configManager->getCurrentValue("httpsPort"); |
| |
// Leave this in until people get familiar with the logs. | // Leave this in until people get familiar with the logs. |
|
#ifndef PEGASUS_OS_HPUX |
cout << "Logs Directory = " << logsDirectory << endl; | cout << "Logs Directory = " << logsDirectory << endl; |
|
#endif |
| |
if (String::equal(configManager->getCurrentValue("cleanlogs"), "true")) | if (String::equal(configManager->getCurrentValue("cleanlogs"), "true")) |
{ | { |
|
|
exit(-1); | exit(-1); |
} | } |
| |
// Put server starting message to the logger |
|
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
|
"Starting $0 version $1 on port $2 $3 $4 $5", |
|
PEGASUS_NAME, |
|
PEGASUS_VERSION, |
|
address, |
|
(useSLP ? " SLP on " : " SLP off "), |
|
(useSSL ? " Use SSL " : " No SSL ")); |
|
|
|
// try loop to bind the address, and run the server | // try loop to bind the address, and run the server |
try | try |
{ | { |
|
|
| |
// Put server started message to the logger | // Put server started message to the logger |
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, | Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
"$0 started.", PEGASUS_NAME); |
"Started $0 version $1 on port $2.", |
|
PEGASUS_NAME, PEGASUS_VERSION, address); |
|
|
| |
// | // |
// Loop to call CIMServer's runForever() method until CIMServer | // Loop to call CIMServer's runForever() method until CIMServer |
|
|
catch(Exception& e) | catch(Exception& e) |
{ | { |
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, | Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
"$0 Abnormal Termination.", e.getMessage()); |
"$0 .Abnormal Termination.", e.getMessage()); |
| |
PEGASUS_STD(cerr) << "Error: " << e.getMessage() << PEGASUS_STD(endl); | PEGASUS_STD(cerr) << "Error: " << e.getMessage() << PEGASUS_STD(endl); |
return 1; | return 1; |