00001 //====================================================================== 00002 // $Id: dbu.cc,v 1.6 2004/02/12 18:04:55 rhatcher Exp $ 00003 // 00004 // This is the "main" routine for dbu (based on JobCmain) 00005 // 00006 // rhatcher@fnal.gov 00007 //====================================================================== 00008 #include <cstdlib> 00009 #include "DatabaseInterface/DbiTableProxyRegistry.h" 00010 #include "JobControl/JobController.h" 00011 #include "JobControl/JobCEnv.h" 00012 00013 #include "DatabaseUpdater/DbuSignalHandler.h" 00014 00015 #include "OnlineUtil/msgLogLib/msgLog.h" 00016 #include "OnlineUtil/minosDaq.h" /* msgLog node ids defined here */ 00017 00018 //#define NOSYSLOG 00019 #ifdef NOSYSLOG 00020 void closelog __P ((void)) {;} 00021 void openlog __P ((__const char *__ident, int __option, 00022 int __facility)) {;} 00023 int setlogmask __P ((int __mask)) { return 0;} 00024 void syslog __P ((int __pri, __const char *__fmt, ...)) {;} 00025 #endif 00026 00027 #include <iostream> 00028 00029 //---- main program ---------------------------------------------------- 00030 int main(int argc, char** argv) 00031 { 00032 // we're not free to define/parse command options as this will be 00033 // handled by JobControl, so currently there's no command line 00034 // way of configuring the msgLog service. 00035 //#define MSGLOG_VERBOSE 00036 #ifdef MSGLOG_VERBOSE 00037 #define PRINTMSGLOG 1 00038 #define DEBUGMSGLOGLEVEL 100 00039 #else 00040 #define PRINTMSGLOG 0 00041 #define DEBUGMSGLOGLEVEL 1 00042 #endif 00043 00044 int echoMsgLog = PRINTMSGLOG; 00045 int debugMsgLogLevel = DEBUGMSGLOGLEVEL; 00046 00047 msgLogInit(argv[0]); 00048 msgLogNodeIdSet(MINOS_ONLINE_DBU); 00049 msgLogLocalEchoSet(echoMsgLog); 00050 logDebugLevelSet(debugMsgLogLevel); 00051 logNotice("starting %s",argv[0]); 00052 00053 00054 JobCEnv& e = JobCEnv::Instance(argc, argv); 00055 00056 // get the signal handlers installed 00057 DbuSignalHandler::Instance().HandleDelayedSignal(); 00058 00059 // New style CINT interface 00060 int exit_status = EXIT_FAILURE; 00061 if (e.RunRootApp()) { 00062 logNotice("dbu shutdown (success)"); 00063 exit_status = EXIT_SUCCESS; 00064 } 00065 else { 00066 logNotice("dbu shutdown (failure)"); 00067 exit_status = EXIT_FAILURE; 00068 } 00069 msgLogCleanup(); 00070 return exit_status; 00071 00072 }
1.3.9.1