From: Renaud Barate Date: Wed, 27 May 2015 07:26:04 +0000 (+0200) Subject: Allow usage of localhost resource by different users (fix EDF issue #10699) X-Git-Tag: V7_7_0a1~37 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e38f3a71303798dc332b26ad14f38a8b2f2637ec;p=modules%2Fkernel.git Allow usage of localhost resource by different users (fix EDF issue #10699) localhost resource working directory now contains user name to avoid access problems. localhost resource working directory uses TMPDIR env var to get the base directory. --- diff --git a/src/ResourcesManager/ResourcesManager.cxx b/src/ResourcesManager/ResourcesManager.cxx index c90c6019d..0ddc3a8f1 100644 --- a/src/ResourcesManager/ResourcesManager.cxx +++ b/src/ResourcesManager/ResourcesManager.cxx @@ -603,7 +603,12 @@ void ResourcesManager_cpp::AddDefaultResourceInCatalog() { resource.AppliPath = string(getenv("HOME")) + "/" + getenv("APPLI"); } - resource.working_directory = "/tmp/salome_localres_workdir"; + string tmpdir = "/tmp"; + if (getenv("TMPDIR") != NULL) + tmpdir = getenv("TMPDIR"); + resource.working_directory = tmpdir + "/salome_localres_workdir"; + if (getenv("USER") != NULL) + resource.working_directory += string("_") + getenv("USER"); resource.can_launch_batch_jobs = true; resource.can_run_containers = true; _resourcesList[resource.Name] = resource;