diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2019-02-12 12:25:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-12 12:25:50 -0500 |
commit | 43933b5ec30441536b07f09a0a130624728dab77 (patch) | |
tree | eefe0aca9146ed1f66e27a98b62d3d9d3c29bd38 /spawner.sh | |
parent | a6f0d0a38ea52a202252b871cb00e8b5f604d105 (diff) | |
parent | 7e5eec2af519441606c703f3c8ccd0fcfe63c7ff (diff) | |
download | docker-buildsys-43933b5ec30441536b07f09a0a130624728dab77.tar.gz |
Merge pull request #15 from jhunkeler/timeout-HD-die-more-edition
Improve timeout situation
Diffstat (limited to 'spawner.sh')
-rwxr-xr-x | spawner.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spawner.sh b/spawner.sh new file mode 100755 index 0000000..10553d7 --- /dev/null +++ b/spawner.sh @@ -0,0 +1,9 @@ +#!/bin/bash +limit="${TIMEOUT:-45m}" +echo "This job will automatically terminate after: ${limit}" +timeout -sKILL ${limit} $@ +retval=$? +if [[ ${retval} == 124 ]] || [[ ${retval} == 137 ]]; then + echo "Job terminated: ${limit} time limit reached" +fi +exit ${retval} |