summaryrefslogtreecommitdiff
path: root/server/src/pracrod.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/pracrod.cc')
-rw-r--r--server/src/pracrod.cc20
1 files changed, 7 insertions, 13 deletions
diff --git a/server/src/pracrod.cc b/server/src/pracrod.cc
index c668159..6ee1817 100644
--- a/server/src/pracrod.cc
+++ b/server/src/pracrod.cc
@@ -52,6 +52,7 @@
// For getopt_long and friends
#include <getopt.h>
+#include "configurationparser.h"
#include "configuration.h"
#include "server.h"
@@ -82,19 +83,19 @@ static const char usage_str[] =
" -h, --help Print this message and exit.\n"
;
+ConfigurationParser *configparser = NULL;
+
void reload(int)
{
- /*
int port;
printf("Reload!\n");
- port = config()->lookup("port");
- config()->reload();
+ port = configparser->lookup("port");
+ configparser->reload();
{ // Force wake the server process for reinitialization.
TCPSocket socket;
socket.connect("localhost", port);
}
- */
}
class PracroDaemon : public Daemon {
@@ -170,15 +171,8 @@ int main(int argc, char *argv[])
}
// Load config
- /*
- char defval[512];
- sprintf(defval, ETC"/pracrod.conf");
- char *cfname = NULL;
- if(!configfile) cfname = defval;//ETC"/pracrod.conf";
- else cfname = configfile;
- Configuration conf(cfname);
- initConfig(&conf);
- */
+ if(configfile) configparser = new ConfigurationParser(configfile);
+ else configparser = new ConfigurationParser(ETC"/pracrod.conf");
if(!user) {
user = strdup(Conf::server_user.c_str());