(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.174 and 1.174.2.1

version 1.174, 2005/12/19 21:51:44 version 1.174.2.1, 2006/02/10 16:17:09
Line 1 
Line 1 
 //%2005////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
Line 8 
Line 8 
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 // EMC Corporation; VERITAS Software Corporation; The Open Group. // EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 124 
Line 126 
 #  include "OS400ConvertChar.h" #  include "OS400ConvertChar.h"
 #endif #endif
  
   #if defined(PEGASUS_OS_TYPE_UNIX)
   # if defined(PEGASUS_OS_OS400)
   #  include <unistd.cleinc>
   # else
   #  include <unistd.h>
   # endif
   # include <sys/types.h>
   # include <sys/stat.h>
   # include <fcntl.h>
   #endif
   
 PEGASUS_USING_PEGASUS; PEGASUS_USING_PEGASUS;
 PEGASUS_USING_STD; PEGASUS_USING_STD;
  
Line 184 
Line 197 
         return CIMSERVER_START_FILE;         return CIMSERVER_START_FILE;
     }     }
  
     int cimserver_run(int argc, char** argv, bool shutdownOption);      int cimserver_run(
           int argc,
           char** argv,
           Boolean shutdownOption,
           Boolean debugOutputOption);
  
     void cimserver_stop(void);     void cimserver_stop(void);
 }; };
Line 218 
Line 235 
  
 static const char   LONG_VERSION []  = "version"; static const char   LONG_VERSION []  = "version";
  
 #if defined(PEGASUS_OS_HPUX)  static const char OPTION_DEBUGOUTPUT = 'X';
 static const char OPTION_BINDVERBOSE = 'X';  
 #endif  
  
 static const String PROPERTY_TIMEOUT = "shutdownTimeout"; static const String PROPERTY_TIMEOUT = "shutdownTimeout";
  
Line 595 
Line 610 
 { {
     String pegasusHome  = String::EMPTY;     String pegasusHome  = String::EMPTY;
     Boolean shutdownOption = false;     Boolean shutdownOption = false;
       Boolean debugOutputOption = false;
  
 //l10n //l10n
 // Set Message loading to process locale // Set Message loading to process locale
Line 728 
Line 744 
                     argc -= 2;                     argc -= 2;
                 }                 }
 #endif #endif
 #if defined(PEGASUS_OS_HPUX)  
                 //                 //
                 // Check to see if user asked for the version (-X option):                  // Check to see if user asked for debug output (-X option):
                 //                 //
                 if (*option == OPTION_BINDVERBOSE &&                  else if (*option == OPTION_DEBUGOUTPUT &&
                         (strlen(option) == 1))                         (strlen(option) == 1))
                 {                 {
             System::bindVerbose = true;                      MessageLoaderParms parms(
                     //l10n                          "src.Server.cimserver.UNSUPPORTED_DEBUG_OPTION",
                     //cout << "Unsupported debug option, BIND_VERBOSE, enabled."                          "Unsupported debug output option is enabled.");
                          //<< endl;  
                     MessageLoaderParms parms("src.Server.cimserver.UNSUPPORTED_DEBUG_OPTION",  
                                          "Unsupported debug option, BIND_VERBOSE, enabled.");  
                     cout << MessageLoader::getMessage(parms) << endl;                     cout << MessageLoader::getMessage(parms) << endl;
   
                       debugOutputOption = true;
   
   #if defined(PEGASUS_OS_HPUX)
                       System::bindVerbose = true;
   #endif
   
                     // remove the option from the command line                     // remove the option from the command line
                     memmove(&argv[i], &argv[i + 1], (argc-i) * sizeof(char*));                     memmove(&argv[i], &argv[i + 1], (argc-i) * sizeof(char*));
                     argc--;                     argc--;
                 }                 }
 #endif  
                 //                 //
                 // Check to see if user asked for shutdown (-s option):                 // Check to see if user asked for shutdown (-s option):
                 //                 //
Line 789 
Line 807 
     // Do the platform specific run     // Do the platform specific run
     //     //
  
     return _cimServerProcess->platform_run( argc, argv, shutdownOption );      return _cimServerProcess->platform_run(
           argc, argv, shutdownOption, debugOutputOption);
 } }
  
 void CIMServerProcess::cimserver_stop() void CIMServerProcess::cimserver_stop()
Line 810 
Line 829 
 // specific runs may need to deal with better (instead of exit(), etc). // specific runs may need to deal with better (instead of exit(), etc).
 // //
  
 int CIMServerProcess::cimserver_run( int argc, char** argv, Boolean shutdownOption )  int CIMServerProcess::cimserver_run(
       int argc,
       char** argv,
       Boolean shutdownOption,
       Boolean debugOutputOption)
 { {
     String logsDirectory = String::EMPTY;     String logsDirectory = String::EMPTY;
     Boolean daemonOption = false;     Boolean daemonOption = false;
Line 1186 
Line 1209 
 // l10n // l10n
     // Now we are after the fork...     // Now we are after the fork...
     // Create a dummy Thread object that can be used to store the     // Create a dummy Thread object that can be used to store the
     // AcceptLanguages object for CIM requests that are serviced      // AcceptLanguageList object for CIM requests that are serviced
     // by this thread (initial thread of server).  Need to do this     // by this thread (initial thread of server).  Need to do this
     // because this thread is not in a ThreadPool, but is used     // because this thread is not in a ThreadPool, but is used
     // to service CIM requests.     // to service CIM requests.
     // 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);
     AcceptLanguages default_al;      AcceptLanguageList default_al;
     try{     try{
          default_al = LanguageParser::getDefaultAcceptLanguages();          default_al = LanguageParser::getDefaultAcceptLanguages();
          Thread::setLanguages(new AcceptLanguages(default_al));           Thread::setLanguages(new AcceptLanguageList(default_al));
     }catch(InvalidAcceptLanguageHeader& e){     }catch(InvalidAcceptLanguageHeader& e){
           Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,           Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
                   "src.Server.cimserver.FAILED_TO_SET_PROCESS_LOCALE",                   "src.Server.cimserver.FAILED_TO_SET_PROCESS_LOCALE",
Line 1226 
Line 1249 
     umask(S_IRWXG|S_IRWXO);     umask(S_IRWXG|S_IRWXO);
 #endif #endif
  
   
   #if defined(PEGASUS_OS_TYPE_UNIX)
     //
     // CRITICAL SECTION BEGIN
     //
     // This is the beginning of the critical section regarding the
     // access to pidfile (file to indicate that the cimserver has started).
     // Sometimes, when 2 or more cimserver processes are started at the same
     // time, they can't detect the concurrent process execution because the
     // logic fails when pidfile is accessed concurrently.
   
     FILE *startupLockFile;
   
     if ((startupLockFile = fopen(ConfigManager::getHomedPath(
             CIMSERVER_LOCK_FILE).getCString(), "w")) != 0)
     {
         lockf(fileno(startupLockFile), F_LOCK, 0);
     }
   #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 1389 
Line 1432 
     cout << "Started. " << endl;     cout << "Started. " << endl;
 #endif #endif
  
   #if defined(PEGASUS_OS_TYPE_UNIX)
       //
       // CRITICAL SECTION END
       //
       // Here is the unlock of file 'lock_file'. It closes the
       // the critical section that guarantees the non concurrent access to
       // pid file (file to indicate that the cimserver has started).
       //
   
       if (startupLockFile)
       {
          lockf(fileno(startupLockFile), F_ULOCK, 0);
          fclose(startupLockFile);
       }
   #endif
   
   
         // Put server started message to the logger         // Put server started message to the logger
         Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER,         Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER,
             Logger::INFORMATION,             Logger::INFORMATION,
Line 1396 
Line 1456 
             "Started $0 version $1.",             "Started $0 version $1.",
             _cimServerProcess->getProductName(), _cimServerProcess->getVersion());             _cimServerProcess->getProductName(), _cimServerProcess->getVersion());
  
   #if defined(PEGASUS_OS_TYPE_UNIX)
           if (daemonOption && !debugOutputOption)
           {
               // Direct standard input, output, and error to /dev/null,
               // since we are running as a daemon.
               close(0);
               open("/dev/null", O_RDONLY);
               close(1);
               open("/dev/null", O_RDWR);
               close(2);
               open("/dev/null", O_RDWR);
           }
   #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.174  
changed lines
  Added in v.1.174.2.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2