version 1.228, 2008/12/16 18:58:05
|
version 1.238, 2011/02/16 06:44:31
|
|
|
#include <Service/ServerRunStatus.h> | #include <Service/ServerRunStatus.h> |
| |
#if defined(PEGASUS_OS_ZOS) | #if defined(PEGASUS_OS_ZOS) |
#include <Pegasus/Common/SetFileDescriptorToEBCDICEncoding.h> |
#include <Pegasus/General/SetFileDescriptorToEBCDICEncoding.h> |
#include <Service/ARM_zOS.h> | #include <Service/ARM_zOS.h> |
|
#include <Service/TimeZone_zOS.h> |
|
#include <Service/WaitForTCPIP_zOS.h> |
# ifdef PEGASUS_ZOS_SECURITY | # ifdef PEGASUS_ZOS_SECURITY |
// This include file will not be provided in the OpenGroup CVS for now. | // This include file will not be provided in the OpenGroup CVS for now. |
// Do NOT try to include it in your compile | // Do NOT try to include it in your compile |
|
|
usage.append(" [ [ options ] | [ configProperty=value, ... ] ]\n"); | usage.append(" [ [ options ] | [ configProperty=value, ... ] ]\n"); |
usage.append(" options\n"); | usage.append(" options\n"); |
usage.append(" -v, --version - displays CIM Server version number\n"); | usage.append(" -v, --version - displays CIM Server version number\n"); |
|
usage.append(" --status - displays the running status of" |
|
" the CIM Server\n"); |
usage.append(" -h, --help - prints this help message\n"); | usage.append(" -h, --help - prints this help message\n"); |
usage.append(" -s - shuts down CIM Server\n"); | usage.append(" -s - shuts down CIM Server\n"); |
#if !defined(PEGASUS_USE_RELEASE_DIRS) | #if !defined(PEGASUS_USE_RELEASE_DIRS) |
|
|
Thread::clearLanguages(); | Thread::clearLanguages(); |
delete dummyInitialThread; | delete dummyInitialThread; |
} | } |
|
_serverRunStatus.setServerNotRunning(); |
} | } |
| |
// | // |
|
|
| |
#endif /* PEGASUS_ENABLE_PRIVILEGE_SEPARATION */ | #endif /* PEGASUS_ENABLE_PRIVILEGE_SEPARATION */ |
| |
|
static void _initConfigProperty(const String &propName, Uint32 value) |
|
{ |
|
char strValue[22]; |
|
Uint32 n; |
|
const char *startP = Uint32ToString( |
|
strValue, |
|
value, |
|
n); |
|
ConfigManager::getInstance()->initCurrentValue(propName, String(startP, n)); |
|
} |
|
|
///////////////////////////////////////////////////////////////////////// | ///////////////////////////////////////////////////////////////////////// |
// MAIN | // MAIN |
////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////// |
|
|
} | } |
// Need to initialize timezone information in the | // Need to initialize timezone information in the |
// initial processing thread (IPT) | // initial processing thread (IPT) |
tzset(); |
initialize_zOS_timezone(); |
#endif | #endif |
| |
#if defined(PEGASUS_OS_AIX) && defined(PEGASUS_HAS_MESSAGES) | #if defined(PEGASUS_OS_AIX) && defined(PEGASUS_HAS_MESSAGES) |
|
|
| |
#endif /* !defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ | #endif /* !defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ |
| |
// Get help, version, and shutdown options |
// Get help, version, status and shutdown options |
| |
for (int i = 1; i < argc; ) | for (int i = 1; i < argc; ) |
{ | { |
|
|
Executor::daemonizeExecutor(); | Executor::daemonizeExecutor(); |
exit(0); | exit(0); |
} | } |
|
if (strcmp(arg, "--status") == 0) |
|
{ |
|
int retValue = 0; |
|
if (_serverRunStatus.isServerRunning()) |
|
{ |
|
MessageLoaderParms parms( |
|
"src.Server.cimserver.CIMSERVER_RUNNING", |
|
"The CIM Server is running."); |
|
cout << MessageLoader::getMessage(parms) << endl; |
|
} |
|
else |
|
{ |
|
MessageLoaderParms parms( |
|
"src.Server.cimserver.CIMSERVER_NOT_RUNNING", |
|
"The CIM Server is not running."); |
|
cout << MessageLoader::getMessage(parms) << endl; |
|
retValue = 2; |
|
} |
|
Executor::daemonizeExecutor(); |
|
exit(retValue); |
|
} |
else if (strcmp(arg, "--version") == 0) | else if (strcmp(arg, "--version") == 0) |
{ | { |
cout << _cimServerProcess->getCompleteVersion() << endl; | cout << _cimServerProcess->getCompleteVersion() << endl; |
|
|
return 1; | return 1; |
} | } |
| |
#if defined(PEGASUS_OS_ZOS) && defined(PEGASUS_ZOS_SECURITY) |
#if defined(PEGASUS_OS_ZOS) |
|
# if defined(PEGASUS_ZOS_SECURITY) |
startupCheckBPXServer(true); | startupCheckBPXServer(true); |
startupCheckProfileCIMSERVclassWBEM(); | startupCheckProfileCIMSERVclassWBEM(); |
startupEnableMSC(); | startupEnableMSC(); |
#endif | #endif |
|
startupWaitForTCPIP(); |
|
#endif |
| |
#if defined(PEGASUS_DEBUG) | #if defined(PEGASUS_DEBUG) |
// Put out startup up message. | // Put out startup up message. |
|
|
} | } |
else | else |
{ | { |
MessageLoaderParms parms( |
PEG_TRACE_CSTRING(TRC_SERVER,Tracer::LEVEL4, |
"src.Server.cimserver.IPV6_STACK_NOT_ACTIVE", |
|
"IPv6 stack is not active, using IPv4 socket."); | "IPv6 stack is not active, using IPv4 socket."); |
Logger::put_l( |
|
Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION, |
|
parms); |
|
#if defined(PEGASUS_DEBUG) |
|
cout << MessageLoader::getMessage(parms) << endl; |
|
#endif |
|
} | } |
#endif | #endif |
if (!addIP6Acceptor) | if (!addIP6Acceptor) |
|
|
// | // |
portNumberHttp = System::lookupPort( | portNumberHttp = System::lookupPort( |
WBEM_HTTP_SERVICE_NAME, WBEM_DEFAULT_HTTP_PORT); | WBEM_HTTP_SERVICE_NAME, WBEM_DEFAULT_HTTP_PORT); |
|
_initConfigProperty("httpPort", portNumberHttp); |
} | } |
else | else |
{ | { |
|
|
// | // |
portNumberHttps = System::lookupPort( | portNumberHttps = System::lookupPort( |
WBEM_HTTPS_SERVICE_NAME, WBEM_DEFAULT_HTTPS_PORT); | WBEM_HTTPS_SERVICE_NAME, WBEM_DEFAULT_HTTPS_PORT); |
|
_initConfigProperty("httpsPort", portNumberHttps); |
} | } |
else | else |
{ | { |
|
|
parms); | parms); |
cerr << MessageLoader::getMessage(parms) << endl; | cerr << MessageLoader::getMessage(parms) << endl; |
| |
|
deleteCIMServer(); |
|
|
// | // |
// notify parent process (if there is a parent process) to terminate | // notify parent process (if there is a parent process) to terminate |
// | // |
if (daemonOption) | if (daemonOption) |
_cimServerProcess->notify_parent(1); | _cimServerProcess->notify_parent(1); |
| |
deleteCIMServer(); |
|
return 1; | return 1; |
} | } |
| |
|
|
#ifdef PEGASUS_ENABLE_SLP | #ifdef PEGASUS_ENABLE_SLP |
_cimServer->startSLPProvider(); | _cimServer->startSLPProvider(); |
#endif | #endif |
|
_cimServer->initComplete(); |
|
|
// | // |
// Loop to call CIMServer's runForever() method until CIMServer | // Loop to call CIMServer's runForever() method until CIMServer |
// has been shutdown | // has been shutdown |