summaryrefslogtreecommitdiffstats
path: root/configd
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2019-11-15 12:39:34 +0100
committerJon Marius Venstad <venstad@gmail.com>2019-11-15 13:02:31 +0100
commit0656b8600cb2f1425e98d87f2bbd2fbc6aeeb406 (patch)
tree84ad7c3b2eba17af1246f1973214e05f77c609a8 /configd
parent52a5a424000cb4a1bcc61e601c6f4a183103e3d1 (diff)
Catch PortListenException in config-sentinel main loop, and exit
Diffstat (limited to 'configd')
-rw-r--r--configd/src/apps/sentinel/sentinel.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/configd/src/apps/sentinel/sentinel.cpp b/configd/src/apps/sentinel/sentinel.cpp
index 023b96ce96c..741eb5514bb 100644
--- a/configd/src/apps/sentinel/sentinel.cpp
+++ b/configd/src/apps/sentinel/sentinel.cpp
@@ -5,6 +5,7 @@
#include <unistd.h>
#include <sys/time.h>
#include <vespa/vespalib/util/signalhandler.h>
+#include <vespa/vespalib/util/exceptions.h>
#include <vespa/defaults.h>
#include "config-handler.h"
@@ -85,8 +86,11 @@ main(int argc, char **argv)
vespalib::SignalHandler::CHLD.clear();
handler.doWork(); // Check for child procs & commands
} catch (InvalidConfigException& ex) {
- LOG(warning, "Configuration problem: (ignoring): %s",
- ex.what());
+ LOG(warning, "Configuration problem: (ignoring): %s", ex.what());
+ } catch (vespalib::PortListenException& ex) {
+ LOG(error, "Fatal: %s", ex.getMessage().c_str());
+ EV_STOPPING("config-sentinel", ex.what());
+ exit(EXIT_FAILURE);
}
if (vespalib::SignalHandler::CHLD.check()) {
continue;