version 1.81, 2002/10/30 20:33:00
|
version 1.82, 2003/01/25 14:41:32
|
|
|
#if defined(PEGASUS_OS_TYPE_WINDOWS) | #if defined(PEGASUS_OS_TYPE_WINDOWS) |
usage.append (" -install - installs pegasus as a Windows NT Service\n"); | usage.append (" -install - installs pegasus as a Windows NT Service\n"); |
usage.append (" -remove - removes pegasus as a Windows NT Service\n"); | usage.append (" -remove - removes pegasus as a Windows NT Service\n"); |
|
usage.append (" -start - starts pegasus as a Windows NT Service\n"); |
|
usage.append (" -stop - stops pegasus as a Windows NT Service\n"); |
#endif | #endif |
usage.append (" configProperty=value\n"); | usage.append (" configProperty=value\n"); |
usage.append (" - sets CIM Server configuration property\n"); | usage.append (" - sets CIM Server configuration property\n"); |
|
|
pegasusHome = OS400_DEFAULT_PEGASUS_HOME; | pegasusHome = OS400_DEFAULT_PEGASUS_HOME; |
#endif | #endif |
| |
|
#ifndef PEGASUS_OS_TYPE_WINDOWS |
// | // |
// Get environment variables: | // Get environment variables: |
// | // |
|
|
} | } |
| |
FileSystem::translateSlashes(pegasusHome); | FileSystem::translateSlashes(pegasusHome); |
|
#else |
| |
|
// windows only |
|
setHome(pegasusHome); |
|
#endif |
// on Windows NT if there are no command-line options, run as a service | // on Windows NT if there are no command-line options, run as a service |
| |
if (argc == 1 ) | if (argc == 1 ) |
|
|
// | // |
// Check to see if user asked for shutdown (-s option): | // Check to see if user asked for shutdown (-s option): |
// | // |
else if (*option == OPTION_SHUTDOWN) |
else if (*option == OPTION_SHUTDOWN && |
|
(strlen(option) == 1)) |
{ | { |
// | // |
// check to see if user is root | // check to see if user is root |
|
|
// | // |
// Check to see if we should (can) install as a NT service | // Check to see if we should (can) install as a NT service |
// | // |
|
|
if (String::equal(configManager->getCurrentValue("install"), "true")) | if (String::equal(configManager->getCurrentValue("install"), "true")) |
{ | { |
if( 0 != cimserver_install_nt_service( pegasusHome )) |
if(cimserver_install_nt_service()) |
{ | { |
cout << "\nPegasus installed as NT Service"; | cout << "\nPegasus installed as NT Service"; |
exit(0); | exit(0); |
} | } |
|
else |
|
{ |
|
exit(0); |
|
} |
} | } |
| |
// | // |
|
|
| |
if (String::equal(configManager->getCurrentValue("remove"), "true")) | if (String::equal(configManager->getCurrentValue("remove"), "true")) |
{ | { |
if( 0 != cimserver_remove_nt_service() ) |
if(cimserver_remove_nt_service()) |
{ | { |
cout << "\nPegasus removed as NT Service"; | cout << "\nPegasus removed as NT Service"; |
exit(0); | exit(0); |
} | } |
|
else |
|
{ |
|
exit(0); |
|
} |
|
|
|
} |
|
|
|
// |
|
// Check to see if we should (can) start as a NT service |
|
// |
|
if (String::equal(configManager->getCurrentValue("start"), "true")) |
|
{ |
|
if(cimserver_start_nt_service()) |
|
{ |
|
cout << "\nPegasus started as NT Service"; |
|
exit(0); |
|
} |
|
else |
|
{ |
|
exit(0); |
|
} |
|
} |
|
|
|
// |
|
// Check to see if we should (can) stop as a NT service |
|
// |
|
if (String::equal(configManager->getCurrentValue("stop"), "true")) |
|
{ |
|
if(cimserver_stop_nt_service()) |
|
{ |
|
cout << "\nPegasus stopped as NT Service"; |
|
exit(0); |
|
} |
|
else |
|
{ |
|
exit(0); |
|
} |
} | } |
| |
// | // |