浏览代码

HPCC-23868 Fix issues starting Dali without environment

1) Disable white list if no environment
2) Default NamedMutex (only used by Dali) to current directory,
if no 'lock' path setting available from environment.

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith 5 年之前
父节点
当前提交
0682ebd7d5
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2 0
      dali/server/daserver.cpp
  2. 1 1
      system/jlib/jmutex.cpp

+ 2 - 0
dali/server/daserver.cpp

@@ -148,6 +148,8 @@ static bool populateWhiteListFromEnvironment(IWhiteListWriter &writer)
         return false;
         return false;
     Owned<IRemoteConnection> conn = querySDS().connect("/Environment", 0, 0, INFINITE);
     Owned<IRemoteConnection> conn = querySDS().connect("/Environment", 0, 0, INFINITE);
     assertex(conn);
     assertex(conn);
+    if (!conn->queryRoot()->hasProp("Software/DaliServerProcess"))
+        return false;
 
 
     // only ever expecting 1 DaliServerProcess and 1 WhiteList
     // only ever expecting 1 DaliServerProcess and 1 WhiteList
     const IPropertyTree *whiteListTree = conn->queryRoot()->queryPropTree("Software/DaliServerProcess[1]/WhiteList[1]");
     const IPropertyTree *whiteListTree = conn->queryRoot()->queryPropTree("Software/DaliServerProcess[1]/WhiteList[1]");

+ 1 - 1
system/jlib/jmutex.cpp

@@ -209,7 +209,7 @@ NamedMutex::NamedMutex(const char *name)
         if (0 == lockPrefix.length())
         if (0 == lockPrefix.length())
         {
         {
             if (!getConfigurationDirectory(NULL, "lock", NULL, NULL, lockPrefix))
             if (!getConfigurationDirectory(NULL, "lock", NULL, NULL, lockPrefix))
-                throw MakeStringException(0, "Failed to get lock directory from environment");
+                WARNLOG("Failed to get lock directory from environment");
         }
         }
         addPathSepChar(lockPrefix);
         addPathSepChar(lockPrefix);
         lockPrefix.append("JLIBMUTEX_");
         lockPrefix.append("JLIBMUTEX_");