diff options
author | Jonathan Bauer | 2019-07-10 14:49:10 +0200 |
---|---|---|
committer | Jonathan Bauer | 2019-07-10 14:49:10 +0200 |
commit | 520560505cb22616440b6e5459fd9c79eec734a3 (patch) | |
tree | 6745247c711250be5d4c286ab89f8a7894317d02 /core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt | |
parent | [vmware-common] Actually pass some file to grep... (diff) | |
download | mltk-520560505cb22616440b6e5459fd9c79eec734a3.tar.gz mltk-520560505cb22616440b6e5459fd9c79eec734a3.tar.xz mltk-520560505cb22616440b6e5459fd9c79eec734a3.zip |
[run-virt] improve signal traps handling
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt')
-rwxr-xr-x | core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt b/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt index f545145b..aef4ba79 100755 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt @@ -31,6 +31,7 @@ readonly SELF # Useless without this . /opt/openslx/config +. /opt/openslx/bin/slx-tools # Global variables needed for the core functionality declare -rg VMCHOOSER_DIR="/opt/openslx/vmchooser" @@ -86,7 +87,10 @@ main() { exit 1 fi - trap 'trap "" SIGINT SIGTERM; cleanexit' SIGINT SIGTERM + trap 'cleanexit $?' EXIT + trap 'cleanexit 129' SIGHUP + trap 'cleanexit 130' SIGINT + trap 'cleanexit 143' SIGTERM # Starting sourcing the includes files. Note that the critical ones should use # the '--exit' option of safesource to trigger cleanexit in case of a corrupted/bad @@ -173,7 +177,6 @@ main() { cleanexit 0 } - # Detach main & RUNVIRT_PID="$!" |