version 1.35, 2001/12/13 14:54:56
|
version 1.36, 2001/12/20 21:33:04
|
|
|
| |
static const String NAMESPACE = "root/cimv2"; | static const String NAMESPACE = "root/cimv2"; |
static const String CLASSNAME_SHUTDOWNSERVICE = "PG_ShutdownService"; | static const String CLASSNAME_SHUTDOWNSERVICE = "PG_ShutdownService"; |
static const String PROPERTY_TIMEOUT = "timeout"; |
static const String PROPERTY_TIMEOUT = "operationTimeout"; |
| |
ConfigManager* configManager; | ConfigManager* configManager; |
| |
|
|
cout << usage << endl; | cout << usage << endl; |
} | } |
| |
void shutdownCIMOM(Boolean forceOption, String timeoutStr) |
void shutdownCIMOM(Boolean forceOption, Uint32 timeoutValue) |
{ | { |
// | // |
// Create CIMClient object | // Create CIMClient object |
|
|
hostStr.append(":"); | hostStr.append(":"); |
hostStr.append(portNumberStr); | hostStr.append(portNumberStr); |
| |
|
// Put server shutdown message to the logger |
|
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
|
"Shutdown $0 on port $1.", PEGASUS_NAME, portNumberStr); |
|
|
// | // |
// open connection to CIMOM | // open connection to CIMOM |
// | // |
|
|
} | } |
catch(Exception& e) | catch(Exception& e) |
{ | { |
|
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
|
"Failed to connect to $0 $1.", PEGASUS_NAME, e.getMessage()); |
|
|
PEGASUS_STD(cerr) << "Failed to connect to server: " << e.getMessage() << PEGASUS_STD(endl); | PEGASUS_STD(cerr) << "Failed to connect to server: " << e.getMessage() << PEGASUS_STD(endl); |
exit(1); | exit(1); |
} | } |
|
|
} | } |
| |
inParams.append(CIMParamValue( | inParams.append(CIMParamValue( |
CIMParameter("timeout", CIMType::STRING), |
CIMParameter("timeout", CIMType::UINT32), |
CIMValue(timeoutStr))); |
CIMValue(timeoutValue))); |
| |
CIMValue retValue = client.invokeMethod( | CIMValue retValue = client.invokeMethod( |
NAMESPACE, | NAMESPACE, |
|
|
"shutdown", | "shutdown", |
inParams, | inParams, |
outParams); | outParams); |
|
|
|
// Put server shutdown message to the logger |
|
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
|
"$0 terminated on port $1.", PEGASUS_NAME, portNumberStr); |
|
|
} | } |
catch(Exception& e) | catch(Exception& e) |
{ | { |
|
|
} | } |
| |
// | // |
|
// Check the log trace options and set global variable |
|
// |
|
|
|
if (String::equal(configManager->getCurrentValue("logtrace"), "true")) |
|
{ |
|
Handler::setMessageLogTrace(true); |
|
pegasusIOLog = true; |
|
} |
|
|
|
// Get the log file directory definition. |
|
// We put String into Cstring because |
|
// Directory functions only handle Cstring. |
|
// ATTN-KS: create String based directory functions. |
|
|
|
logsDirectory = configManager->getCurrentValue("logdir"); |
|
|
|
// Set up the Logger. This does not open the logs |
|
// Might be more logical to clean before set. |
|
// ATTN: Need tool to completely disable logging. |
|
|
|
Logger::setHomeDirectory(logsDirectory); |
|
|
|
// |
// Check to see if we need to shutdown CIMOM | // Check to see if we need to shutdown CIMOM |
// | // |
if (shutdownOption) | if (shutdownOption) |
|
|
} | } |
} | } |
| |
shutdownCIMOM(forceOption, timeoutStr); |
shutdownCIMOM(forceOption, timeoutValue); |
cout << "Pegasus CIM Server terminated." << endl; | cout << "Pegasus CIM Server terminated." << endl; |
exit(0); | exit(0); |
} | } |
|
|
pegasusIOTrace = true; | pegasusIOTrace = true; |
cout << "Trace Set" << endl; | cout << "Trace Set" << endl; |
} | } |
// |
|
// Check the log trace options and set global variable |
|
// |
|
|
|
if (String::equal(configManager->getCurrentValue("logtrace"), "true")) |
|
{ |
|
Handler::setMessageLogTrace(true); |
|
pegasusIOLog = true; |
|
} |
|
|
|
// Get the log file directory definition. |
|
// We put String into Cstring because |
|
// Directory functions only handle Cstring. |
|
// ATTN-KS: create String based directory functions. |
|
|
|
logsDirectory = configManager->getCurrentValue("logdir"); |
|
|
|
// Set up the Logger. This does not open the logs |
|
// Might be more logical to clean before set. |
|
// ATTN: Need tool to completely disable logging. |
|
| |
Logger::setHomeDirectory(logsDirectory); |
// Leave this in until people get familiar with the logs. |
|
cout << "Logs Directory = " << logsDirectory << endl; |
| |
if (String::equal(configManager->getCurrentValue("cleanlogs"), "true")) | if (String::equal(configManager->getCurrentValue("cleanlogs"), "true")) |
{ | { |
Logger::clean(logsDirectory);; | Logger::clean(logsDirectory);; |
} | } |
| |
// Leave this in until people get familiar with the logs. |
|
cout << "Logs Directory = " << logsDirectory << endl; |
|
|
|
if (String::equal(configManager->getCurrentValue("slp"), "true")) | if (String::equal(configManager->getCurrentValue("slp"), "true")) |
{ | { |
useSLP = true; | useSLP = true; |