diff --git a/MAC/APL/APLCommon/src/ChildControl.cc b/MAC/APL/APLCommon/src/ChildControl.cc index 62b664e3fe0de9489fb15530dc4314759bbfb038..3a20c21c6aa200af734baed8aa905cc558654e93 100644 --- a/MAC/APL/APLCommon/src/ChildControl.cc +++ b/MAC/APL/APLCommon/src/ChildControl.cc @@ -29,6 +29,7 @@ #include <GCF/GCF_ServiceInfo.h> #include <GCF/Utils.h> #include <APL/APLCommon/APLUtilities.h> +#include <APL/APLCommon/ControllerDefines.h> #include <APL/APLCommon/StationInfo.h> #include <APL/APLCommon/ChildControl.h> #include <Controller_Protocol.ph> @@ -165,7 +166,7 @@ bool ChildControl::startChild (const string& aName, string prefix = wholeSet.getString("prefix"); // Create a parameterset with software related issues. - string cntlrSetName(formatString("%s/%s", LOFAR_SHARE_LOCATION, aName.c_str())); + string cntlrSetName(formatString("%s/%s", LOFAR_SHARE_LOCATION, sharedControllerName(aName).c_str())); LOG_DEBUG_STR("Creating parameterfile: " << cntlrSetName); // first add the controller specific stuff string nodeName(parsetNodeName(aCntlrType)); diff --git a/MAC/APL/APLCommon/src/ControllerAdmin.cc b/MAC/APL/APLCommon/src/ControllerAdmin.cc index 813c9162d4a2cff38c98a3dfca26974a580db323..513166c276bfaf3220f42d339a01014d11664b6a 100644 --- a/MAC/APL/APLCommon/src/ControllerAdmin.cc +++ b/MAC/APL/APLCommon/src/ControllerAdmin.cc @@ -25,6 +25,7 @@ //# Includes #include <Common/LofarLogger.h> +#include <APL/APLCommon/ControllerDefines.h> #include <APL/APLCommon/ControllerAdmin.h> namespace LOFAR { @@ -51,8 +52,9 @@ ControllerAdmin* ControllerAdmin::instance() ControllerAdmin::CIiter ControllerAdmin::findController(const string& name) { CIiter iter = itsList.begin(); const_CIiter end = itsList.end(); + string adminName = sharedControllerName(name); - while (iter != end && iter->getName() != name) { + while (iter != end && sharedControllerName(iter->getName()) != adminName) { iter++; } diff --git a/MAC/APL/APLCommon/src/ParentControl.cc b/MAC/APL/APLCommon/src/ParentControl.cc index 3432533f0ccfd59969311481398342d0a61f894b..25e6042ad9ebea0f8674f5cb114bb1c35207c8f5 100644 --- a/MAC/APL/APLCommon/src/ParentControl.cc +++ b/MAC/APL/APLCommon/src/ParentControl.cc @@ -122,17 +122,19 @@ ParentControl::~ParentControl() // GCFITCPort* ParentControl::registerTask(GCFTask* mainTask) { - itsMainTaskPort = new GCFITCPort(*mainTask, *this, mainTask->getName(), - GCFPortInterface::SAP, CONTROLLER_PROTOCOL); - ASSERTSTR(itsMainTaskPort, "Can not allocate ITC port for parent-control"); - itsMainTaskPort->open(); // will result in F_CONN signal - - itsSDPort = new GCFTCPPort(*this, MAC_SVCMASK_STARTDAEMON, - GCFPortInterface::SAP, STARTDAEMON_PROTOCOL); - ASSERTSTR(itsSDPort, "Can not allocate clientport to startDaemon"); - itsSDPort->open(); // will result in F_COON or F_DISCONN signal - - itsControllerName = mainTask->getName(); // remember for later + if (!itsMainTaskPort) { + itsMainTaskPort = new GCFITCPort(*mainTask, *this, mainTask->getName(), + GCFPortInterface::SAP, CONTROLLER_PROTOCOL); + ASSERTSTR(itsMainTaskPort, "Can not allocate ITC port for parent-control"); + itsMainTaskPort->open(); // will result in F_CONN signal + + itsSDPort = new GCFTCPPort(*this, MAC_SVCMASK_STARTDAEMON, + GCFPortInterface::SAP, STARTDAEMON_PROTOCOL); + ASSERTSTR(itsSDPort, "Can not allocate clientport to startDaemon"); + itsSDPort->open(); // will result in F_COON or F_DISCONN signal + + itsControllerName = mainTask->getName(); // remember for later + } return (itsMainTaskPort); }