diff --git a/src/config.cpp b/src/config.cpp index 86078320bebc78cb896b68dfdd55007258357b8a..f3110e8bc794c8e5e34a13cd70adbc3003eb7d34 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -134,6 +134,7 @@ bool Config::load(std::istream &ifs, boost::program_options::options_description bool found_working = false; bool found_pidfile = false; + bool found_portfile = false; bool found_backend_port = false; bool found_database = false; std::string jid = ""; @@ -159,6 +160,9 @@ bool Config::load(std::istream &ifs, boost::program_options::options_description else if (opt.string_key == "service.pidfile") { found_pidfile = true; } + else if (opt.string_key == "service.portfile") { + found_portfile = true; + } else if (opt.string_key == "database.database") { found_database = true; } @@ -174,6 +178,11 @@ bool Config::load(std::istream &ifs, boost::program_options::options_description value.push_back("/var/run/spectrum2/$jid.pid"); parsed.options.push_back(boost::program_options::basic_option("service.pidfile", value)); } + if (!found_portfile) { + std::vector value; + value.push_back("/var/run/spectrum2/$jid.port"); + parsed.options.push_back(boost::program_options::basic_option("service.portfile", value)); + } if (!found_backend_port) { std::vector value; std::string p = boost::lexical_cast(getRandomPort(_jid.empty() ? jid : _jid));