From dbd0520cc4bf480c7b542cc49bc809fdc1525156 Mon Sep 17 00:00:00 2001 From: Anton Tyutin Date: Thu, 22 Mar 2018 17:56:47 +0300 Subject: [PATCH] Propagate CHLD and USR1 signal to the Process Manager --- build/run-nginx.sh | 4 ++-- build/run-ppm.sh | 4 ++-- build/run-standalone.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/run-nginx.sh b/build/run-nginx.sh index 56aa369..6f12a50 100644 --- a/build/run-nginx.sh +++ b/build/run-nginx.sh @@ -1,6 +1,6 @@ #!/bin/bash -trapIt () { "$@"& pid="$!"; trap "kill -INT $pid" INT TERM; while kill -0 $pid > /dev/null 2>&1; do wait $pid; ec="$?"; done; exit $ec;}; +trapIt () { "$@"& pid="$!"; for SGNL in INT TERM CHLD USR1; do trap "kill -$SGNL $pid" "$SGNL"; done; while kill -0 $pid > /dev/null 2>&1; do wait $pid; ec="$?"; done; exit $ec; }; STATIC=/var/www/ args=" $@ " @@ -20,4 +20,4 @@ ARGS='--port=8080 --socket-path=/ppm/run --pidfile=/ppm/ppm.pid' # make sure static-directory is not served by php-pm ARGS="$ARGS --static-directory=''" -trapIt /ppm/vendor/bin/ppm start --ansi $ARGS $@ \ No newline at end of file +trapIt /ppm/vendor/bin/ppm start --ansi $ARGS $@ diff --git a/build/run-ppm.sh b/build/run-ppm.sh index 3478989..ddc007d 100644 --- a/build/run-ppm.sh +++ b/build/run-ppm.sh @@ -1,5 +1,5 @@ #!/bin/bash -trapIt () { "$@"& pid="$!"; trap "kill -INT $pid" INT TERM; while kill -0 $pid > /dev/null 2>&1; do wait $pid; ec="$?"; done; exit $ec;}; +trapIt () { "$@"& pid="$!"; for SGNL in INT TERM CHLD USR1; do trap "kill -$SGNL $pid" "$SGNL"; done; while kill -0 $pid > /dev/null 2>&1; do wait $pid; ec="$?"; done; exit $ec; }; -trapIt /ppm/vendor/bin/ppm --ansi "$@" \ No newline at end of file +trapIt /ppm/vendor/bin/ppm --ansi "$@" diff --git a/build/run-standalone.sh b/build/run-standalone.sh index ce73379..ffa619d 100644 --- a/build/run-standalone.sh +++ b/build/run-standalone.sh @@ -1,6 +1,6 @@ #!/bin/bash -trapIt () { "$@"& pid="$!"; trap "kill -INT $pid" INT TERM; while kill -0 $pid > /dev/null 2>&1; do wait $pid; ec="$?"; done; exit $ec;}; +trapIt () { "$@"& pid="$!"; for SGNL in INT TERM CHLD USR1; do trap "kill -$SGNL $pid" "$SGNL"; done; while kill -0 $pid > /dev/null 2>&1; do wait $pid; ec="$?"; done; exit $ec; }; ARGS='--port 80' trapIt /ppm/vendor/bin/ppm start --ansi $ARGS $@