forked from ungleich-public/cdist
use kill 0 on SIGINT and SIGTERM, but not on trap EXIT
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
ca84f1b2b8
commit
56cf428d4c
2 changed files with 6 additions and 17 deletions
|
@ -355,15 +355,17 @@ __cdist_tmp_removal()
|
|||
rm -rf "${__cdist_tmp_dir}"
|
||||
}
|
||||
|
||||
__cdist_exit_on_kill()
|
||||
__cdist_kill_on_interrupt()
|
||||
{
|
||||
# FIXME: before 1.8.0 -> kill all children, but do not segfault
|
||||
# kill 0
|
||||
__cdist_tmp_removal
|
||||
kill 0
|
||||
}
|
||||
|
||||
# Remove tempfiles at normal exit
|
||||
trap __cdist_tmp_removal EXIT
|
||||
trap __cdist_exit_on_kill INT TERM
|
||||
|
||||
# Kill children on interrupt
|
||||
trap __cdist_kill_on_interrupt INT TERM
|
||||
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -25,19 +25,6 @@
|
|||
[ $# -ge 1 ] || __cdist_usage "[-p] <target host> [target host ]"
|
||||
set -u
|
||||
|
||||
# trap __cdist_tmp_removal EXIT
|
||||
trap killandclean EXIT
|
||||
|
||||
killandclean()
|
||||
{
|
||||
__cdist_echo info "Existing and killing children..."
|
||||
kill 0
|
||||
|
||||
# Ensure tmp stuff is being removed
|
||||
__cdist_cleanly_exit
|
||||
}
|
||||
|
||||
|
||||
filter()
|
||||
{
|
||||
awk -v host=$1 '{ print "[" host "] " $0 }'
|
||||
|
|
Loading…
Reference in a new issue