aboutsummaryrefslogtreecommitdiffstats
path: root/logforwarder
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2017-10-05 07:25:53 +0000
committerArne Juul <arnej@yahoo-inc.com>2017-10-05 07:25:55 +0000
commit187486aee56dfacf6478d412c9385cb6b17a6193 (patch)
tree820eba1df8fa475a157f86a71c0d28e2a680fc85 /logforwarder
parent38c71c457fd6d3177d541b9dcf2ec32038d8c771 (diff)
fix logic
* missing directory gives ENOENT * cannot get config just after subscribe, must do nextConfig() first
Diffstat (limited to 'logforwarder')
-rw-r--r--logforwarder/src/apps/vespa-logforwarder-start/cf-handler.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.cpp b/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.cpp
index b4b4bdbc7f2..e34a83030e8 100644
--- a/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.cpp
+++ b/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.cpp
@@ -30,11 +30,12 @@ cfFilePath() {
std::string path = vespa::Defaults::underVespaHome("var/db/vespa/splunk");
DIR *dp = opendir(path.c_str());
if (dp == NULL) {
- if (errno != ENOTDIR || mkdir(path.c_str(), 0755) != 0) {
+ if (errno != ENOENT || mkdir(path.c_str(), 0755) != 0) {
perror(path.c_str());
}
+ } else {
+ closedir(dp);
}
- if (dp != NULL) closedir(dp);
path += "/deploymentclient.conf";
return path;
}
@@ -77,7 +78,6 @@ CfHandler::start(const char *configId)
LOG(debug, "Reading configuration with id '%s'", configId);
try {
subscribe(configId, CONFIG_TIMEOUT_MS);
- doConfigure();
} catch (config::ConfigTimeoutException & ex) {
LOG(warning, "Timout getting config, please check your setup. Will exit and restart: %s", ex.getMessage().c_str());
exit(EXIT_FAILURE);