diff options
Diffstat (limited to 'core/modules/vmchooser2/data/opt/openslx/bin/vmchooser')
-rwxr-xr-x | core/modules/vmchooser2/data/opt/openslx/bin/vmchooser | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser b/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser index b06443ae..0e73cabe 100755 --- a/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser +++ b/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser @@ -54,6 +54,17 @@ if [ -z "${SLX_AUTOLOGIN%OFF}" ] && [ -n "$SLX_VMCHOOSER_TIMEOUT" ] && [ "$SLX_V EXTRA="$EXTRA --autoquit $SLX_VMCHOOSER_TIMEOUT" fi +# Delay autologin a bit to prevent the old vm process still cleaning up while trying to +# set up a new one -- this might lead to OOM errors +if /opt/openslx/lightdm/is-autologin-enabled && [ -s "/run/openslx/session-killed" ]; then + KT=$(cat "/run/openslx/session-killed") + NOW=$(date +%s) + KT=$(( KT + 10 - NOW )) + if [ "$KT" -gt 0 ]; then + sleep "$KT" + fi +fi + # No quotes around $EXTRA! if [ -z "$SLX_LOCATIONS" ]; then exec vmchooser.real "$@" --url "$URL" --fullscreen --tab "$TAB" --start-uuid "$SLX_EXAM_START" $EXTRA |