Skip to content

Commit 2bc1df1

Browse files
authored
Fix mishandling of TMPDIR (#362)
TMPDIR is used on many system for the user's temporary dir. Overriding it and deleting has unwanted consequence that any subsequent usage might fail, e.g. on macOS this happens when trying to create FairMQ channels which are backed by unix domain sockets in $TMPDIR. I suspect ROOT would also have troubles with it for some operations, even on linux.
1 parent 17a2d6e commit 2bc1df1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

DATA/production/qc-workflow.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ if [[ -z $QC_JSON_FROM_OUTSIDE ]]; then
6161
exit 1
6262
fi
6363

64-
TMPDIR=$(mktemp -d -t GEN_TOPO_DOWNLOAD_JSON-XXXXXXXXXXXXXXXXXX)
64+
FETCHTMPDIR=$(mktemp -d -t GEN_TOPO_DOWNLOAD_JSON-XXXXXX)
6565

6666
add_QC_JSON()
6767
{
6868
if [[ ${2} =~ ^consul://.* ]]; then
69-
curl -s -o $TMPDIR/$1.json "http://alio2-cr1-hv-aliecs.cern.ch:8500/v1/kv/${2/consul:\/\//}?raw"
69+
curl -s -o $FETCHTMPDIR/$1.json "http://alio2-cr1-hv-aliecs.cern.ch:8500/v1/kv/${2/consul:\/\//}?raw"
7070
if [[ $? != 0 ]]; then
7171
echo "Error fetching QC JSON $2"
7272
exit 1
7373
fi
74-
JSON_FILES+=" $TMPDIR/$1.json"
74+
JSON_FILES+=" $FETCHTMPDIR/$1.json"
7575
else
7676
JSON_FILES+=" ${2}"
7777
fi
@@ -119,7 +119,7 @@ if [[ -z $QC_JSON_FROM_OUTSIDE ]]; then
119119
QC_JSON_FROM_OUTSIDE="$MERGED_JSON_FILENAME"
120120
fi
121121

122-
rm -Rf $TMPDIR
122+
rm -Rf $FETCHTMPDIR
123123
fi
124124

125125
if [[ ! -z "$QC_JSON_FROM_OUTSIDE" ]]; then

0 commit comments

Comments
 (0)