Make TMPDIR optional

This commit is contained in:
Karl Isenberg 2016-01-04 16:46:11 -08:00
parent 4ca42f075c
commit 1a6509083f

View File

@ -441,7 +441,7 @@ function cluster::mesos::docker::create_basic_user {
# Buffers command output to file, prints output on failure.
function cluster::mesos::docker::buffer_output {
local cmd="$@"
local tempfile="$(mktemp "${TMPDIR}/buffer.XXXXXX")"
local tempfile="$(mktemp "${TMPDIR:-/tmp}/buffer.XXXXXX")"
trap "kill -TERM \${PID}; rm '${tempfile}'" TERM INT
${cmd} &> "${tempfile}" &
PID=$!