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

Diff for /pegasus/src/WMIMapper/WMIServer/cimserver.cpp between version 1.30 and 1.31

version 1.30, 2007/05/08 18:30:53 version 1.31, 2007/06/05 10:25:03
Line 98 
Line 98 
 #include <Service/ServerShutdownClient.h> #include <Service/ServerShutdownClient.h>
 #include <Service/ServerRunStatus.h> #include <Service/ServerRunStatus.h>
  
 #if defined(PEGASUS_OS_OS400)  
 #  include "vfyptrs.cinc"  
 #  include "OS400ConvertChar.h"  
 #endif  
   
 PEGASUS_USING_PEGASUS; PEGASUS_USING_PEGASUS;
 PEGASUS_USING_STD; PEGASUS_USING_STD;
  
Line 317 
Line 312 
 setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
 #endif #endif
  
 #ifdef PEGASUS_OS_OS400  
   
   VFYPTRS_INCDCL;               // VFYPTRS local variables  
   
   // verify pointers  
   #pragma exception_handler (qsyvp_excp_hndlr,qsyvp_excp_comm_area,\  
     0,_C2_MH_ESCAPE)  
     for( int arg_index = 1; arg_index < argc; arg_index++ ){  
     VFYPTRS(VERIFY_SPP_NULL(argv[arg_index]));  
     }  
   #pragma disable_handler  
   
     // Convert the args to ASCII  
     for(Uint32 i = 0;i< argc;++i)  
     {  
     EtoA(argv[i]);  
     }  
   
     // Initialize Pegasus home to the shipped OS/400 directory.  
     pegasusHome = OS400_DEFAULT_PEGASUS_HOME;  
 #endif  
   
   
 #ifndef PEGASUS_OS_TYPE_WINDOWS #ifndef PEGASUS_OS_TYPE_WINDOWS
     //     //
     // Get environment variables:     // Get environment variables:
     //     //
 #ifdef PEGASUS_OS_OS400  
 #pragma convert(37)  
     const char* tmp = getenv("PEGASUS_HOME");  
 #pragma convert(0)  
     char home[256] = {0};  
     if (tmp && strlen(tmp) < 256)  
     {  
     strcpy(home, tmp);  
     EtoA(home);  
     pegasusHome = home;  
     }  
 #else  
   #if defined(PEGASUS_OS_AIX) && defined(PEGASUS_USE_RELEASE_DIRS)   #if defined(PEGASUS_OS_AIX) && defined(PEGASUS_USE_RELEASE_DIRS)
     pegasusHome = AIX_RELEASE_PEGASUS_HOME;     pegasusHome = AIX_RELEASE_PEGASUS_HOME;
   #elif !defined(PEGASUS_USE_RELEASE_DIRS)   #elif !defined(PEGASUS_USE_RELEASE_DIRS)
Line 366 
Line 326 
         pegasusHome = tmp;         pegasusHome = tmp;
     }     }
   #endif   #endif
 #endif  
  
     FileSystem::translateSlashes(pegasusHome);     FileSystem::translateSlashes(pegasusHome);
 #else #else
Line 532 
Line 491 
     configManager = ConfigManager::getInstance();     configManager = ConfigManager::getInstance();
     configManager->useConfigFiles = true;     configManager->useConfigFiles = true;
  
 #ifdef PEGASUS_OS_OS400  
     // In a special startup case for IBM OS400, when the server is  
     // automatically started when the machine starts up the config  
     // file cannot be read because of access restrictions for the  
     // user starting the server.  In this case, we need to skip  
     // reading the config options and therefore any use of the config  
     // manager also.  To make this determinations we will check to see  
     // if the daemon flag is set to true.  If so, then there will be a  
     // series of checks to bracket all the calls to the configManager  
     // which would otherwise fail.  All this will only be done for  
     // IBM OS400.  
   
     Boolean os400StartupOption = false;  
     // loop through args to check for daemon=true  
     for (int i=1; i < argc; i++)  
       if (strcmp(argv[i], "daemon=true") == 0)  
       {  
         os400StartupOption = true;  
         daemonOption = true;  
       }  
 #endif  
   
     //     //
     // Get options (from command line and from configuration file); this     // Get options (from command line and from configuration file); this
     // removes corresponding options and their arguments from the command     // removes corresponding options and their arguments from the command
Line 561 
Line 498 
     //     //
     try     try
     {     {
 #ifdef PEGASUS_OS_OS400  
     if (os400StartupOption == false)  
 #endif  
         GetOptions(configManager, argc, argv);         GetOptions(configManager, argc, argv);
     }     }
     catch (Exception& e)     catch (Exception& e)
Line 572 
Line 506 
             "src.Server.cimserver.SERVER_NOT_STARTED",             "src.Server.cimserver.SERVER_NOT_STARTED",
             "cimserver not started:  $0", e.getMessage());             "cimserver not started:  $0", e.getMessage());
  
 #if !defined(PEGASUS_OS_OS400)  
         MessageLoaderParms parms("src.Server.cimserver.SERVER_NOT_STARTED",         MessageLoaderParms parms("src.Server.cimserver.SERVER_NOT_STARTED",
             "cimserver not started: $0", e.getMessage());             "cimserver not started: $0", e.getMessage());
  
         PEGASUS_STD(cerr) << argv[0] << ": " << MessageLoader::getMessage(parms)         PEGASUS_STD(cerr) << argv[0] << ": " << MessageLoader::getMessage(parms)
             << PEGASUS_STD(endl);             << PEGASUS_STD(endl);
 #endif  
  
         return(1);         return(1);
     }     }
Line 590 
Line 522 
     MessageLoader::setPegasusMsgHome(ConfigManager::getHomedPath(     MessageLoader::setPegasusMsgHome(ConfigManager::getHomedPath(
         ConfigManager::getInstance()->getCurrentValue("messageDir")));         ConfigManager::getInstance()->getCurrentValue("messageDir")));
  
 #ifdef PEGASUS_OS_OS400  
     // Still need to declare and set the connection variables.  
     // Will initialize to false since they are fixed at false for OS400.  
   
     // NOTE:  OS400 is a LOCAL_DOMAIN_SOCKET, so a few lines down  
     // the test will not be compiled in.  If OS400 ever turns off that  
     // define, then we will need to change this code path to insure that  
     // one of the variables is true.  
     Boolean enableHttpConnection = false;  
     Boolean enableHttpsConnection = false;  
   
     if (os400StartupOption == false)  
     {  
       enableHttpConnection = ConfigManager::parseBooleanValue(  
           configManager->getCurrentValue("enableHttpConnection"));  
       enableHttpsConnection = ConfigManager::parseBooleanValue(  
           configManager->getCurrentValue("enableHttpsConnection"));  
     }  
 #else  
     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"));
 #endif  
  
     // Make sure at least one connection is enabled     // Make sure at least one connection is enabled
 #ifdef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET #ifdef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET
Line 644 
Line 556 
         daemonOption = ConfigManager::parseBooleanValue(         daemonOption = ConfigManager::parseBooleanValue(
             configManager->getCurrentValue("daemon"));             configManager->getCurrentValue("daemon"));
  
 #ifdef PEGASUS_OS_OS400  
     if (os400StartupOption == false)  
     {  
 #endif  
         logsDirectory =         logsDirectory =
         ConfigManager::getHomedPath(configManager->getCurrentValue("logdir"));         ConfigManager::getHomedPath(configManager->getCurrentValue("logdir"));
 #ifdef PEGASUS_OS_OS400  
     }  // end if (os400StartupOption == false)  
 #endif  
  
         // Set up the Logger. This does not open the logs         // Set up the Logger. This does not open the logs
         // Might be more logical to clean before set.         // Might be more logical to clean before set.
         // ATTN: Need tool to completely disable logging.         // ATTN: Need tool to completely disable logging.
  
 #if !defined(PEGASUS_OS_HPUX) && !defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) && \  #if !defined(PEGASUS_OS_HPUX) && !defined(PEGASUS_PLATFORM_LINUX_IA64_GNU)
 !defined(PEGASUS_OS_OS400)  
         Logger::setHomeDirectory(logsDirectory);         Logger::setHomeDirectory(logsDirectory);
 #endif #endif
  
Line 675 
Line 579 
             ServerShutdownClient serverShutdownClient(&_serverRunStatus);             ServerShutdownClient serverShutdownClient(&_serverRunStatus);
             serverShutdownClient.shutdown(timeoutValue);             serverShutdownClient.shutdown(timeoutValue);
  
 #ifdef PEGASUS_OS_OS400  
         Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::INFORMATION,  
             "src.Server.cimserver.SERVER_STOPPED",  
             "CIM Server stopped.");  
             cimserver_exitRC(0);  
 #else  
             MessageLoaderParms parms(             MessageLoaderParms parms(
                 "src.Server.cimserver.SERVER_STOPPED",                 "src.Server.cimserver.SERVER_STOPPED",
                 "CIM Server stopped.");                 "CIM Server stopped.");
  
             cout << MessageLoader::getMessage(parms) << endl;             cout << MessageLoader::getMessage(parms) << endl;
             return(0);             return(0);
 #endif  
         }         }
  
 #if defined(PEGASUS_DEBUG) && !defined(PEGASUS_USE_SYSLOGS) #if defined(PEGASUS_DEBUG) && !defined(PEGASUS_USE_SYSLOGS)
Line 699 
Line 596 
     }     }
     catch (UnrecognizedConfigProperty& e)     catch (UnrecognizedConfigProperty& e)
     {     {
   
 #ifdef PEGASUS_OS_OS400  
     //l10n  
     //Logger::put(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,  
             //"Error: $0",e.getMessage());  
     Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,  
             "src.Server.cimserver.ERROR",  
             "Error: $0",e.getMessage());  
 #else  
     //l10n     //l10n
     //cout << "Error: " << e.getMessage() << endl;     //cout << "Error: " << e.getMessage() << endl;
     MessageLoaderParms parms("src.Server.cimserver.ERROR",     MessageLoaderParms parms("src.Server.cimserver.ERROR",
                              "Error: $0",                              "Error: $0",
                              e.getMessage());                              e.getMessage());
     cout << MessageLoader::getMessage(parms) << endl;     cout << MessageLoader::getMessage(parms) << endl;
 #endif  
     }     }
  
     // Bug 2148 - Here is the order of operations for determining the server HTTP and HTTPS ports.     // Bug 2148 - Here is the order of operations for determining the server HTTP and HTTPS ports.
Line 806 
Line 693 
     if (daemonOption)     if (daemonOption)
     {     {
         if(-1 == _cimServerProcess->cimserver_fork())         if(-1 == _cimServerProcess->cimserver_fork())
 #ifndef PEGASUS_OS_OS400  
     {     {
         return(-1);         return(-1);
     }     }
 #else  
     {  
             return(-1);  
     }  
     else  
     {  
         return(0);  
     }  
 #endif  
   
     }     }
  
 // l10n // l10n
Line 844 
Line 720 
                              e.getMessage());                              e.getMessage());
     }     }
  
   
   
 #ifdef PEGASUS_OS_OS400  
     // Special server initialization code for OS/400.  
     if (cimserver_initialize() != 0)  
     {  
     // do some logging here!  
     //l10n  
     //Logger::put(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,  
             //"CIM Server failed to initialize");  
     Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,  
                   "src.Server.cimserver.SERVER_FAILED_TO_INITIALIZE",  
                   "CIM Server failed to initialize");  
     return(-1);  
     }  
 #endif  
   
   
 #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \
 || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \ || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \
 || defined(PEGASUS_OS_SOLARIS) || defined (PEGASUS_OS_VMS) || defined(PEGASUS_OS_SOLARIS) || defined (PEGASUS_OS_VMS)
Line 1041 
Line 899 
             "src.Server.cimserver.ERROR",             "src.Server.cimserver.ERROR",
             "Error: $0", e.getMessage());             "Error: $0", e.getMessage());
  
 #ifndef PEGASUS_OS_OS400  
     //l10n     //l10n
     //PEGASUS_STD(cerr) << "Error: " << e.getMessage() << PEGASUS_STD(endl);     //PEGASUS_STD(cerr) << "Error: " << e.getMessage() << PEGASUS_STD(endl);
     MessageLoaderParms parms("src.Server.cimserver.ERROR",     MessageLoaderParms parms("src.Server.cimserver.ERROR",
                              "Error: $0", e.getMessage());                              "Error: $0", e.getMessage());
     PEGASUS_STD(cerr) << MessageLoader::getMessage(parms) << PEGASUS_STD(endl);     PEGASUS_STD(cerr) << MessageLoader::getMessage(parms) << PEGASUS_STD(endl);
  
 #endif  
   
     //     //
         // notify parent process (if there is a parent process) to terminate         // notify parent process (if there is a parent process) to terminate
         //         //


Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2