Skip to content

Commit

Permalink
Fix buffer_output to actually handle interrupts
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Isenberg committed Jan 6, 2016
1 parent acef040 commit ff0a287
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cluster/mesos/docker/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ff0a287

Please sign in to comment.