version 1.52, 2002/05/18 00:51:16
|
version 1.53, 2002/05/21 19:08:44
|
|
|
CIMClient client; | CIMClient client; |
| |
// | // |
// Get the port number |
// Get local host name |
// | // |
String portNumberStr = configManager->getCurrentValue("port"); |
|
|
|
String hostStr = System::getHostName(); | String hostStr = System::getHostName(); |
hostStr.append(":"); |
|
hostStr.append(portNumberStr); |
|
| |
// Put server shutdown message to the logger | // Put server shutdown message to the logger |
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, | Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
"Shutdown $0 on port $1.", PEGASUS_NAME, portNumberStr); |
"Shutdown $0.", PEGASUS_NAME); |
| |
// | // |
// open connection to CIMOM | // open connection to CIMOM |
|
|
// | // |
String referenceStr = "//"; | String referenceStr = "//"; |
referenceStr.append(hostStr); | referenceStr.append(hostStr); |
referenceStr.append("/root/cimv2:PG_ShutdownService"); |
referenceStr.append(PEGASUS_NAMESPACENAME_CIMV2); |
|
referenceStr.append(":"); |
|
referenceStr.append(PEGASUS_CLASSNAME_SHUTDOWN); |
CIMObjectPath reference(referenceStr); | CIMObjectPath reference(referenceStr); |
| |
// | // |
|
|
| |
// Put server shutdown message to the logger | // Put server shutdown message to the logger |
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, | Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
"$0 terminated on port $1.", PEGASUS_NAME, portNumberStr); |
"$0 terminated.", PEGASUS_NAME); |
| |
} | } |
catch(CIMClientCIMException& e) | catch(CIMClientCIMException& e) |
|
|
// cimserver has been terminated | // cimserver has been terminated |
// Put server shutdown message to the logger | // Put server shutdown message to the logger |
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, | Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
"$0 terminated on port $1.", PEGASUS_NAME, portNumberStr); |
"$0 terminated.", PEGASUS_NAME); |
} | } |
else | else |
{ | { |
|
|
String pegasusHome = String::EMPTY; | String pegasusHome = String::EMPTY; |
Boolean pegasusIOTrace = false; | Boolean pegasusIOTrace = false; |
Boolean pegasusIOLog = false; | Boolean pegasusIOLog = false; |
String portOption = String::EMPTY; |
String httpPort = String::EMPTY; |
|
String httpsPort = String::EMPTY; |
String logsDirectory = String::EMPTY; | String logsDirectory = String::EMPTY; |
Boolean useSLP = false; | Boolean useSLP = false; |
Boolean useSSL = false; | Boolean useSSL = false; |
|
|
} | } |
| |
// | // |
// Grab the port option: |
// Get the port numbers |
// | // |
| |
portOption = configManager->getCurrentValue("port"); |
httpPort = configManager->getCurrentValue("httpPort"); |
|
|
|
httpsPort = configManager->getCurrentValue("httpsPort"); |
| |
// | // |
// Check the trace options and set global variable | // Check the trace options and set global variable |
|
|
cout << "Error: " << e.getMessage() << endl; | cout << "Error: " << e.getMessage() << endl; |
} | } |
| |
char* address = portOption.allocateCString(); |
Uint32 portNumber; |
|
|
|
char address[32]; |
|
|
|
if (useSSL) |
|
{ |
|
char* p = httpsPort.allocateCString(); |
|
char* end = 0; |
|
Uint32 port = strtol(p, &end, 10); |
|
assert(end != 0 && *end == '\0'); |
|
delete [] p; |
|
|
|
// |
|
// Look up the WBEM-HTTPS port number |
|
// |
|
portNumber = System::lookupPort(WBEM_HTTPS_SERVICE_NAME, port); |
|
sprintf(address, "%u", portNumber); |
|
} |
|
else |
|
{ |
|
char* p = httpPort.allocateCString(); |
|
char* end = 0; |
|
Uint32 port = strtol(p, &end, 10); |
|
assert(end != 0 && *end == '\0'); |
|
delete [] p; |
|
|
|
// |
|
// Look up the WBEM-HTTP port number |
|
// |
|
portNumber = System::lookupPort(WBEM_HTTP_SERVICE_NAME, port); |
|
sprintf(address, "%u", portNumber); |
|
} |
| |
// Put out startup up message. | // Put out startup up message. |
cout << PEGASUS_NAME << PEGASUS_VERSION << | cout << PEGASUS_NAME << PEGASUS_VERSION << |
|
|
cout << "Binding to " << address << endl; | cout << "Binding to " << address << endl; |
#endif | #endif |
| |
char* end = 0; |
|
long portNumber = strtol(address, &end, 10); |
|
assert(end != 0 && *end == '\0'); |
|
server.bind(portNumber); | server.bind(portNumber); |
| |
delete [] address; |
|
|
|
time_t last = 0; | time_t last = 0; |
| |
#if defined(PEGASUS_OS_HPUX) | #if defined(PEGASUS_OS_HPUX) |