summaryrefslogtreecommitdiffstats
path: root/logforwarder/src/apps/vespa-logforwarder-start/child-handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logforwarder/src/apps/vespa-logforwarder-start/child-handler.cpp')
-rw-r--r--logforwarder/src/apps/vespa-logforwarder-start/child-handler.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/logforwarder/src/apps/vespa-logforwarder-start/child-handler.cpp b/logforwarder/src/apps/vespa-logforwarder-start/child-handler.cpp
index a478e0bbd01..301c5055272 100644
--- a/logforwarder/src/apps/vespa-logforwarder-start/child-handler.cpp
+++ b/logforwarder/src/apps/vespa-logforwarder-start/child-handler.cpp
@@ -76,6 +76,7 @@ runSplunk(const vespalib::string &prefix, std::vector<const char *> args)
void
ChildHandler::startChild(const vespalib::string &prefix)
{
+ LOG(debug, "startChild '%s'", prefix.c_str());
if (_childRunning && prefix == _runningPrefix) {
runSplunk(prefix, {"restart"});
} else {
@@ -93,9 +94,17 @@ ChildHandler::startChild(const vespalib::string &prefix)
}
}
-void
-ChildHandler::stopChild()
-{
- runSplunk(_runningPrefix, {"stop"});
+void ChildHandler::stopChild() {
+ if (_runningPrefix != "") {
+ LOG(debug, "stopChild '%s'", _runningPrefix.c_str());
+ runSplunk(_runningPrefix, {"stop"});
+ }
_childRunning = false;
}
+
+void
+ChildHandler::stopChild(const vespalib::string &prefix) {
+ stopChild();
+ _runningPrefix = prefix;
+ stopChild();
+}