kill background jobs on exit
This commit is contained in:
parent
84d06df8e6
commit
b93914b71f
@ -30,11 +30,12 @@ g_tmp="$g_tmp/g_$g_scriptname-$$"
|
|||||||
[ -d "$g_tmp" ] || mkdir -p "$g_tmp"
|
[ -d "$g_tmp" ] || mkdir -p "$g_tmp"
|
||||||
|
|
||||||
# START and EXIT Notification
|
# START and EXIT Notification
|
||||||
g_trap_exit="g_logger EXITING $g_scriptname ; rm -r $g_tmp"
|
g_trap_exit="g_logger EXITING $g_scriptname ; rm -r $g_tmp ; g_kill_all_background_jobs"
|
||||||
trap "$g_trap_exit" EXIT
|
trap "$g_trap_exit" EXIT
|
||||||
g_syslogtag="g_bash-script:$g_scriptname[$$]"
|
g_syslogtag="g_bash-script:$g_scriptname[$$]"
|
||||||
[ $g_scriptname = "bash" ] || g_logger STARTING $g_scriptname
|
[ $g_scriptname = "bash" ] || g_logger STARTING $g_scriptname
|
||||||
|
|
||||||
|
|
||||||
# red STDERR output
|
# red STDERR output
|
||||||
exec 9>&2
|
exec 9>&2
|
||||||
exec 8> >(
|
exec 8> >(
|
||||||
|
Loading…
Reference in New Issue
Block a user