(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.237 and 1.237.2.5

version 1.237, 2010/06/07 11:16:36 version 1.237.2.5, 2014/03/12 22:35:06
Line 132 
Line 132 
  
 //Windows service variables are not defined elsewhere in the product //Windows service variables are not defined elsewhere in the product
 //enable ability to override these //enable ability to override these
   #ifndef PEGASUS_FLAVOR
 #ifndef PEGASUS_SERVICE_NAME #ifndef PEGASUS_SERVICE_NAME
 #define PEGASUS_SERVICE_NAME "Pegasus CIM Object Manager"; #define PEGASUS_SERVICE_NAME "Pegasus CIM Object Manager";
 #endif #endif
 #ifndef PEGASUS_SERVICE_DESCRIPTION #ifndef PEGASUS_SERVICE_DESCRIPTION
 #define PEGASUS_SERVICE_DESCRIPTION "Pegasus CIM Object Manager Service"; #define PEGASUS_SERVICE_DESCRIPTION "Pegasus CIM Object Manager Service";
 #endif #endif
   #else
   #ifndef PEGASUS_SERVICE_NAME
   #define PEGASUS_SERVICE_NAME PEGASUS_FLAVOR " Pegasus CIM Object Manager"
   #endif
   #ifndef PEGASUS_SERVICE_DESCRIPTION
   #define PEGASUS_SERVICE_DESCRIPTION PEGASUS_FLAVOR \
               " Pegasus CIM Object Manager Service";
   #endif
   #endif
  
 #ifdef PEGASUS_OS_PASE #ifdef PEGASUS_OS_PASE
 #include <as400_protos.h> //for _SETCCSID #include <as400_protos.h> //for _SETCCSID
Line 228 
Line 238 
  
 static const char OPTION_SHUTDOWN    = 's'; static const char OPTION_SHUTDOWN    = 's';
  
 static const char LONG_HELP[]        = "help";  
   
 static const char LONG_VERSION[]     = "version";  
   
 static const char OPTION_DEBUGOUTPUT = 'X'; static const char OPTION_DEBUGOUTPUT = 'X';
  
 /** GetOptions function - This function defines the Options Table /** GetOptions function - This function defines the Options Table
Line 343 
Line 349 
         Thread::clearLanguages();         Thread::clearLanguages();
         delete dummyInitialThread;         delete dummyInitialThread;
     }     }
       _serverRunStatus.setServerNotRunning();
 } }
  
 // //
Line 439 
Line 446 
         n);         n);
     ConfigManager::getInstance()->initCurrentValue(propName, String(startP, n));     ConfigManager::getInstance()->initCurrentValue(propName, String(startP, n));
 } }
   static void _restrictListening(
       ConfigManager* configManager,
       const String &listenOn,
       const Uint32 &portNumberHttp,
       const Boolean useSSL)
   {
       static Array<HostAddress> laddr = configManager ->getListenAddress(
                                             listenOn);
       for(Uint32 i = 0, n = laddr.size(); i < n; ++i)
       {
           if(laddr[i].getAddressType() == HostAddress::AT_IPV6)
           {
   #ifdef PEGASUS_ENABLE_IPV6
               _cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION,
                       portNumberHttp, useSSL,
                       &laddr[i]);
   #endif
           }
           else if(laddr[i].getAddressType() == HostAddress::AT_IPV4)
           {
               _cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION,
                       portNumberHttp, useSSL,
                       &laddr[i]);
           }
       }
   }
  
 ///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
 //  MAIN //  MAIN
Line 834 
Line 867 
         //         //
         if (shutdownOption)         if (shutdownOption)
         {         {
   #if defined(PEGASUS_OS_ZOS) && defined(PEGASUS_ZOS_SECURITY)
               // This checks whether user is authorized to stop the
               // CIM Server. When unauthorized a message is logged to
               // to the user and program exits.
               shutdownCheckProfileCIMSERVclassWBEM();
               // Depending on the success of the previous check we may not
               // reach this code!!!
   #endif
             String configTimeout =             String configTimeout =
                 configManager->getCurrentValue("shutdownTimeout");                 configManager->getCurrentValue("shutdownTimeout");
             Uint32 timeoutValue =             Uint32 timeoutValue =
Line 883 
Line 924 
         _cimServerProcess->getCompleteVersion() << endl;         _cimServerProcess->getCompleteVersion() << endl;
 #endif #endif
  
       // Force initialization of hostname and fullyQualifiedHostName through
       // retrieving current value from Configuration Manager
       // - this will run getCurrentValue() in DefaultPropertyOwner.cpp
       configManager->getCurrentValue("hostname");
       configManager->getCurrentValue("fullyQualifiedHostName");
   
     // reset message loading to NON-process locale     // reset message loading to NON-process locale
     MessageLoader::_useProcessLocale = false;     MessageLoader::_useProcessLocale = false;
  
Line 927 
Line 974 
  
     // Start up the CIM Server     // Start up the CIM Server
  
     try  
     {  
 #if defined(PEGASUS_OS_TYPE_UNIX) #if defined(PEGASUS_OS_TYPE_UNIX)
         //         //
         // Lock the CIMSERVER_LOCK_FILE during CIM Server start-up to prevent         // Lock the CIMSERVER_LOCK_FILE during CIM Server start-up to prevent
Line 938 
Line 983 
         CString startupLockFileName = ConfigManager::getHomedPath(         CString startupLockFileName = ConfigManager::getHomedPath(
             PEGASUS_CIMSERVER_START_LOCK_FILE).getCString();             PEGASUS_CIMSERVER_START_LOCK_FILE).getCString();
  
       try
       {
   
         // Make sure the start-up lock file exists         // Make sure the start-up lock file exists
         FILE* startupLockFile;         FILE* startupLockFile;
         if ((startupLockFile = fopen(startupLockFileName, "w")) != 0)         if ((startupLockFile = fopen(startupLockFileName, "w")) != 0)
Line 946 
Line 994 
         }         }
  
         AutoFileLock fileLock(startupLockFileName);         AutoFileLock fileLock(startupLockFileName);
   #else
       try
       {
 #endif #endif
  
 #if defined(PEGASUS_OS_TYPE_UNIX) || defined(PEGASUS_OS_VMS) #if defined(PEGASUS_OS_TYPE_UNIX) || defined(PEGASUS_OS_VMS)
Line 1036 
Line 1087 
         {         {
             Uint32 portNumberHttp = 0;             Uint32 portNumberHttp = 0;
             String httpPort = configManager->getCurrentValue("httpPort");             String httpPort = configManager->getCurrentValue("httpPort");
             if (httpPort == String::EMPTY)              if (httpPort.size() == 0)
             {             {
                 //                 //
                 // Look up the WBEM-HTTP port number                 // Look up the WBEM-HTTP port number
Line 1047 
Line 1098 
             }             }
             else             else
             {             {
                 //                  Uint64 longNumber;
                 // user-specified                  // use the current value which has been checked for validity at
                 //                  // load(fct. GetOptions), see DefaultPropertyOwner::isValid()
                 CString portString = httpPort.getCString();                  StringConversion::decimalStringToUint64(
                 char* end = 0;                      httpPort.getCString(),
                 portNumberHttp = strtol(portString, &end, 10);                      longNumber);
                 if (!(end != 0 && *end == '\0'))                  portNumberHttp = longNumber & 0xffff;
                 {  
                     throw InvalidPropertyValue("httpPort", httpPort);  
                 }  
             }             }
  
               String listenOn = configManager->getCurrentValue("listenAddress");
               if(String::equalNoCase(listenOn, "All"))
               {
             if (addIP6Acceptor)             if (addIP6Acceptor)
             {             {
                 _cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION,                 _cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION,
Line 1069 
Line 1120 
                 _cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION,                 _cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION,
                     portNumberHttp, false);                     portNumberHttp, false);
             }             }
               }
               else // Restricted listening
               {
                   _restrictListening(
                       configManager, listenOn, portNumberHttp, false);
               }
   
             // The port number is converted to a string to avoid the             // The port number is converted to a string to avoid the
             //  addition of localized characters (e.g., "5,988").             //  addition of localized characters (e.g., "5,988").
             char scratchBuffer[22];             char scratchBuffer[22];
Line 1090 
Line 1148 
         {         {
             Uint32 portNumberHttps = 0;             Uint32 portNumberHttps = 0;
             String httpsPort = configManager->getCurrentValue("httpsPort");             String httpsPort = configManager->getCurrentValue("httpsPort");
             if (httpsPort == String::EMPTY)              if (httpsPort.size() == 0)
             {             {
                 //                 //
                 // Look up the WBEM-HTTPS port number                 // Look up the WBEM-HTTPS port number
Line 1101 
Line 1159 
             }             }
             else             else
             {             {
                 //                  Uint64 longNumber;
                 // user-specified                  // use the current value which has been checked for validity at
                 //                  // load(fct. GetOptions), see DefaultPropertyOwner::isValid()
                 CString portString = httpsPort.getCString();                  StringConversion::decimalStringToUint64(
                 char* end = 0;                      httpsPort.getCString(),
                 portNumberHttps = strtol(portString, &end, 10);                      longNumber);
                 if (!(end != 0 && *end == '\0'))                  portNumberHttps = longNumber & 0xffff;
                 {  
                     throw InvalidPropertyValue("httpsPort", httpsPort);  
                 }  
             }             }
   
               String listenOn = configManager->getCurrentValue("listenAddress");
               if(String::equalNoCase(listenOn, "All"))
               {
             if (addIP6Acceptor)             if (addIP6Acceptor)
             {             {
                 _cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION,                 _cimServer->addAcceptor(HTTPAcceptor::IPV6_CONNECTION,
Line 1122 
Line 1181 
                 _cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION,                 _cimServer->addAcceptor(HTTPAcceptor::IPV4_CONNECTION,
                     portNumberHttps, true);                     portNumberHttps, true);
             }             }
               }
               else //Restricted
               {
                   _restrictListening(
                       configManager, listenOn, portNumberHttps, true);
               }
   
             // The port number is converted to a string to avoid the             // The port number is converted to a string to avoid the
             //  addition of localized characters (e.g., "5,989").             //  addition of localized characters (e.g., "5,989").
             char scratchBuffer[22];             char scratchBuffer[22];
Line 1272 
Line 1338 
             parms);             parms);
         cerr << MessageLoader::getMessage(parms) << endl;         cerr << MessageLoader::getMessage(parms) << endl;
  
       //delete the start up lock file
   #if defined(PEGASUS_OS_TYPE_UNIX)
       System::removeFile(startupLockFileName);
   #endif
         deleteCIMServer();         deleteCIMServer();
         return 1;         return 1;
     }     }
  
       //delete the start up lock file
   #if defined(PEGASUS_OS_TYPE_UNIX)
       System::removeFile(startupLockFileName);
   #endif
     deleteCIMServer();     deleteCIMServer();
     return 0;     return 0;
 } }


Legend:
Removed from v.1.237  
changed lines
  Added in v.1.237.2.5

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2