#include "Web.h" #include "assert.h" Web::var_map Web::VariableMap; bool Web::initializeVariableMap() { VariableMap["Web"] = &Web::setExecutable; VariableMap["Owner"] = &Web::setUser; VariableMap["P4WEBPORT"] = &Web::setPort; VariableMap["P4PORT"] = &Web::setTargetPort; return true; } Web::Web(const std::string& name, const std::string& type, Configuration * config) : Executable(name, type, config) { } Web::~Web() { } void Web::verifyVariables() throw(VerificationException) { static bool initialized = initializeVariableMap(); assert(initialized); env_map::iterator pos; var_map::const_iterator iter; for (iter = VariableMap.begin(); iter != VariableMap.end(); ++iter) { pos = _variables.find(iter->first); if (pos != _variables.end()) { (this->*iter->second)(pos->second); _variables.erase(pos); } else { std::string err = _type + " " + _name + ". No " + iter->first + " defined"; throw VerificationException(err); } } } void Web::prepareArgs(arg_vec& args) { std::string procname = _executable + " [" + _port + "]"; args.push_back(procname); addOption("Options", NULL, args); args.push_back("-w"); args.push_back(_port); args.push_back("-p"); args.push_back(_targetPort); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 5987 | Sven Erik Knop |
Few minor changes: All commands now accept variable called "Options". This can be used to collect all options for which Perforce has not defined an environment variable - for example the undocumented "-C1" for p4d to start a case insensitive server. p4d also accepts the variables P4USER and P4PASSWD. These are only used for stopping the service, which is done first via "p4 admin stop". Note that if the stop via the admin command fails, p4dcfg will stop the service via a kill |
||
#1 | 5882 | Sven Erik Knop | initial publish |