version 1.228, 2008/12/16 18:58:05
|
version 1.232, 2009/02/24 10:51:48
|
|
|
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) |
|
|
| |
#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 |
////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////// |
|
|
| |
#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; |
|
|
// | // |
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 |
{ | { |
|
|
#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 |