diff options
author | Jonathan Bauer | 2017-08-16 12:35:58 +0200 |
---|---|---|
committer | Jonathan Bauer | 2017-08-16 12:35:58 +0200 |
commit | 1e11848ca8604a03d411cbf1b4c39b5fb44cdbec (patch) | |
tree | b8e53fcaff332c26bca201a2a7736be4c001a228 /core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes | |
parent | [run-virt] make sure TMP_ON_HDD is empty if needed (diff) | |
download | mltk-1e11848ca8604a03d411cbf1b4c39b5fb44cdbec.tar.gz mltk-1e11848ca8604a03d411cbf1b4c39b5fb44cdbec.tar.xz mltk-1e11848ca8604a03d411cbf1b4c39b5fb44cdbec.zip |
[run-virt] TMP_ON_HDD stuff
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes')
2 files changed, 5 insertions, 2 deletions
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 9af8839a..95e90ebf 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 @@ -30,8 +30,11 @@ if check_dep mkdir && ! mkdir -p "$TMPDIR"; then writelog "Could not create temporary directory '$TMPDIR' for session" EXIT_TYPE="internal" EXIT_REASON="Konnte kein Arbeitsverzeichnis für die VM-Sitzung anlegen." cleanexit 1 fi -declare -g TMP_ON_HDD= + # Determine if /tmp resides on the hdd +# This variable is empty (but set!) if no hard drive was mounted on /tmp +# else it will be non-empty (check with helper function 'notempty'). +declare -g TMP_ON_HDD= if grep -q -E '^/dev/\S+\s/tmp' '/proc/mounts'; then writelog "Hard drive partition mounted on /tmp" TMP_ON_HDD=1 diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc index 46af7496..48a5cf3c 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc @@ -34,7 +34,7 @@ set_virt_memory() { # Amount of memory for the VM. Be generous if diff is written to HDD local min=768 local reserve max - if isset TMP_ON_HDD; then + if notempty TMP_ON_HDD; then if lsmod | grep -q '^nvidia'; then max=2800 reserve=28 |