summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc')
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc10
1 files changed, 4 insertions, 6 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc
index aaace562..f049642d 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/vmchooser_runvirt_functions.inc
@@ -120,6 +120,7 @@ add_cleanup() {
# EXIT_REASON should contain a user-friendly message to print to the user.
# it can be prefixed with err.\S+, which will serve as a translation identifier
cleanexit() {
+ trap "" SIGHUP SIGINT SIGTERM EXIT
writelog "Cleanexit '$1' triggered by '${BASH_SOURCE[1]}:${FUNCNAME[1]}'"
sleep 1
while isset CLEANUP_TASKS; do
@@ -134,6 +135,9 @@ cleanexit() {
fi
done
+ # kill potential remaining background jobs
+ kill $(jobs -p)
+
# If we're not in debug mode, remove all temporary files
if notempty SLX_DEBUG && isset TMPDIR; then
rm -rf -- "${TMPDIR}"
@@ -174,12 +178,6 @@ cleanexit() {
ERR_TEXT="Unbekannter Fehler"
fi
- # first send the logfile (in case the user does not close the error before using magic keys e.g.)
- # for any other error types besides 'user'. Do no slxlog if we run wrapped (from /opt/openslx/scripts/vmchooser-run_virt)
- if [ "x${EXIT_TYPE}" != "xuser" ]; then
- writelog "Critical error happened in '${BASH_SOURCE[1]}:${FUNCNAME[1]}'"
- fi
-
# finally display the error
error_user "${ERR_TITLE}" "
${ERR_TEXT}