From 46fb710fbe74a5a3e8e1dc1cc5498ace1ae618bb 2011-08-02 15:03:25 From: Jan Kaluza Date: 2011-08-02 15:03:25 Subject: [PATCH] pass BACKEND_ID --- diff --git a/src/networkpluginserver.cpp b/src/networkpluginserver.cpp index dbed1b3e911d80a1b01a6bba6b2151bb2cd2c131..d3b05652cae0d27d2446362247e5dd0475a5386b 100644 --- a/src/networkpluginserver.cpp +++ b/src/networkpluginserver.cpp @@ -47,6 +47,8 @@ using namespace log4cxx; namespace Transport { +static unsigned long backend_id; + static LoggerPtr logger = Logger::getLogger("NetworkPluginServer"); class NetworkConversation : public Conversation { @@ -94,6 +96,7 @@ class NetworkFactory : public Factory { wrap.SerializeToString(&MESSAGE); static pid_t exec_(std::string path, const char *host, const char *port, const char *config) { + boost::replace_all(path, "BACKEND_ID", boost::lexical_cast(backend_id++)); path += std::string(" --host ") + host + " --port " + port + " " + config; LOG4CXX_INFO(logger, "Starting new backend " << path); char *p = (char *) malloc(path.size() + 1);