(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.175 and 1.175.2.1

version 1.175, 2006/01/04 18:43:40 version 1.175.2.1, 2006/01/18 17:38:07
Line 124 
Line 124 
 #  include "OS400ConvertChar.h" #  include "OS400ConvertChar.h"
 #endif #endif
  
   #if defined(PEGASUS_OS_TYPE_UNIX)
 #if defined(PEGASUS_OS_OS400) #if defined(PEGASUS_OS_OS400)
 #  include <unistd.cleinc> #  include <unistd.cleinc>
 #elif defined(PEGASUS_OS_TYPE_UNIX)  # else
 #  include <unistd.h> #  include <unistd.h>
 #endif #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 191 
Line 195 
         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 225 
Line 233 
  
 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 602 
Line 608 
 { {
     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 735 
Line 742 
                     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 796 
Line 805 
     // 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 817 
Line 827 
 // 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 1193 
Line 1207 
 // 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 1246 
Line 1260 
  
   FILE *startupLockFile;   FILE *startupLockFile;
  
   if (startupLockFile = fopen(ConfigManager::getHomedPath(CIMSERVER_LOCK_FILE).getCString(), "w"))    if ((startupLockFile = fopen(ConfigManager::getHomedPath(
             CIMSERVER_LOCK_FILE).getCString(), "w")) != 0)
   {   {
       lockf(fileno(startupLockFile), F_LOCK, 0);       lockf(fileno(startupLockFile), F_LOCK, 0);
   }   }
Line 1439 
Line 1454 
             "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.175  
changed lines
  Added in v.1.175.2.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2