diff --git a/cluster/mesos/docker/util.sh b/cluster/mesos/docker/util.sh index b4fb837b64..0e6ec563c4 100644 --- a/cluster/mesos/docker/util.sh +++ b/cluster/mesos/docker/util.sh @@ -401,12 +401,14 @@ function cluster::mesos::docker::buffer_output { local cmd="$@" local tempfile="$(mktemp "${TMPDIR:-/tmp}/buffer.XXXXXX")" trap "kill -TERM \${PID}; rm '${tempfile}'" TERM INT + set +e ${cmd} &> "${tempfile}" & PID=$! wait ${PID} trap - TERM INT wait ${PID} local exit_status="$?" + set -e if [ "${exit_status}" != 0 ]; then cat "${tempfile}" 1>&2 fi