From: caremoli Date: Thu, 27 Aug 2009 16:12:13 +0000 (+0000) Subject: CCAR: I have added a way to define the directory for the container log files X-Git-Tag: V5_1_3rc1~80 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b285ce7d6c99d200d7c1d46d8cf4dfcde3caae00;p=modules%2Fkernel.git CCAR: I have added a way to define the directory for the container log files If the environment variable SALOME_TMP_DIR is defined and is a directory the log files are created in this directory and not in /tmp. This modification has only be done for Linux and only for the container logs. Other temporary files go in /tmp as before. --- diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index cc3a42c7b..a110ba69d 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -321,7 +321,17 @@ SALOME_ContainerManager::StartContainer(const Engines::MachineParameters& params string logFilename=getenv("TEMP"); logFilename += "\\"; #else - string logFilename="/tmp/"; + string logFilename="/tmp"; + char* val = getenv("SALOME_TMP_DIR"); + if(val) + { + struct stat file_info; + stat(val, &file_info); + bool is_dir = S_ISDIR(file_info.st_mode); + if (is_dir)logFilename=val; + else std::cerr << "SALOME_TMP_DIR environment variable is not a directory use /tmp instead" << std::endl; + } + logFilename += "/"; #endif logFilename += _NS->ContainerName(params)+"_"+ theMachine +"_"+getenv( "USER" )+".log" ; command += " > " + logFilename + " 2>&1";