(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.51 and 1.52

version 1.51, 2002/05/16 03:14:23 version 1.52, 2002/05/18 00:51:16
Line 47 
Line 47 
 // //
 // To shutdown pegasus, use the -s option: // To shutdown pegasus, use the -s option:
 // //
 // cimserver -s [-f] [-T timeout_value]  // cimserver -s [-T timeout_value]
 // //
 // To run pegasus as an NT service, there are FOUR  different possibilities: // To run pegasus as an NT service, there are FOUR  different possibilities:
 // //
Line 205 
Line 205 
     usage.append ("    -t          - turns on trace of client IO to console\n");     usage.append ("    -t          - turns on trace of client IO to console\n");
     usage.append ("    -l          - turns on trace of client IO to trace file\n");     usage.append ("    -l          - turns on trace of client IO to trace file\n");
     usage.append ("    -d          - runs pegasus as a daemon\n");     usage.append ("    -d          - runs pegasus as a daemon\n");
     usage.append ("    -s [-f] [-T timeout] \n");      usage.append ("    -s [-T timeout] \n");
     usage.append ("                - shuts down pegasus\n");     usage.append ("                - shuts down pegasus\n");
     usage.append ("    -cleanlogs  - clears the log files at startup\n");     usage.append ("    -cleanlogs  - clears the log files at startup\n");
     usage.append ("    -install    - installs pegasus as a Windows NT Service\n");     usage.append ("    -install    - installs pegasus as a Windows NT Service\n");
Line 223 
Line 223 
     cout << usage << endl;     cout << usage << endl;
 } }
  
 void shutdownCIMOM(Boolean forceOption, Uint32 timeoutValue)  void shutdownCIMOM(Uint32 timeoutValue)
 { {
     //     //
     // Create CIMClient object     // Create CIMClient object
Line 249 
Line 249 
     try     try
     {     {
         client.connectLocal();         client.connectLocal();
   
           //
           // set client timeout to 10 seconds more than the shutdown timeout
           // so that the command client does not timeout before the cimserver
           // terminates
           //
           client.setTimeOut( (timeoutValue + 10)*1000 );
     }     }
     catch(CIMClientException& e)     catch(CIMClientException& e)
     {     {
         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,         Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION,
             "Failed to connect to $0 $1.", PEGASUS_NAME, e.getMessage());             "Failed to connect to $0 $1.", PEGASUS_NAME, e.getMessage());
  
         PEGASUS_STD(cerr) << "Failed to connect to server: ";          PEGASUS_STD(cerr) << "Unable to connect to CIM Server." << PEGASUS_STD(endl);
         PEGASUS_STD(cerr) << e.getMessage() << PEGASUS_STD(endl);          PEGASUS_STD(cerr) << "CIM Server may not be running." << PEGASUS_STD(endl);
           //PEGASUS_STD(cerr) << e.getMessage() << PEGASUS_STD(endl);
         exit(0);         exit(0);
     }     }
  
Line 276 
Line 284 
         Array<CIMParamValue> inParams;         Array<CIMParamValue> inParams;
         Array<CIMParamValue> outParams;         Array<CIMParamValue> outParams;
  
           // set force option to true for now
         inParams.append(CIMParamValue("force",         inParams.append(CIMParamValue("force",
             CIMValue(Boolean(forceOption))));              CIMValue(Boolean(true))));
  
         inParams.append(CIMParamValue("timeout",         inParams.append(CIMParamValue("timeout",
             CIMValue(Uint32(timeoutValue))));             CIMValue(Uint32(timeoutValue))));
Line 351 
Line 360 
     Boolean useSSL = false;     Boolean useSSL = false;
     Boolean daemonOption = false;     Boolean daemonOption = false;
     Boolean shutdownOption = false;     Boolean shutdownOption = false;
     Boolean forceOption = false;  
     Boolean timeoutOption = false;     Boolean timeoutOption = false;
     String  timeoutStr  = String::EMPTY;     String  timeoutStr  = String::EMPTY;
     long timeoutValue  = 0;     long timeoutValue  = 0;
  
   
     //     //
     // Get environment variables:     // Get environment variables:
     //     //
Line 439 
Line 446 
                 //                 //
                 else if (*option == OPTION_SHUTDOWN)                 else if (*option == OPTION_SHUTDOWN)
                 {                 {
                     //  
                     // Check to see if shutdown has already been specified:  
                     //  
                     if (shutdownOption)  
                     {  
                         cout << "Duplicate shutdown option specified." << endl;  
                         exit(0);  
                     }  
                     shutdownOption = true;  
  
                     // remove the option from the command line  
                     memmove(&argv[i], &argv[i + 1], (argc-i) * sizeof(char*));  
                     argc--;  
                 }  
                 else if (*option == OPTION_FORCE)  
                 {  
                     //                     //
                     // Check to see if shutdown has been specified:                      // check to see if user is root
                     //                     //
                     if (!shutdownOption)                      if (!System::isPrivilegedUser())
                     {                     {
                         cout << "Invalid option -" << option << endl;                          cout << "You must have superuser privilege to run ";
                           cout << "cimserver." << endl;
                         exit(0);                         exit(0);
                     }                     }
  
                     //                     //
                     // Check to see if force has already been specified:                      // Check to see if shutdown has already been specified:
                     //                     //
                     if (forceOption)                      if (shutdownOption)
                     {                     {
                         cout << "Duplicate force option specified." << endl;                          cout << "Duplicate shutdown option specified." << endl;
                         exit(0);                         exit(0);
                     }                     }
  
                     forceOption = true;                      shutdownOption = true;
  
                     // 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*));
Line 643 
Line 636 
                 }                 }
             }             }
  
             shutdownCIMOM(forceOption, timeoutValue);              shutdownCIMOM(timeoutValue);
  
             cout << "Pegasus CIM Server terminated." << endl;             cout << "Pegasus CIM Server terminated." << endl;
             exit(0);             exit(0);


Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2