(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.54 and 1.57

version 1.54, 2002/05/28 18:47:11 version 1.57, 2002/06/01 00:25:05
Line 314 
Line 314 
         // CIM Server gets shutdown, if CIM Server is still running at         // CIM Server gets shutdown, if CIM Server is still running at
         // this time, we will kill the cimserver process.         // this time, we will kill the cimserver process.
         //         //
           // give CIM Server some time to finish up
 #if defined(PEGASUS_OS_HPUX)          //
   
         // give cimom some time to finish up  
         System::sleep(1);         System::sleep(1);
           cimserver_kill();
         // add code to kill cimom if it is still running  
   
 #endif  
     }     }
     catch(Exception& e)     catch(Exception& e)
     {     {
         PEGASUS_STD(cerr) << "Failed to shutdown server: ";          PEGASUS_STD(cerr) << "Error occurred while stopping the CIM Server: ";
         PEGASUS_STD(cerr) << e.getMessage() << PEGASUS_STD(endl);         PEGASUS_STD(cerr) << e.getMessage() << PEGASUS_STD(endl);
         exit(1);         exit(1);
     }     }
Line 439 
Line 434 
                     //                     //
                     // check to see if user is root                     // check to see if user is root
                     //                     //
                     if (!System::isPrivilegedUser())                      if (!System::isPrivilegedUser(System::getEffectiveUserName()))
                     {                     {
                         cout << "You must have superuser privilege to run ";                         cout << "You must have superuser privilege to run ";
                         cout << "cimserver." << endl;                         cout << "cimserver." << endl;
Line 602 
Line 597 
         // 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.
  
   #ifndef PEGASUS_OS_HPUX
         Logger::setHomeDirectory(logsDirectory);         Logger::setHomeDirectory(logsDirectory);
   #endif
  
         //         //
         // Check to see if we need to shutdown CIMOM         // Check to see if we need to shutdown CIMOM
Line 640 
Line 637 
         httpsPort = configManager->getCurrentValue("httpsPort");         httpsPort = configManager->getCurrentValue("httpsPort");
  
         // Leave this in until people get familiar with the logs.         // Leave this in until people get familiar with the logs.
   #ifndef PEGASUS_OS_HPUX
         cout << "Logs Directory = " << logsDirectory << endl;         cout << "Logs Directory = " << logsDirectory << endl;
   #endif
  
         if (String::equal(configManager->getCurrentValue("cleanlogs"), "true"))         if (String::equal(configManager->getCurrentValue("cleanlogs"), "true"))
         {         {
Line 712 
Line 711 
           exit(-1);           exit(-1);
     }     }
  
     // Put server starting message to the logger  
     Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,  
         "Starting $0 version $1 on port $2 $3 $4 $5",  
                 PEGASUS_NAME,  
                 PEGASUS_VERSION,  
                 address,  
                 (useSLP ? " SLP on " : " SLP off "),  
                 (useSSL ? " Use SSL " : " No SSL "));  
   
     // try loop to bind the address, and run the server     // try loop to bind the address, and run the server
     try     try
     {     {
Line 752 
Line 742 
  
 #if defined(PEGASUS_OS_HPUX) #if defined(PEGASUS_OS_HPUX)
         //         //
         // create a file to indicate that the cimserver has started          // create a file to indicate that the cimserver has started and
         //          // save the process id of the cimserver process in the file
         fstream fs;  
         ArrayDestroyer<char> p(CIMSERVERSTART_FILE.allocateCString());  
         fs.open(p.getPointer(), ios::in | ios::out);  
         if (!fs)  
         {  
             //             //
             // failed to create the file, write an entry to the log file  
             // and proceed          // remove the old file if it exists
             //          System::removeFile(fname);
             //Logger::put(Logger::STANDARD_LOG, "CIMServer",  
             //    Logger::INFORMATION,          // open the file
             //    "Failed to open the $0 file needed by cimserverd.",          FILE *pid_file = fopen(fname, "w");
             //    CIMSERVERSTART_FILE);          if (pid_file)
         }  
         else  
         {         {
             fs.close();              // save the pid in the file
               fprintf(pid_file, "%ld\n", (long)server_pid);
               fclose(pid_file);
         }         }
 #endif #endif
         cout << "Started. " << endl;         cout << "Started. " << endl;
  
         // Put server started message to the logger         // Put server started message to the logger
         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,
             "$0 started.", PEGASUS_NAME);                      "Started $0 version $1 on port $2.",
                       PEGASUS_NAME, PEGASUS_VERSION, address);
   
  
         //         //
         // Loop to call CIMServer's runForever() method until CIMServer         // Loop to call CIMServer's runForever() method until CIMServer
Line 814 
Line 801 
  
 #if defined(PEGASUS_OS_HPUX) #if defined(PEGASUS_OS_HPUX)
         //         //
         // close the file at startup time to indicate that the cimserver          // close the file created at startup time to indicate that the
         // has terminated normally.          // cimserver has terminated normally.
         //         //
         FileSystem::removeFile(CIMSERVERSTART_FILE);         FileSystem::removeFile(CIMSERVERSTART_FILE);
 #endif #endif
Line 823 
Line 810 
     catch(Exception& e)     catch(Exception& e)
     {     {
         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,
             "$0 Abnormal Termination.", e.getMessage());              "$0 .Abnormal Termination.", e.getMessage());
  
         PEGASUS_STD(cerr) << "Error: " << e.getMessage() << PEGASUS_STD(endl);         PEGASUS_STD(cerr) << "Error: " << e.getMessage() << PEGASUS_STD(endl);
         return 1;         return 1;


Legend:
Removed from v.1.54  
changed lines
  Added in v.1.57

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2