summaryrefslogtreecommitdiffstats
path: root/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_variables.inc
diff options
context:
space:
mode:
authorChristian Rößler2016-11-04 15:59:25 +0100
committerChristian Rößler2016-11-04 15:59:25 +0100
commit13a665d7317615b472a66ce08fe6c0d126cdea39 (patch)
treed5fd4b5f9879f97b5032fc99951d6d3aafc7e7df /remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_variables.inc
parent[run-virt] resolution scripts now detect first connected output device (not o... (diff)
parent[rfs-stage32] Run update-issue after setup_partitions for proper /tmp display (diff)
downloadtm-scripts-13a665d7317615b472a66ce08fe6c0d126cdea39.tar.gz
tm-scripts-13a665d7317615b472a66ce08fe6c0d126cdea39.tar.xz
tm-scripts-13a665d7317615b472a66ce08fe6c0d126cdea39.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_variables.inc')
-rw-r--r--remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_variables.inc26
1 files changed, 26 insertions, 0 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_variables.inc b/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_variables.inc
new file mode 100644
index 00000000..cd9a573a
--- /dev/null
+++ b/remote/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_variables.inc
@@ -0,0 +1,26 @@
+######################################################
+# Include: Declaration of run-virt default variables #
+######################################################
+
+VMCHOOSER_DIR="/opt/openslx/vmchooser"
+VMCHOOSER_CONF_DIR="$VMCHOOSER_DIR/config"
+USER="$(whoami)"
+LOGFILE="/var/log/openslx/run-virt.${USER}.$$.log"
+TMPDIR="/tmp/virt/${USER}/$$"
+
+readonly VMCHOOSER_DIR VMCHOOSER_CONF_DIR LOGFILE TMPDIR USER
+
+# include general configuration from vmchooser
+[ -f "$VMCHOOSER_CONF_DIR/vmchooser.conf" ] && . "$VMCHOOSER_CONF_DIR/vmchooser.conf"
+# load general virtualization information
+[ -f "$VMCHOOSER_CONF_DIR/virtualization.conf" ] && . "$VMCHOOSER_CONF_DIR/virtualization.conf"
+# Load general openslx config
+[ -f "/opt/openslx/config" ] && . "/opt/openslx/config"
+# Create temp dir
+if ! mkdir -p "$TMPDIR"; then
+ slxlog "virt-tmpdir" "Could not create temporary directory '$TMPDIR' for session"
+ error_user "Konnte kein temporäres Arbeitsverzeichnis für die VM-Sitzung anlegen. Ein Computer-Neustart könnte das Problem lösen."
+ cleanexit 1
+ exit 1
+fi
+