(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.2.2 and 1.175

version 1.174.2.2, 2006/03/07 18:46:14 version 1.175, 2006/01/04 18:43:40
Line 1 
Line 1 
 //%2006////////////////////////////////////////////////////////////////////////  //%2005////////////////////////////////////////////////////////////////////////
 // //
 // 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 126 
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>
 # else  #elif defined(PEGASUS_OS_TYPE_UNIX)
 #  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 181 
Line 175 
     }     }
  
     //defined in PegasusVersion.h     //defined in PegasusVersion.h
     virtual const char* getCompleteVersion() const  
     {  
       if (*PEGASUS_PRODUCT_STATUS == '\0' )  
         return PEGASUS_PRODUCT_VERSION;  
       else  
         return PEGASUS_PRODUCT_VERSION " " PEGASUS_PRODUCT_STATUS;  
     }  
   
     //defined in PegasusVersion.h  
     virtual const char* getVersion() const     virtual const char* getVersion() const
     {     {
         return PEGASUS_PRODUCT_VERSION;         return PEGASUS_PRODUCT_VERSION;
Line 206 
Line 191 
         return CIMSERVER_START_FILE;         return CIMSERVER_START_FILE;
     }     }
  
     int cimserver_run(      int cimserver_run(int argc, char** argv, bool shutdownOption);
         int argc,  
         char** argv,  
         Boolean shutdownOption,  
         Boolean debugOutputOption);  
  
     void cimserver_stop(void);     void cimserver_stop(void);
 }; };
Line 244 
Line 225 
  
 static const char   LONG_VERSION []  = "version"; static const char   LONG_VERSION []  = "version";
  
 static const char OPTION_DEBUGOUTPUT = 'X';  #if defined(PEGASUS_OS_HPUX)
   static const char OPTION_BINDVERBOSE = 'X';
   #endif
  
 static const String PROPERTY_TIMEOUT = "shutdownTimeout"; static const String PROPERTY_TIMEOUT = "shutdownTimeout";
  
Line 328 
Line 311 
     usage.append ("                    - sets CIM Server configuration property\n");     usage.append ("                    - sets CIM Server configuration property\n");
  
     cout << endl;     cout << endl;
     cout << _cimServerProcess->getProductName() << " " << _cimServerProcess->getCompleteVersion() << endl;      cout << _cimServerProcess->getProductName() << " " << _cimServerProcess->getVersion() << endl;
     cout << endl;     cout << endl;
  
 #if defined(PEGASUS_OS_TYPE_WINDOWS) #if defined(PEGASUS_OS_TYPE_WINDOWS)
Line 619 
Line 602 
 { {
     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 702 
Line 684 
             }             }
             else if(String::equal(arg,"--version"))             else if(String::equal(arg,"--version"))
             {             {
                 cout << _cimServerProcess->getCompleteVersion() << endl;                  cout << _cimServerProcess->getVersion() << endl;
                 exit(0);                 exit(0);
             }             }
             // Check for -option             // Check for -option
Line 717 
Line 699 
                 if (*option == OPTION_VERSION &&                 if (*option == OPTION_VERSION &&
                     strlen(option) == 1)                     strlen(option) == 1)
                 {                 {
                     cout << _cimServerProcess->getCompleteVersion() << endl;                      cout << _cimServerProcess->getVersion() << endl;
                     exit(0);                     exit(0);
                 }                 }
                 //                 //
Line 753 
Line 735 
                     argc -= 2;                     argc -= 2;
                 }                 }
 #endif #endif
   #if defined(PEGASUS_OS_HPUX)
                 //                 //
                 // Check to see if user asked for debug output (-X option):                  // Check to see if user asked for the version (-X option):
                 //                 //
                 else if (*option == OPTION_DEBUGOUTPUT &&                  if (*option == OPTION_BINDVERBOSE &&
                         (strlen(option) == 1))                         (strlen(option) == 1))
                 {                 {
                     MessageLoaderParms parms(  
                         "src.Server.cimserver.UNSUPPORTED_DEBUG_OPTION",  
                         "Unsupported debug output option is enabled.");  
                     cout << MessageLoader::getMessage(parms) << endl;  
   
                     debugOutputOption = true;  
   
 #if defined(PEGASUS_OS_HPUX)  
                     System::bindVerbose = true;                     System::bindVerbose = true;
 #endif                      //l10n
                       //cout << "Unsupported debug option, BIND_VERBOSE, enabled."
                            //<< endl;
                       MessageLoaderParms parms("src.Server.cimserver.UNSUPPORTED_DEBUG_OPTION",
                                            "Unsupported debug option, BIND_VERBOSE, enabled.");
                       cout << MessageLoader::getMessage(parms) << endl;
                     // 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 816 
Line 796 
     // Do the platform specific run     // Do the platform specific run
     //     //
  
     return _cimServerProcess->platform_run(      return _cimServerProcess->platform_run( argc, argv, shutdownOption );
         argc, argv, shutdownOption, debugOutputOption);  
 } }
  
 void CIMServerProcess::cimserver_stop() void CIMServerProcess::cimserver_stop()
Line 838 
Line 817 
 // 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 CIMServerProcess::cimserver_run( int argc, char** argv, Boolean shutdownOption )
     int argc,  
     char** argv,  
     Boolean shutdownOption,  
     Boolean debugOutputOption)  
 { {
     String logsDirectory = String::EMPTY;     String logsDirectory = String::EMPTY;
     Boolean daemonOption = false;     Boolean daemonOption = false;
Line 1177 
Line 1152 
     }     }
 #if defined(PEGASUS_DEBUG) #if defined(PEGASUS_DEBUG)
     // Put out startup up message.     // Put out startup up message.
     cout << _cimServerProcess->getProductName() << " " << _cimServerProcess->getCompleteVersion() << endl;      cout << _cimServerProcess->getProductName() << " " << _cimServerProcess->getVersion() << endl;
     //l10n     //l10n
     //cout << "Built " << __DATE__ << " " << __TIME__ << endl;     //cout << "Built " << __DATE__ << " " << __TIME__ << endl;
     //cout <<"Starting..."     //cout <<"Starting..."
Line 1218 
Line 1193 
 // 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
     // AcceptLanguageList object for CIM requests that are serviced      // AcceptLanguages 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);
     AcceptLanguageList default_al;      AcceptLanguages default_al;
     try{     try{
          default_al = LanguageParser::getDefaultAcceptLanguages();          default_al = LanguageParser::getDefaultAcceptLanguages();
          Thread::setLanguages(new AcceptLanguageList(default_al));           Thread::setLanguages(new AcceptLanguages(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 1271 
Line 1246 
  
   FILE *startupLockFile;   FILE *startupLockFile;
  
   if ((startupLockFile = fopen(ConfigManager::getHomedPath(    if (startupLockFile = fopen(ConfigManager::getHomedPath(CIMSERVER_LOCK_FILE).getCString(), "w"))
           CIMSERVER_LOCK_FILE).getCString(), "w")) != 0)  
   {   {
       lockf(fileno(startupLockFile), F_LOCK, 0);       lockf(fileno(startupLockFile), F_LOCK, 0);
   }   }
Line 1463 
Line 1437 
             Logger::INFORMATION,             Logger::INFORMATION,
             "src.Server.cimserver.STARTED_VERSION",             "src.Server.cimserver.STARTED_VERSION",
             "Started $0 version $1.",             "Started $0 version $1.",
                       _cimServerProcess->getProductName(), _cimServerProcess->getCompleteVersion());              _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


Legend:
Removed from v.1.174.2.2  
changed lines
  Added in v.1.175

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2