From 79ca82c0789c3a551c9f58ea4be9506df1b41b6c Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Fri, 8 Apr 2016 09:30:22 -0700 Subject: [PATCH] Improve watchdog start logic --- src/ripple/app/main/Main.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/ripple/app/main/Main.cpp b/src/ripple/app/main/Main.cpp index 5f99346766..883823e594 100644 --- a/src/ripple/app/main/Main.cpp +++ b/src/ripple/app/main/Main.cpp @@ -267,20 +267,6 @@ int run (int argc, char** argv) return 0; } - // Use a watchdog process unless we're invoking a stand alone type of mode - // - if (HaveSustain () - && !vm.count ("parameters") - && !vm.count ("fg") - && !vm.count ("standalone") - && !vm.count ("unittest")) - { - std::string logMe = DoSustain (); - - if (!logMe.empty ()) - std::cerr << logMe << std::endl; - } - // Run the unit tests if requested. // The unit tests will exit the application with an appropriate return code. // @@ -434,6 +420,14 @@ int run (int argc, char** argv) // No arguments. Run server. if (!vm.count ("parameters")) { + if (HaveSustain() && !vm.count ("fg") && !config->RUN_STANDALONE) + { + auto const ret = DoSustain (); + + if (!ret.empty ()) + std::cerr << "Watchdog: " << ret << std::endl; + } + if (vm.count ("debug")) setDebugJournalSink (logs->get("Debug"));