diff options
author | Jonathan Bauer | 2018-04-10 15:10:37 +0200 |
---|---|---|
committer | Jonathan Bauer | 2018-04-10 15:10:37 +0200 |
commit | 7209b23fb01fd35f6aab2f9e1323efa37eddb823 (patch) | |
tree | 78c47e55dc549ac11c22b6962813e327dc29ad0b /core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc | |
parent | [slx-issue] support for SLX_PXE_NETIF (diff) | |
download | mltk-7209b23fb01fd35f6aab2f9e1323efa37eddb823.tar.gz mltk-7209b23fb01fd35f6aab2f9e1323efa37eddb823.tar.xz mltk-7209b23fb01fd35f6aab2f9e1323efa37eddb823.zip |
[run-virt] check for /tmp/virt not in RAM
to cater for usecases where /tmp is in RAM but /tmp/virt is backed by,
e.g., an NFS (Ramboz)
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc')
-rw-r--r-- | core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc | 15 |
1 files changed, 8 insertions, 7 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 b3bc1cdf..00211c94 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 @@ -31,14 +31,15 @@ if check_dep mkdir && ! mkdir -p "$TMPDIR"; then EXIT_TYPE="internal" EXIT_REASON="Konnte kein Arbeitsverzeichnis für die VM-Sitzung anlegen." cleanexit 1 fi -# Determine if /tmp resides on the hdd -# This variable is empty (but set!) if no hard drive was mounted on /tmp +# Check that /tmp/virt is not in RAM. +# Either mounted directly (e.g. NFS) or backed by hdd mounted /tmp. +# This variable is empty (but set!) if /tmp/virt isn't backed at all # else it will be non-empty (check with helper function 'notempty'). -declare -g TMP_ON_HDD= -if ! grep -q -E '\s+/tmp\s+tmpfs\s+' '/proc/mounts'; then - writelog "Hard drive partition mounted on /tmp" - TMP_ON_HDD=1 - readonly TMP_ON_HDD +declare -g TMPDIR_NOT_RAM= +if ! dir_on_tmpfs /tmp/virt ; then + writelog "/tmp/virt is not in RAM, will allocate more RAM to VMs." + TMPDIR_NOT_RAM=1 + readonly TMPDIR_NOT_RAM fi # Get a unique VM_ID for the current invocation |