summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmir Taaki <genjix@riseup.net>2013-10-14 05:46:21 (GMT)
committer Amir Taaki <genjix@riseup.net>2013-10-14 05:46:21 (GMT)
commitd6e8d44d5e45b0ad0b33b01e6233a3a5156b5d13 (patch)
tree646bb69338c79695a0ad5400ebc91a555386f6be
parent312e8d753a90fc6e3a09133182dd940df613e898 (diff)
bugfix: config files for worker and balancer not being loaded correctly.v0.2
-rw-r--r--src/balancer/balancer.cpp7
-rw-r--r--src/balancer/config.cpp5
-rw-r--r--src/worker/main.cpp2
3 files changed, 8 insertions, 6 deletions
diff --git a/src/balancer/balancer.cpp b/src/balancer/balancer.cpp
index c3164fa..e9a9b7e 100644
--- a/src/balancer/balancer.cpp
+++ b/src/balancer/balancer.cpp
@@ -1,4 +1,5 @@
#include <vector>
+#include <boost/filesystem.hpp>
#include <bitcoin/bitcoin.hpp>
#include <obelisk/zmq_message.hpp>
#include "config.hpp"
@@ -256,7 +257,11 @@ int main(int argc, char** argv)
load_config(config, argv[1]);
}
else
- load_config(config, "balancer.cfg");
+ {
+ using boost::filesystem::path;
+ path conf_filename = path(SYSCONFDIR) / "obelisk" / "balancer.cfg";
+ load_config(config, conf_filename.native());
+ }
// Prepare our context and sockets
zmq::context_t context(1);
diff --git a/src/balancer/config.cpp b/src/balancer/config.cpp
index 4c2a622..8fe2d5c 100644
--- a/src/balancer/config.cpp
+++ b/src/balancer/config.cpp
@@ -1,6 +1,5 @@
#include "config.hpp"
-#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
#include <libconfig.h++>
@@ -19,13 +18,11 @@ void get_value(const libconfig::Setting& root, config_map_type& config,
void load_config(config_map_type& config, const std::string& filename)
{
- using boost::filesystem::path;
- path conf_path = path(SYSCONFDIR) / filename;
libconfig::Config cfg;
// Ignore error if unable to read config file.
try
{
- cfg.readFile(conf_path.native().c_str());
+ cfg.readFile(filename.c_str());
}
catch (const libconfig::FileIOException&) {}
catch (const libconfig::ParseException&) {}
diff --git a/src/worker/main.cpp b/src/worker/main.cpp
index aa46782..1793248 100644
--- a/src/worker/main.cpp
+++ b/src/worker/main.cpp
@@ -26,7 +26,7 @@ int main(int argc, char** argv)
else
{
using boost::filesystem::path;
- path conf_filename = path(SYSCONFDIR) / "worker.cfg";
+ path conf_filename = path(SYSCONFDIR) / "obelisk" / "worker.cfg";
load_config(config, conf_filename.native());
}
// Create worker.