Improve watchdog start logic

This commit is contained in:
Nik Bougalis
2016-04-08 09:30:22 -07:00
parent 76d7c1c01a
commit 51850ded05

View File

@@ -266,20 +266,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.
//
@@ -432,6 +418,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"));