From 08349fb2fd1a79861996df893cb07b152dded777 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 9 Jul 2019 17:11:35 +0200 Subject: [run-virt] Get rid of wrapper and handle directly in run-virt --- .../openslx/vmchooser/run-virt-includes/init_core.inc | 18 ------------------ .../run-virt-includes/vmchooser_runvirt_functions.inc | 5 +++-- 2 files changed, 3 insertions(+), 20 deletions(-) (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes') diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc index cc204d53..79b2ddd1 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc @@ -3,24 +3,6 @@ # Include: Sets core variables and directories # ################################################ -# Check if the path to the logfile was given externally (by the wrapper) -unset WRAPPED -if notempty LOGFILE; then - if [ ! -w "${LOGFILE}" ]; then - # given logfile is not writeable or non-existant - # so handle it ourself (so do not set WRAPPED) - rm -f "${LOGFILE}" - unset LOGFILE - else - # given logfile was ok, mark that we are wrapped - # (for cleanexit to not slxlog the log since - # the wrapper is handling that for us) - declare -rg WRAPPED=aye - fi -fi -isset LOGFILE || declare -rg LOGFILE="/var/log/openslx/run-virt.${USER}.$$.log" -ln -sf "$LOGFILE" "/var/log/openslx/run-virt.latest.log" - # Create temporary directory for current invocation if check_dep mkdir && ! mkdir -p "$TMPDIR" "$CONFDIR"; then writelog "Could not create temporary directories for session" 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 7b4554ea..aaace562 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 @@ -176,8 +176,9 @@ cleanexit() { # 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) - [ "x${EXIT_TYPE}" != "xuser" ] && ! isset WRAPPED && \ - slxlog "runvirt-exit-${EXIT_TYPE}" "Critical error happened in '${BASH_SOURCE[1]}:${FUNCNAME[1]}', see logs." "${LOGFILE}" + 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}" " -- cgit v1.2.3-55-g7522