version 1.213, 2008/01/11 19:32:25
|
version 1.217, 2008/03/05 22:27:38
|
|
|
// | // |
// cimserver daemon=false | // cimserver daemon=false |
// | // |
// The daemon config property has no effect on windows operation. |
// The daemon config property has no effect on windows operation or when |
|
// privilege separation is enabled. |
// | // |
// To shutdown pegasus, use the -s option: | // To shutdown pegasus, use the -s option: |
// | // |
|
|
for (int i = 1; i < argc; ) | for (int i = 1; i < argc; ) |
{ | { |
const char* arg = argv[i]; | const char* arg = argv[i]; |
if (String::equal(arg,"--help")) |
if (strcmp(arg, "--help") == 0) |
{ | { |
PrintHelp(argv[0]); | PrintHelp(argv[0]); |
|
Executor::daemonizeExecutor(); |
exit(0); | exit(0); |
} | } |
else if (String::equal(arg,"--version")) |
else if (strcmp(arg, "--version") == 0) |
{ | { |
cout << _cimServerProcess->getCompleteVersion() << endl; | cout << _cimServerProcess->getCompleteVersion() << endl; |
|
Executor::daemonizeExecutor(); |
exit(0); | exit(0); |
} | } |
// Check for -option | // Check for -option |
|
|
strlen(option) == 1) | strlen(option) == 1) |
{ | { |
cout << _cimServerProcess->getCompleteVersion() << endl; | cout << _cimServerProcess->getCompleteVersion() << endl; |
|
Executor::daemonizeExecutor(); |
exit(0); | exit(0); |
} | } |
// | // |
|
|
(strlen(option) == 1)) | (strlen(option) == 1)) |
{ | { |
PrintHelp(argv[0]); | PrintHelp(argv[0]); |
|
Executor::daemonizeExecutor(); |
exit(0); | exit(0); |
} | } |
#if !defined(PEGASUS_USE_RELEASE_DIRS) | #if !defined(PEGASUS_USE_RELEASE_DIRS) |
|
|
"Missing argument for option -$0", | "Missing argument for option -$0", |
opt); | opt); |
cout << MessageLoader::getMessage(parms) << endl; | cout << MessageLoader::getMessage(parms) << endl; |
exit(0); |
exit(1); |
} | } |
| |
memmove(&argv[i], &argv[i + 2], (argc-i-1) * sizeof(char*)); | memmove(&argv[i], &argv[i + 2], (argc-i-1) * sizeof(char*)); |
|
|
"Duplicate shutdown option specified."); | "Duplicate shutdown option specified."); |
| |
cout << MessageLoader::getMessage(parms) << endl; | cout << MessageLoader::getMessage(parms) << endl; |
exit(0); |
exit(1); |
} | } |
| |
shutdownOption = true; | shutdownOption = true; |
|
|
daemonOption = ConfigManager::parseBooleanValue( | daemonOption = ConfigManager::parseBooleanValue( |
configManager->getCurrentValue("daemon")); | configManager->getCurrentValue("daemon")); |
| |
|
if ((Executor::detectExecutor() == 0) && (daemonOption == false)) |
|
{ |
|
MessageLoaderParms parms( |
|
"src.Server.cimserver.PRIVSEP_REQUIRES_DAEMON", |
|
"Warning: The configuration setting daemon=false is ignored " |
|
"with privilege separation enabled."); |
|
cerr << MessageLoader::getMessage(parms) << endl; |
|
daemonOption = true; |
|
} |
|
|
#if !defined(PEGASUS_USE_SYSLOGS) | #if !defined(PEGASUS_USE_SYSLOGS) |
String logsDirectory = ConfigManager::getHomedPath( | String logsDirectory = ConfigManager::getHomedPath( |
configManager->getCurrentValue("logdir")); | configManager->getCurrentValue("logdir")); |
|
|
// The run function for the dummy Thread should never be called, | // The run function for the dummy Thread should never be called, |
dummyInitialThread = new Thread(dummyThreadFunc, NULL, false); | dummyInitialThread = new Thread(dummyThreadFunc, NULL, false); |
Thread::setCurrent(dummyInitialThread); | Thread::setCurrent(dummyInitialThread); |
AcceptLanguageList default_al; |
|
try | try |
{ | { |
default_al = LanguageParser::getDefaultAcceptLanguages(); |
Thread::setLanguages(LanguageParser::getDefaultAcceptLanguages()); |
Thread::setLanguages(new AcceptLanguageList(default_al)); |
|
} | } |
catch (InvalidAcceptLanguageHeader& e) | catch (InvalidAcceptLanguageHeader& e) |
{ | { |
|
|
| |
#endif | #endif |
| |
|
// In case we don't want to reregister to SLP |
|
// (i.e. PEGASUS_SLP_REG_TIMEOUT not set) after CIM Server startup, |
|
// the SLP Provider is started only once, |
|
// right short before entering the runForever loop which then can handle |
|
// the invokeMethod call against the SLP provider |
|
// function startSLPProvider() does create a separate thread to process |
|
// so code continues to go into the forever loop before executing any |
|
// requests against the CIM Server |
|
#ifdef PEGASUS_ENABLE_SLP |
|
# ifndef PEGASUS_SLP_REG_TIMEOUT |
|
_cimServer->startSLPProvider(); |
|
# endif |
|
#endif |
// | // |
// Loop to call CIMServer's runForever() method until CIMServer | // Loop to call CIMServer's runForever() method until CIMServer |
// has been shutdown | // has been shutdown |