(file) Return to cimserver.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Server

Diff for /pegasus/src/Server/cimserver.cpp between version 1.211 and 1.221

version 1.211, 2007/09/10 08:17:07 version 1.221, 2008/06/18 18:12:11
Line 45 
Line 45 
 // //
 // 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:
 // //
Line 85 
Line 86 
 #include <Pegasus/Common/FileSystem.h> #include <Pegasus/Common/FileSystem.h>
 #include <Pegasus/Common/PegasusVersion.h> #include <Pegasus/Common/PegasusVersion.h>
 #include <Pegasus/Common/Logger.h> #include <Pegasus/Common/Logger.h>
   #include <Pegasus/Common/StringConversion.h>
 #include <Pegasus/Common/System.h> #include <Pegasus/Common/System.h>
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
 #include <Pegasus/Common/LanguageParser.h> #include <Pegasus/Common/LanguageParser.h>
Line 446 
Line 448 
     if ( setEBCDICEncoding(STDOUT_FILENO)==-1 ||     if ( setEBCDICEncoding(STDOUT_FILENO)==-1 ||
          setEBCDICEncoding(STDERR_FILENO)==-1 )          setEBCDICEncoding(STDERR_FILENO)==-1 )
     {     {
        PEG_TRACE_CSTRING(TRC_SERVER,Tracer::LEVEL4,         PEG_TRACE_CSTRING(TRC_SERVER,Tracer::LEVEL1,
            "Coud not set stdout or stderr to EBCDIC encoding.");            "Coud not set stdout or stderr to EBCDIC encoding.");
     }     }
     // Need to initialize timezone information in the     // Need to initialize timezone information in the
Line 508 
Line 510 
         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
Line 531 
Line 535 
                     strlen(option) == 1)                     strlen(option) == 1)
                 {                 {
                     cout << _cimServerProcess->getCompleteVersion() << endl;                     cout << _cimServerProcess->getCompleteVersion() << endl;
                       Executor::daemonizeExecutor();
                     exit(0);                     exit(0);
                 }                 }
                 //                 //
Line 540 
Line 545 
                         (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)
Line 558 
Line 564 
                             "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*));
Line 602 
Line 608 
                             "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;
Line 733 
Line 739 
             "CIM Server's Job Name is: $0", fullJobName);             "CIM Server's Job Name is: $0", fullJobName);
 #endif #endif
  
   #ifdef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET
           // Make sure at least one connection is enabled
   
     Boolean enableHttpConnection = ConfigManager::parseBooleanValue(     Boolean enableHttpConnection = ConfigManager::parseBooleanValue(
         configManager->getCurrentValue("enableHttpConnection"));         configManager->getCurrentValue("enableHttpConnection"));
     Boolean enableHttpsConnection = ConfigManager::parseBooleanValue(     Boolean enableHttpsConnection = ConfigManager::parseBooleanValue(
         configManager->getCurrentValue("enableHttpsConnection"));         configManager->getCurrentValue("enableHttpsConnection"));
  
     // Make sure at least one connection is enabled  
 #ifdef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET  
     if (!enableHttpConnection && !enableHttpsConnection)     if (!enableHttpConnection && !enableHttpsConnection)
     {     {
         //l10n              Logger::put_l(
         //Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,                  Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,
             //"Neither HTTP nor HTTPS connection is enabled.  "  
             //"CIMServer will not be started.");  
         Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,  
             "src.Server.cimserver.HTTP_NOT_ENABLED_SERVER_NOT_STARTING",             "src.Server.cimserver.HTTP_NOT_ENABLED_SERVER_NOT_STARTING",
             "Neither HTTP nor HTTPS connection is enabled."             "Neither HTTP nor HTTPS connection is enabled."
             "  CIMServer will not be started.");             "  CIMServer will not be started.");
         //cerr << "Neither HTTP nor HTTPS connection is enabled.  "  
             //"CIMServer will not be started." << endl;  
         MessageLoaderParms parms(         MessageLoaderParms parms(
                 "src.Server.cimserver.HTTP_NOT_ENABLED_SERVER_NOT_STARTING",                 "src.Server.cimserver.HTTP_NOT_ENABLED_SERVER_NOT_STARTING",
                 "Neither HTTP nor HTTPS connection is enabled."                 "Neither HTTP nor HTTPS connection is enabled."
                 "  CIMServer will not be started.");                 "  CIMServer will not be started.");
         cerr << MessageLoader::getMessage(parms) << endl;         cerr << MessageLoader::getMessage(parms) << endl;
         return(1);              return 1;
     }     }
 #endif #endif
   
         //         //
         // Check to see if we should start Pegasus as a daemon         // Check to see if we should start Pegasus as a daemon
         //         //
         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"));
Line 793 
Line 806 
                 configManager->getCurrentValue("shutdownTimeout");                 configManager->getCurrentValue("shutdownTimeout");
             Uint32 timeoutValue =             Uint32 timeoutValue =
                 strtol(configTimeout.getCString(), (char **)0, 10);                 strtol(configTimeout.getCString(), (char **)0, 10);
 #ifdef PEGASUS_SLP_REG_TIMEOUT  
             // To deregister Pegasus with SLP  
             unregisterPegasusFromSLP();  
 #endif  
  
             ServerShutdownClient serverShutdownClient(&_serverRunStatus);             ServerShutdownClient serverShutdownClient(&_serverRunStatus);
             serverShutdownClient.shutdown(timeoutValue);             serverShutdownClient.shutdown(timeoutValue);
Line 862 
Line 871 
     // 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)
     {     {
Line 1033 
Line 1040 
                     portNumberHttp, false);                     portNumberHttp, false);
             }             }
  
               char scratchBuffer[22];
               Uint32 n;
               const char * portNumberHttpStr = Uint32ToString(
                   scratchBuffer, portNumberHttp, n);
             MessageLoaderParms parms(             MessageLoaderParms parms(
                 "src.Server.cimserver.LISTENING_ON_HTTP_PORT",                 "src.Server.cimserver.LISTENING_ON_HTTP_PORT",
                 "Listening on HTTP port $0.", portNumberHttp);                  "Listening on HTTP port $0.", portNumberHttpStr);
             Logger::put(             Logger::put(
                 Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,                 Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
                 MessageLoader::getMessage(parms));                 MessageLoader::getMessage(parms));
Line 1079 
Line 1090 
                 _cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION,                 _cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION,
                     portNumberHttps, true);                     portNumberHttps, true);
             }             }
               char scratchBuffer[22];
               Uint32 n;
               const char * portNumberHttpsStr = Uint32ToString(
                   scratchBuffer, portNumberHttps, n);
             MessageLoaderParms parms(             MessageLoaderParms parms(
                 "src.Server.cimserver.LISTENING_ON_HTTPS_PORT",                 "src.Server.cimserver.LISTENING_ON_HTTPS_PORT",
                 "Listening on HTTPS port $0.", portNumberHttps);                  "Listening on HTTPS port $0.", portNumberHttpsStr);
             Logger::put(             Logger::put(
                 Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,                 Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
                 MessageLoader::getMessage(parms));                 MessageLoader::getMessage(parms));
Line 1112 
Line 1127 
         // 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)
         {         {
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)  
             Executor::daemonizeExecutor();  
 #else  
             _cimServerProcess->notify_parent(0);             _cimServerProcess->notify_parent(0);
 #endif  
         }         }
  
 #if defined(PEGASUS_DEBUG) #if defined(PEGASUS_DEBUG)
Line 1180 
Line 1191 
  
 #endif #endif
  
   #ifdef PEGASUS_ENABLE_SLP
           _cimServer->startSLPProvider();
   #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


Legend:
Removed from v.1.211  
changed lines
  Added in v.1.221

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2