summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2016-07-13 00:16:09 +0200
committerLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2016-07-14 10:55:07 +0200
commite2a4f22ec8f0bcf0cbcfeaeacf4be5d6e42ef2c7 (patch)
tree25825605f7b49b2074c8a9c835e66e3e5bbf127e
parentb6f92f453e499e4cbac0b75feab8cc2415855433 (diff)
downloadmidipix_build-e2a4f22ec8f0bcf0cbcfeaeacf4be5d6e42ef2c7.tar.bz2
midipix_build-e2a4f22ec8f0bcf0cbcfeaeacf4be5d6e42ef2c7.tar.xz
kill(1) the build.sh background process w/ SIGTERM instead of SIGINT in build.sh.
-rwxr-xr-xbuild.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/build.sh b/build.sh
index 876a61a2..8662d5ee 100755
--- a/build.sh
+++ b/build.sh
@@ -105,10 +105,7 @@ if [ -e ${BUILD_LOG_FNAME} ]; then
mv -- ${BUILD_LOG_FNAME} ${BUILD_LOG_LAST_FNAME};
fi;
touch ${BUILD_STATUS_IN_PROGRESS_FNAME};
-trap "rm -f ${BUILD_STATUS_IN_PROGRESS_FNAME}; log_msg failexit \"Build aborted.\"" HUP INT TERM USR1 USR2;
-
{(
-trap "rm -f ${BUILD_STATUS_IN_PROGRESS_FNAME}; log_msg failexit \"Build aborted.\"" HUP INT TERM USR1 USR2;
BUILD_DATE_START="$(date %Y-%m-%d-%H-%M-%S)";
BUILD_NFINI=${BUILD_NSKIP:=${BUILD_NFAIL:=${BUILD_NBUILT:=0}}};
BUILD_TIMES_SECS=$(command date +%s);
@@ -173,6 +170,11 @@ if [ -f "${BUILD_STATUS_IN_PROGRESS_FNAME}" ]; then
fi;
exit ${BUILD_SCRIPT_RC})} 2>&1 | tee ${BUILD_LOG_FNAME} &
-trap "kill -INT $!" HUP INT TERM USR1 USR2; wait;
+TEE_PID=${!};
+trap "rm -f ${BUILD_STATUS_IN_PROGRESS_FNAME}; \
+ log_msg fail \"Build aborted.\"; \
+ echo kill ${TEE_PID}; \
+ kill ${TEE_PID}" HUP INT TERM USR1 USR2;
+wait;
# vim:filetype=sh