version 1.78, 2002/10/09 22:05:02
|
version 1.81, 2002/10/30 20:33:00
|
|
|
usage.append (" -v - displays CIM Server version number\n"); | usage.append (" -v - displays CIM Server version number\n"); |
usage.append (" -h - prints this help message\n"); | usage.append (" -h - prints this help message\n"); |
usage.append (" -s - shuts down CIM Server\n"); | usage.append (" -s - shuts down CIM Server\n"); |
#ifndef PEGASUS_OS_HPUX |
#if !defined(PEGASUS_OS_HPUX) && !defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) |
usage.append (" -D [home] - sets pegasus home directory\n"); | usage.append (" -D [home] - sets pegasus home directory\n"); |
#endif | #endif |
#if defined(PEGASUS_OS_TYPE_WINDOWS) | #if defined(PEGASUS_OS_TYPE_WINDOWS) |
|
|
usage.append (" - sets CIM Server configuration property\n"); | usage.append (" - sets CIM Server configuration property\n"); |
| |
cout << endl; | cout << endl; |
#if defined(PEGASUS_OS_HPUX) |
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) |
cout << PLATFORM_PRODUCT_NAME << " " << PLATFORM_PRODUCT_VERSION << endl; | cout << PLATFORM_PRODUCT_NAME << " " << PLATFORM_PRODUCT_VERSION << endl; |
#else | #else |
cout << PEGASUS_NAME << PEGASUS_VERSION << endl; | cout << PEGASUS_NAME << PEGASUS_VERSION << endl; |
|
|
// The server job may still be active but not responding. | // The server job may still be active but not responding. |
// Kill the job if it exists. | // Kill the job if it exists. |
cimserver_kill(); | cimserver_kill(); |
|
return; |
#endif | #endif |
exit(0); | exit(0); |
} | } |
|
|
#ifdef PEGASUS_OS_OS400 | #ifdef PEGASUS_OS_OS400 |
// Kill the server job. | // Kill the server job. |
cimserver_kill(); | cimserver_kill(); |
|
return; |
#endif | #endif |
exit(1); | exit(1); |
} | } |
|
|
// | // |
if (*option == OPTION_VERSION) | if (*option == OPTION_VERSION) |
{ | { |
#if defined(PEGASUS_OS_HPUX) |
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) |
cout << PLATFORM_PRODUCT_VERSION << endl; | cout << PLATFORM_PRODUCT_VERSION << endl; |
#else | #else |
cout << PEGASUS_VERSION << endl; | cout << PEGASUS_VERSION << endl; |
|
|
PrintHelp(argv[0]); | PrintHelp(argv[0]); |
exit(0); | exit(0); |
} | } |
#ifndef PEGASUS_OS_HPUX |
#if !defined(PEGASUS_OS_HPUX) && !defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) |
else if (*option == OPTION_HOME) | else if (*option == OPTION_HOME) |
{ | { |
if (i + 1 < argc) | if (i + 1 < argc) |
|
|
// 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 |
#if !defined(PEGASUS_OS_HPUX) && !defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) |
Logger::setHomeDirectory(logsDirectory); | Logger::setHomeDirectory(logsDirectory); |
#endif | #endif |
| |
|
|
shutdownCIMOM(timeoutValue); | shutdownCIMOM(timeoutValue); |
| |
cout << "CIM Server stopped." << endl; | cout << "CIM Server stopped." << endl; |
|
#ifdef PEGASUS_OS_OS400 |
|
return(0); |
|
#endif |
exit(0); | exit(0); |
} | } |
| |
|
|
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 |
#if !defined(PEGASUS_OS_HPUX) && !defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) |
cout << "Logs Directory = " << logsDirectory << endl; | cout << "Logs Directory = " << logsDirectory << endl; |
#endif | #endif |
| |
|
|
} | } |
| |
// Put out startup up message. | // Put out startup up message. |
#ifndef PEGASUS_OS_HPUX |
#if !defined(PEGASUS_OS_HPUX) && !defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) |
cout << PEGASUS_NAME << PEGASUS_VERSION << | cout << PEGASUS_NAME << PEGASUS_VERSION << |
" on port " << address << endl; | " on port " << address << endl; |
cout << "Built " << __DATE__ << " " << __TIME__ << endl; | cout << "Built " << __DATE__ << " " << __TIME__ << endl; |
|
|
if (daemonOption) | if (daemonOption) |
{ | { |
if(-1 == cimserver_fork()) | if(-1 == cimserver_fork()) |
|
#ifndef PEGASUS_OS_OS400 |
exit(-1); | exit(-1); |
|
#else |
|
return(-1); |
|
else |
|
return(0); |
|
#endif |
} | } |
| |
#ifdef PEGASUS_OS_OS400 | #ifdef PEGASUS_OS_OS400 |
|
|
| |
#ifdef PEGASUS_OS_HPUX | #ifdef PEGASUS_OS_HPUX |
umask(S_IWGRP|S_IWOTH); | umask(S_IWGRP|S_IWOTH); |
|
|
|
// |
|
// check if CIMServer is already running |
|
// if CIMServer is already running, print message and |
|
// notify parent process (if there is a parent process) to terminate |
|
// |
|
if(isCIMServerRunning()) |
|
{ |
|
cout << "Unable to start CIMServer." << endl; |
|
cout << "CIMServer is already running." << endl; |
|
|
|
// |
|
// notify parent process (if there is a parent process) to terminate |
|
// |
|
if (daemonOption) |
|
notify_parent(); |
|
|
|
exit(1); |
|
} |
|
|
#endif | #endif |
| |
// try loop to bind the address, and run the server | // try loop to bind the address, and run the server |
|
|
// bind throws an exception if the bind fails | // bind throws an exception if the bind fails |
#ifdef PEGASUS_LOCAL_DOMAIN_SOCKET | #ifdef PEGASUS_LOCAL_DOMAIN_SOCKET |
cout << "Binding to domain socket" << endl; | cout << "Binding to domain socket" << endl; |
#elif !defined(PEGASUS_OS_HPUX) |
#elif !defined(PEGASUS_OS_HPUX) && !defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) |
cout << "Binding to " << address << endl; | cout << "Binding to " << address << endl; |
#endif | #endif |
| |
|
|
fclose(pid_file); | fclose(pid_file); |
} | } |
#endif | #endif |
#ifndef PEGASUS_OS_HPUX |
#if !defined(PEGASUS_OS_HPUX) && !defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) |
cout << "Started. " << endl; | cout << "Started. " << endl; |
#endif | #endif |
| |
// Put server started message to the logger | // Put server started message to the logger |
#ifdef PEGASUS_OS_HPUX |
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_IA64_GNU) |
Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, | Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::INFORMATION, |
"Started $0 version $1 on port $2.", | "Started $0 version $1 on port $2.", |
PLATFORM_PRODUCT_NAME, PLATFORM_PRODUCT_VERSION, address); | PLATFORM_PRODUCT_NAME, PLATFORM_PRODUCT_VERSION, address); |