version 1.17, 2005/04/18 20:35:29
|
version 1.19, 2005/09/29 20:15:42
|
|
|
| |
AutoPtr<CIMServerProcess> _cimServerProcess(new CIMServerProcess()); | AutoPtr<CIMServerProcess> _cimServerProcess(new CIMServerProcess()); |
static CIMServer* _cimServer = 0; | static CIMServer* _cimServer = 0; |
|
static Monitor* _monitor = 0; |
| |
// | // |
// The command name. | // The command name. |
|
|
delete _cimServer; | delete _cimServer; |
_cimServer = 0; | _cimServer = 0; |
} | } |
|
|
|
if (_monitor) |
|
{ |
|
delete _monitor; |
|
} |
} | } |
| |
// l10n | // l10n |
|
|
#endif | #endif |
| |
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ | #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ |
|| defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) \ |
|| defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_SOLARIS) \ |
|| defined (PEGASUS_OS_VMS) | || defined (PEGASUS_OS_VMS) |
if (kill_rc != -1) | if (kill_rc != -1) |
{ | { |
|
|
portNumberHttps = strtol(portString, &end, 10); | portNumberHttps = strtol(portString, &end, 10); |
if(!(end != 0 && *end == '\0')) | if(!(end != 0 && *end == '\0')) |
{ | { |
PEGASUS_STD(cerr) << "Bad HTTPS Port Value" << PEGASUS_STD(endl); |
InvalidPropertyValue e("httpsPort", httpsPort); |
|
cerr << e.getMessage() << endl; |
exit(1); | exit(1); |
} | } |
} | } |
|
|
portNumberHttp = strtol(portString, &end, 10); | portNumberHttp = strtol(portString, &end, 10); |
if(!(end != 0 && *end == '\0')) | if(!(end != 0 && *end == '\0')) |
{ | { |
PEGASUS_STD(cerr) << "Bad HTTP Port Value" << PEGASUS_STD(endl); |
InvalidPropertyValue e("httpPort", httpPort); |
|
cerr << e.getMessage() << endl; |
exit(1); | exit(1); |
} | } |
} | } |
|
|
| |
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ | #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ |
|| defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \ | || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \ |
|| defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) || defined (PEGASUS_OS_VMS) |
|| defined(PEGASUS_OS_SOLARIS) || defined (PEGASUS_OS_VMS) |
umask(S_IWGRP|S_IWOTH); | umask(S_IWGRP|S_IWOTH); |
| |
// | // |
|
|
try | try |
{ | { |
| |
Monitor monitor; |
_monitor = new Monitor(); |
//PEP#222 | //PEP#222 |
//CIMServer server(&monitor); | //CIMServer server(&monitor); |
//CimserverHolder cimserverHolder( &server ); | //CimserverHolder cimserverHolder( &server ); |
_cimServer = new CIMServer(&monitor); |
_cimServer = new CIMServer(_monitor); |
| |
| |
if (enableHttpConnection) | if (enableHttpConnection) |
|
|
#endif | #endif |
| |
// bind throws an exception if the bind fails | // bind throws an exception if the bind fails |
|
try { |
_cimServer->bind(); | _cimServer->bind(); |
|
} catch (const BindFailedException &e) |
|
{ |
|
#ifdef PEGASUS_DEBUG |
|
MessageLoaderParms parms("src.Server.cimserver.BIND_FAILED", |
|
"Could not bind: $0.", e.getMessage()); |
|
cout << MessageLoader::getMessage(parms) << endl; |
|
#endif |
|
Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE, |
|
"src.Server.cimserver.BIND.FAILED", |
|
"Could not bind: $0", e.getMessage()); |
| |
|
deleteCIMServer(); |
|
return 1; |
|
} |
// notify parent process (if there is a parent process) to terminate | // notify parent process (if there is a parent process) to terminate |
// so user knows that there is cimserver ready to serve CIM requests. | // so user knows that there is cimserver ready to serve CIM requests. |
if (daemonOption) | if (daemonOption) |
|
|
time_t last = 0; | time_t last = 0; |
| |
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_LINUX) || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) \ | #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_OS_LINUX) || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) \ |
|| defined(PEGASUS_OS_AIX) || defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) \ |
|| defined(PEGASUS_OS_AIX) || defined(PEGASUS_OS_SOLARIS) \ |
|| defined(PEGASUS_OS_VMS) | || defined(PEGASUS_OS_VMS) |
// | // |
// create a file to indicate that the cimserver has started and | // create a file to indicate that the cimserver has started and |
|
|
| |
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ | #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ |
|| defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \ | || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \ |
|| defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) || defined(PEGASUS_OS_VMS) |
|| defined(PEGASUS_OS_SOLARIS) || defined(PEGASUS_OS_VMS) |
// | // |
// close the file created at startup time to indicate that the | // close the file created at startup time to indicate that the |
// cimserver has terminated normally. | // cimserver has terminated normally. |