Browse Source

HPCC-22689 Init script fixes for configgen tmp dirs and files

Signed-off-by: Mark Kelly <mark.kelly@lexisnexisrisk.com>
Mark Kelly 5 years ago
parent
commit
737f6ad98f

+ 2 - 2
deployment/deploy/deploy.cpp

@@ -627,7 +627,7 @@ public:
     virtual void addTempFile(const char* filePath)
     {
         if (filePath)
-            m_tempFiles.append(filePath);
+            m_tempFiles.appendUniq(filePath);
     }
 
     //---------------------------------------------------------------------------
@@ -636,7 +636,7 @@ public:
     virtual void addTempDirectory(const char* dirPath)
     {
         if (dirPath)
-            m_tempDirs.append(dirPath);
+            m_tempDirs.appendUniq(dirPath);
     }
     //---------------------------------------------------------------------------
     //  setDeployToFolder

+ 9 - 0
initfiles/bash/etc/init.d/dafilesrv.in

@@ -100,6 +100,7 @@ fi
 check_getopt
 
 COMPS=$(${configgen_path}/configgen -env ${envfile} -ip "127.0.0.1" -list)
+rc=$?
 if [[ $rc -ne 0 ]]; then
     log "hpcc-init: failure to build COMPS from configgen call"
     echo -e "\033[31merror\033[0m: hpcc-init -> failure to build COMPS from configgen call"
@@ -145,6 +146,14 @@ if [ -z "$arg" ] || [ $# -ne 1 ]; then
     print_usage
 fi
 
+# for starting hpcc components concurrently, as
+# configgen -validateonly does not create unique tempdirs
+thisos=$(uname -s)
+if [[ "$thisos" = "Linux" && -f "${envfile}" && -n "${component}" && \
+    "${DEBUG}" = "NO_DEBUG" && -z "$HPCC_NO_FLOCK" ]] ; then
+    cfggenpre=(flock ${envfile})
+fi
+
 case "$arg" in
     status|start|restart|stop|setup)
         cmd=$arg

+ 1 - 0
initfiles/bash/etc/init.d/hpcc-init.in

@@ -149,6 +149,7 @@ check_getopt
 basepath=`pwd`
 
 COMPS=$(${configgen_path}/configgen -env ${envfile} -list)
+rc=$?
 if [[ $rc -ne 0 ]]; then
     log "hpcc-init: failure to build COMPS from configgen call"
     echo -e "\033[31merror\033[0m: hpcc-init -> failure to build COMPS from configgen call"