diff --git a/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc index bfb6138b975dd939d9e8e3cb7cd5b02b6bec2bb0..10e89211e210afbd86b76e38289219758c586494 100644 --- a/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc +++ b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc @@ -35,13 +35,18 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char *argv[]) { - GCFScheduler::instance()->init(argc, argv, "KeyValueLogger"); - LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_KVLogger"); - - KeyValueLogger kvl("KeyValueLogger"); - kvl.start(); // make initial transition - - GCFScheduler::instance()->run(); + try { + GCFScheduler::instance()->init(argc, argv, "KeyValueLogger"); + LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_KVLogger"); + + KeyValueLogger kvl("KeyValueLogger"); + kvl.start(); // make initial transition + + GCFScheduler::instance()->run(); + } catch( Exception &ex ) { + LOG_FATAL_STR("Caught exception: " << ex); + return 1; + } return (0); } diff --git a/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc b/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc index 65cd3c3ceddb4333eda0613478c95cc015df3471..9b4132e8c3b68ceec69a7e7867ea99796c836ba8 100644 --- a/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc +++ b/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc @@ -35,13 +35,18 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char *argv[]) { - GCFScheduler::instance()->init(argc, argv, "LogProcessor"); -// LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_LogProcessor"); - - LogProcessor clp("LogProcessor"); - clp.start(); // make initial transition - - GCFScheduler::instance()->run(); + try { + GCFScheduler::instance()->init(argc, argv, "LogProcessor"); + // LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_LogProcessor"); + + LogProcessor clp("LogProcessor"); + clp.start(); // make initial transition + + GCFScheduler::instance()->run(); + } catch( Exception &ex ) { + LOG_FATAL_STR("Caught exception: " << ex); + return 1; + } return (0); } diff --git a/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc b/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc index e7c3000739a1cd3acc7befd7d4740cca83226a40..d265a8f6b058d41f18639a9a2a82fe8c4189fd35 100644 --- a/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc +++ b/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc @@ -35,13 +35,18 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char *argv[]) { - GCFScheduler::instance()->init(argc, argv, "SASGateway"); - LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_SASGateway"); - - SASGateway SGW("SASGateway"); - SGW.start(); // make initial transition - - GCFScheduler::instance()->run(); + try { + GCFScheduler::instance()->init(argc, argv, "SASGateway"); + LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_SASGateway"); + + SASGateway SGW("SASGateway"); + SGW.start(); // make initial transition + + GCFScheduler::instance()->run(); + } catch( Exception &ex ) { + LOG_FATAL_STR("Caught exception: " << ex); + return 1; + } return (0); } diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc index a1c9969cd39aefcf263acc2452843d0a418c049a..fe578f42de9fbb06606e0b87893c5cbd4a38a88f 100644 --- a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc +++ b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc @@ -40,28 +40,33 @@ Exception::TerminateHandler t(Exception::terminate); int main(int argc, char* argv[]) { - // args: cntlrname, parentHost, parentService - GCFScheduler::instance()->init(argc, argv, "SoftwareMonitor"); + try { + // args: cntlrname, parentHost, parentService + GCFScheduler::instance()->init(argc, argv, "SoftwareMonitor"); - LOG_INFO("MACProcessScope: LOFAR_PermSW_SoftwareMonitor"); - LOG_INFO(Version::getInfo<CURTDBDaemonsVersion>("SoftwareMonitor")); + LOG_INFO("MACProcessScope: LOFAR_PermSW_SoftwareMonitor"); + LOG_INFO(Version::getInfo<CURTDBDaemonsVersion>("SoftwareMonitor")); - // for debugging purposes - registerProtocol (DP_PROTOCOL, DP_PROTOCOL_STRINGS); + // for debugging purposes + registerProtocol (DP_PROTOCOL, DP_PROTOCOL_STRINGS); - // Create tasks and call initial routines - SoftwareMonitor* swm = new SoftwareMonitor("SoftwareMonitor"); - ASSERTSTR(swm, "Can't create an software monitortask"); - swm->start(); + // Create tasks and call initial routines + SoftwareMonitor* swm = new SoftwareMonitor("SoftwareMonitor"); + ASSERTSTR(swm, "Can't create an software monitortask"); + swm->start(); - // ok, we have something to do, do it. - GCFScheduler::instance()->setDelayedQuit(true); // we need a clean shutdown - GCFScheduler::instance()->run(); // until stop was called + // ok, we have something to do, do it. + GCFScheduler::instance()->setDelayedQuit(true); // we need a clean shutdown + GCFScheduler::instance()->run(); // until stop was called - swm->quit(); // let task quit nicely + swm->quit(); // let task quit nicely - double postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5); - GCFScheduler::instance()->run(postRunTime); // let processes die. + double postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5); + GCFScheduler::instance()->run(postRunTime); // let processes die. + } catch( Exception &ex ) { + LOG_FATAL_STR("Caught exception: " << ex); + return 1; + } return (0); }