diff options
| author | Michael Janczyk | 2010-03-22 19:06:22 +0100 |
|---|---|---|
| committer | Michael Janczyk | 2010-03-22 19:06:22 +0100 |
| commit | 3f82922eef9a7b3e894d629d6cac59cadb66e2de (patch) | |
| tree | 6a01c4c65bb88da9e268d1c3bddac520fa8811b2 /os-plugins/plugins/vmgrid/files | |
| parent | qemukvm angepasst... geht noch nicht :( (diff) | |
| download | core-3f82922eef9a7b3e894d629d6cac59cadb66e2de.tar.gz core-3f82922eef9a7b3e894d629d6cac59cadb66e2de.tar.xz core-3f82922eef9a7b3e894d629d6cac59cadb66e2de.zip | |
small bugfix regarding xmlfile and paths.
writelog now additional into rwshare.
virtualbox rmdirs new.
qemukvm plugin added new konfigurations and headless support, to be tested
Diffstat (limited to 'os-plugins/plugins/vmgrid/files')
| -rw-r--r-- | os-plugins/plugins/vmgrid/files/run-vmgrid.sh | 42 | ||||
| -rw-r--r-- | os-plugins/plugins/vmgrid/files/vmgrid | 30 |
2 files changed, 39 insertions, 33 deletions
diff --git a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh index 4a09f237..18e62ea0 100644 --- a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh +++ b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh @@ -18,23 +18,12 @@ . /etc/opt/openslx/openslx.conf ################################################################################ -### Functions used throughout the script -################################################################################ - -# function to write to stdout and logfile -writelog () { - # write to stdout - echo -e "$1" - # log into file - echo -e "$1" >> ${OPENSLX_DEFAULT_LOGDIR}/run-vmgrid.${USER}.$$.log -} - -################################################################################ ### Define default dirs / get configs ################################################################################ PLUGINCONFROOT=${OPENSLX_DEFAULT_CONFDIR}/plugins PLUGINCONFVMGRID=${PLUGINCONFROOT}/vmgrid +RWSHARE=/var/opt/openslx/plugins/vmgrid/share # include general configuration from vmgrid [ -f ${PLUGINCONFVMGRID}/vmgrid.conf ] && \ . ${PLUGINCONFVMGRID}/vmgrid.conf @@ -45,21 +34,36 @@ PLUGINCONFVMGRID=${PLUGINCONFROOT}/vmgrid . ${PLUGINCONFROOT}/vmchooser/vmchooser.conf ################################################################################ +### Functions used throughout the script +################################################################################ + +# function to write to stdout and logfile +mkdir -p ${RWSHARE}/var/log/openslx 2>/dev/null +writelog () { + # write to stdout + echo -e "$1" + # log into file + echo -e "$1" >> ${OPENSLX_DEFAULT_LOGDIR}/run-vmgrid.${USER}.$$.log + # log into share dir, so that log is available in vm as well + echo -e "$1" >> ${RWSHARE}/var/log/openslx/run-vmgrid.${USER}.$$.log +} + +################################################################################ ### Get XML file and dir ################################################################################ # check if forcemem set -# TODO: klappt noch nicht immer :( if [ "$1" = "--forcemem" ]; then forcemem=$2 - xmlfile=${3##*/} + xmlfile=$3 else - xmlfile=${1##*/} + xmlfile=$1 fi # absolute or relative path? -if ls ${1} 2>/dev/null | grep '/' >/dev/null 2>&1; then - xmlpath=$(dirname ${1}) +if ls ${xmlfile} 2>/dev/null | grep '/' >/dev/null 2>&1; then + xmlpath=$(dirname ${xmlfile}) + xmlfile=$(basename ${xmlfile}) else xmlpath=${vmgrid_xmlpath} fi @@ -265,8 +269,6 @@ ide="TRUE" scsi="FALSE" hddrv="ide" -# TODO: vncclient IP:59001 oder Plugin? - # add rw share rwshare="/var/opt/openslx/plugins/vmgrid/share" @@ -296,7 +298,7 @@ fi # start headless if [ -n "${VIRTCMDHL}" ]; then - writelog "Starting ${vmgrid_virt} head-less..." + writelog "Starting ${vmgrid_virt} headless..." ${VIRTCMDHL} ${VIRTCMDOPTSHL} else writelog "${vmgrid_virt}: No headless mode defined, exiting!" diff --git a/os-plugins/plugins/vmgrid/files/vmgrid b/os-plugins/plugins/vmgrid/files/vmgrid index 66291aea..7257226e 100644 --- a/os-plugins/plugins/vmgrid/files/vmgrid +++ b/os-plugins/plugins/vmgrid/files/vmgrid @@ -27,29 +27,18 @@ if [ -n "$1" ]; then echo "Usage: vmgrid [[/path/]filename[.xml]]" exit 0 else - run-vmgrid.sh $1 & + run-vmgrid.sh $@ & exit 0 fi fi ################################################################################ -### Functions used throughout the script -################################################################################ - -# function to write to stdout and logfile -writelog () { - # write to stdout - echo -e "$1" - # log into file - echo -e "$1" >> ${OPENSLX_DEFAULT_LOGDIR}/run-vmgrid.${USER}.$$.log -} - -################################################################################ ### Define default dirs / get configs ################################################################################ PLUGINCONFROOT=${OPENSLX_DEFAULT_CONFDIR}/plugins PLUGINCONFDIR=${PLUGINCONFROOT}/vmgrid +RWSHARE=/var/opt/openslx/plugins/vmgrid/share # include general configuration from vmgrid [ -f ${PLUGINCONFDIR}/vmgrid.conf ] && \ . ${PLUGINCONFDIR}/vmgrid.conf @@ -58,6 +47,21 @@ PLUGINCONFDIR=${PLUGINCONFROOT}/vmgrid . ${PLUGINCONFROOT}/vmchooser/vmchooser.conf ################################################################################ +### Functions used throughout the script +################################################################################ + +# function to write to stdout and logfile +mkdir -p ${RWSHARE}/var/log/openslx 2>/dev/null +writelog () { + # write to stdout + echo -e "$1" + # log into file + echo -e "$1" >> ${OPENSLX_DEFAULT_LOGDIR}/run-vmgrid.${USER}.$$.log + # log into share dir, so that log is available in vm as well + echo -e "$1" >> ${RWSHARE}/var/log/openslx/run-vmgrid.${USER}.$$.log +} + +################################################################################ ### Configure VMs for autostart and set RAM ################################################################################ |
