diff options
author | Jonathan Bauer | 2018-04-20 14:28:14 +0200 |
---|---|---|
committer | Jonathan Bauer | 2018-04-20 14:28:14 +0200 |
commit | c18a3299bce9308018687d97c43f0fa11a5151a8 (patch) | |
tree | dd41ea6f2cb078535c64e93386c20deab35345f7 /core | |
parent | [vbox-src] vbox-env: exit 1 on critical steps (diff) | |
download | mltk-c18a3299bce9308018687d97c43f0fa11a5151a8.tar.gz mltk-c18a3299bce9308018687d97c43f0fa11a5151a8.tar.xz mltk-c18a3299bce9308018687d97c43f0fa11a5151a8.zip |
[vbox-src] validate downloaded xml file
and check that vbox.service start successfully
Diffstat (limited to 'core')
-rwxr-xr-x | core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/init_core.inc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/init_core.inc b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/init_core.inc index f63d41cd..f724bc25 100755 --- a/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/init_core.inc +++ b/core/modules/vbox-src/data/opt/openslx/vmchooser/plugins/virtualbox/includes/init_core.inc @@ -163,6 +163,21 @@ init_core() { fi done + # check if the systemd vbox setup service ran successfully + if ! systemctl is-active vbox.service; then + local STATUSDUMP=$(mktemp) + systemctl status vbox.service > "$STATUSDUMP" + slxlog "virt-vbox-env" "vbox.service failed to start properly" "$STATUSDUMP" + EXIT_TYPE="internal" EXIT_REASON="VirtualBox wurde nicht richtig initialisiert!" cleanexit 1 + fi + + # validate that TMPCONFIG is actually an xml file + if ! xmlstarlet val "$TMPCONFIG"; then + slxlog "virt-vbox-noxml" "Downloaded machine description was not a valid xml." "$TMPCONFIG" + EXIT_TYPE="internal" EXIT_REASON="Die VM-Konfiguration ist keine valide VirtualBox-Datei! +Ihren Satelliten scheint VirtualBox nicht zu unterstützen." cleanexit 1 + fi + # Define which features the VMware plugin supports # Session specific dir for VM configs declare -rg VBOX_ROOT="/tmp/virt/${PLUGIN_ID}/${USER}.$$" |