Commit 55229eb8 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Allow configuring the base temp directory in the JSON configuration file too

There still needs to be a default in the code in case the parameter is
missing from the config file
parent 7fe8c8c9
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
}, },
"Meadow" : { "Meadow" : {
"REMARKS" : { "REMARKS" : {
"RunWorkerPath" : "The path of runWorker.pl . When null or missing, beekeeper will use $EHIVE_ROOT_DIR or its own path. When RunWorkerPath is '', beekeeper assumes runWorker.pl is in $PATH" "HOWTO" : "These parameters are optional. When setting them, move them out of the REMARKS section at the same time",
"BaseTempDirectory" : "Where to create temporary directories for workers. When null or missing, workers will use /tmp",
"RunWorkerPath" : "The path of runWorker.pl . When null or missing, beekeeper will use $EHIVE_ROOT_DIR or its own path. When RunWorkerPath is '', beekeeper assumes runWorker.pl is in $PATH"
}, },
"CleanupTempDirectoryKilledWorkers" : 0, "CleanupTempDirectoryKilledWorkers" : 0,
"MaxLimboSeconds" : 10, "MaxLimboSeconds" : 10,
......
...@@ -222,7 +222,7 @@ sub create_new_worker { ...@@ -222,7 +222,7 @@ sub create_new_worker {
} }
$worker->set_log_directory_name($hive_log_dir, $worker_log_dir); $worker->set_log_directory_name($hive_log_dir, $worker_log_dir);
$worker->set_temp_directory_name( $worker_base_temp_dir ); $worker->set_temp_directory_name( $worker_base_temp_dir || $meadow->config_get('BaseTempDirectory') );
$worker->init; $worker->init;
...@@ -572,6 +572,7 @@ sub check_for_dead_workers { # scans the whole Valley for lost Workers (but i ...@@ -572,6 +572,7 @@ sub check_for_dead_workers { # scans the whole Valley for lost Workers (but i
if( ($worker->status ne 'SUBMITTED') # There is no worker_temp_directory before specialization if( ($worker->status ne 'SUBMITTED') # There is no worker_temp_directory before specialization
and ($worker->meadow_user eq $this_meadow_user) ) { # if I'm actually allowed to kill the worker... and ($worker->meadow_user eq $this_meadow_user) ) { # if I'm actually allowed to kill the worker...
$worker->set_temp_directory_name( $this_meadow->config_get('BaseTempDirectory') );
$this_meadow->cleanup_temp_directory( $worker ); $this_meadow->cleanup_temp_directory( $worker );
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment