version 1.161, 2005/05/05 20:24:31
|
version 1.168, 2005/07/29 18:36:25
|
|
|
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// Modified By: Mike Day (mdday@us.ibm.com) | // Modified By: Mike Day (mdday@us.ibm.com) |
// |
// Karl Schopmeyer (k.schopmeyer@opengroup.org) |
// Modified By: Karl Schopmeyer (k.schopmeyer@opengroup.org) |
// Nag Boranna (nagaraja_boranna@hp.com) |
// |
// Jenny Yu (jenny_yu@hp.com) |
// Modified By: Nag Boranna (nagaraja_boranna@hp.com) |
// Sushma Fernandes (sushma_fernandes@hp.com) |
// |
|
// Modified By: Jenny Yu (jenny_yu@hp.com) |
|
// |
|
// Modified By: Sushma Fernandes (sushma_fernandes@hp.com) |
|
// Carol Ann Krug Graves, Hewlett-Packard Company | // Carol Ann Krug Graves, Hewlett-Packard Company |
// (carolann_graves@hp.com) | // (carolann_graves@hp.com) |
// Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com) | // Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com) |
// |
// Dave Rosckes (rosckes@us.ibm.com) |
// Modified By: Dave Rosckes (rosckes@us.ibm.com) |
// Humberto Rivero (hurivero@us.ibm.com) |
// |
// Steve Hills (steve.hills@ncr.com) |
// Modified By: Humberto Rivero (hurivero@us.ibm.com) |
|
// |
|
// Modified By: Steve Hills (steve.hills@ncr.com) |
|
// Sean Keenan, Hewlett-Packard Company (sean.keenan@hp.com) | // Sean Keenan, Hewlett-Packard Company (sean.keenan@hp.com) |
// |
// Amit K Arora, IBM (amitarora@in.ibm.com) - pep 167 |
// Modified By: Amit K Arora, IBM (amitarora@in.ibm.com) - pep 167 |
// Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) - Bug#2555 |
// |
// Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) - Bug#2032 |
// Modified By: Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) - Bug#2555 |
// Heather Sterling, IBM (hsterl@us.ibm.com) - PEP#222 |
// |
// Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) - Bug#3452 |
// Modified By: Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) - Bug#2032 |
// David Dillard, VERITAS Software Corp. |
// |
// (david.dillard@veritas.com) |
// Modified By: Heather Sterling, IBM (hsterl@us.ibm.com) - PEP#222 |
|
// |
|
// Modified By: Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) - Bug#3452 |
|
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/Constants.h> | #include <Pegasus/Common/Constants.h> |
#include <iostream> |
|
#include <cassert> | #include <cassert> |
#include <cstdlib> | #include <cstdlib> |
#include <fstream> |
|
#include <Pegasus/Common/FileSystem.h> | #include <Pegasus/Common/FileSystem.h> |
#include <Pegasus/Common/Monitor.h> | #include <Pegasus/Common/Monitor.h> |
#include <Pegasus/Common/PegasusVersion.h> | #include <Pegasus/Common/PegasusVersion.h> |
|
|
| |
AutoPtr<CIMServerProcess> _cimServerProcess(new CIMServerProcess()); | AutoPtr<CIMServerProcess> _cimServerProcess(new CIMServerProcess()); |
static CIMServer* _cimServer = 0; | static CIMServer* _cimServer = 0; |
|
static Monitor* _monitor = 0; |
|
static Thread* dummyInitialThread = 0; |
// | // |
// The command name. | // The command name. |
// | // |
|
|
delete _cimServer; | delete _cimServer; |
_cimServer = 0; | _cimServer = 0; |
} | } |
|
if (_monitor) |
|
{ |
|
delete _monitor; |
|
} |
|
if (dummyInitialThread) |
|
{ |
|
Thread::clearLanguages(); |
|
delete dummyInitialThread; |
|
} |
} | } |
| |
// l10n | // l10n |
|
|
"Forced shutdown initiated."); | "Forced shutdown initiated."); |
PEGASUS_STD(cerr) << MessageLoader::getMessage(parms) << PEGASUS_STD(endl); | PEGASUS_STD(cerr) << MessageLoader::getMessage(parms) << PEGASUS_STD(endl); |
} | } |
PEGASUS_STD(cerr) << "Exit! " << endl; |
|
exit(1); | exit(1); |
#endif | #endif |
} | } |
|
|
} | } |
} | } |
| |
|
// Make sure the cimserver has time to actually shut down |
|
Uint32 maxWaitTime = timeoutValue; |
|
while ((maxWaitTime-- > 0) && _cimServerProcess->isCIMServerRunning()) |
|
{ |
|
System::sleep(1); |
|
} |
|
|
return; | return; |
} | } |
| |
|
|
os400StartupOption = true; | os400StartupOption = true; |
daemonOption = true; | daemonOption = true; |
} | } |
|
|
|
if (!os400StartupOption) |
|
{ |
|
// If this is the server job, then set the job |
|
// to save the job log. |
|
system ("QSYS/CHGJOB JOB(*) LOG(4 00 *SECLVL)"); |
|
} |
#endif | #endif |
| |
// | // |
|
|
// 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, |
Thread *dummyInitialThread = new Thread(dummyThreadFunc, NULL, false); |
dummyInitialThread = new Thread(dummyThreadFunc, NULL, false); |
Thread::setCurrent(dummyInitialThread); | Thread::setCurrent(dummyInitialThread); |
AcceptLanguages default_al; | AcceptLanguages default_al; |
try{ | try{ |
|
|
} | } |
#endif | #endif |
| |
|
#ifndef PEGASUS_OS_TYPE_WINDOWS |
|
umask(S_IRWXG|S_IRWXO); |
|
#endif |
| |
#if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ | #if defined(PEGASUS_OS_HPUX) || defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) \ |
|| defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \ | || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(PEGASUS_OS_AIX) \ |
|| defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) || defined (PEGASUS_OS_VMS) | || defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) || defined (PEGASUS_OS_VMS) |
umask(S_IWGRP|S_IWOTH); |
|
| |
// | // |
// check if CIMServer is already running | // check if CIMServer is already running |
|
|
try | try |
{ | { |
| |
Monitor monitor; |
_monitor = new Monitor(); |
//PEP#222 | //PEP#222 |
//CIMServer server(&monitor); | //CIMServer server(&monitor); |
//CimserverHolder cimserverHolder( &server ); | //CimserverHolder cimserverHolder( &server ); |
_cimServer = new CIMServer(&monitor); |
_cimServer = new CIMServer(_monitor); |
| |
| |
if (enableHttpConnection) | if (enableHttpConnection) |
|
|
#endif | #endif |
| |
// bind throws an exception if the bind fails | // bind throws an exception if the bind fails |
|
try { |
_cimServer->bind(); | _cimServer->bind(); |
|
} catch (const BindFailedException &e) |
|
{ |
|
#ifdef PEGASUS_DEBUG |
|
MessageLoaderParms parms("src.Server.cimserver.BIND_FAILED", |
|
"Could not bind: $0.", e.getMessage()); |
|
cout << MessageLoader::getMessage(parms) << endl; |
|
#endif |
|
Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE, |
|
"src.Server.cimserver.BIND.FAILED", |
|
"Could not bind: $0", e.getMessage()); |
| |
|
deleteCIMServer(); |
|
return 1; |
|
} |
// notify parent process (if there is a parent process) to terminate | // notify parent process (if there is a parent process) to terminate |
// so user knows that there is cimserver ready to serve CIM requests. | // so user knows that there is cimserver ready to serve CIM requests. |
if (daemonOption) | if (daemonOption) |