From 6ee8363caa02411cbc6851e5f8ecfa407643e8f0 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Wed, 28 Apr 2010 15:33:15 +0200 Subject: clean exit added + port redirects now via xml file --- .../init-hooks/80-after-plugins/virtualization.sh | 2 +- .../plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm | 4 +- os-plugins/plugins/vmgrid/files/run-vmgrid.sh | 46 ++++++++++++++++------ .../init-hooks/80-after-plugins/virtualization.sh | 2 +- 4 files changed, 38 insertions(+), 16 deletions(-) (limited to 'os-plugins/plugins') diff --git a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh index 400075cd..a1da2e63 100644 --- a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh +++ b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh @@ -30,7 +30,7 @@ active=0 [ ${vmgrid_active} -ne 0 ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ - && echo -e "Executing the virtual 'virtualization' plugin ... \c" + && echo -e "Executing the 'virtualization' plugin ... \c" if [ ${active} -ne 0 ] ; then diff --git a/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm b/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm index 401a2151..c3542274 100644 --- a/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm +++ b/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm @@ -72,9 +72,9 @@ sub getAttrInfo description => unshiftHereDoc(<<' End-of-Here'), which virtualization technique schould be used? End-of-Here - content_regex => qr{^(vmware|virtualbox|qemukvm|xen)$}, + content_regex => qr{^(virtualbox|qemukvm|xen)$}, #openvz|vserver - content_descr => 'vmware, virtualbox, qemukvm, xen', + content_descr => 'virtualbox, qemukvm, xen', #openvz, vserver default => undef, }, diff --git a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh index a684310b..9b9adb44 100644 --- a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh +++ b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh @@ -49,6 +49,17 @@ writelog () { echo -e "$1" >> ${vmgrid_rwmnt}/logs/run-vmgrid.${USER}.$$.log } +# remove config dirs when exit +cleanexit () { + if echo "${RMDIRS}" 2>/dev/null | grep -q ${vmgrid_virt}; then + writelog "${vmgrid_virt} exited. Cleanning up... \c" + rm -rf ${RMDIRS} >/dev/null 2>&1 + writelog "done" + fi + + exit "$1" +} + ################################################################################ ### Get XML file and dir ################################################################################ @@ -289,11 +300,28 @@ vmostype=$(grep -io '/dev/null @@ -377,7 +406,7 @@ elif [ -n "${VIRTCMDHL}" ]; then ${VIRTCMDHL} ${VIRTCMDOPTSHL} 2>/dev/null else writelog "${vmgrid_virt}: No headless mode defined, exiting!" - exit 1 + cleanexit 1 fi # postrun for scripts after virtualization finishes @@ -385,12 +414,5 @@ if [ -n "${POSTRUN}" ]; then eval ${POSTRUN} >/dev/null 2>&1 fi -# remove config dirs when finished -if echo "${RMDIRS}" 2>/dev/null | grep -q ${vmgrid_virt}; then - writelog "${vmgrid_virt} exited. Cleanning up... \c" - rm -rf ${RMDIRS} >/dev/null 2>&1 - writelog "done" -fi - -echo -e "Bye." +cleanexit 0 exit 0 diff --git a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh index 400075cd..a1da2e63 100644 --- a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh +++ b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh @@ -30,7 +30,7 @@ active=0 [ ${vmgrid_active} -ne 0 ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ - && echo -e "Executing the virtual 'virtualization' plugin ... \c" + && echo -e "Executing the 'virtualization' plugin ... \c" if [ ${active} -ne 0 ] ; then -- cgit v1.2.3-55-g7522 From 536f8326396ee2ab11577b15069100cf73124e7f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 28 Apr 2010 20:53:45 +0200 Subject: minor fixes --- initramfs/distro-specs/ubuntu/functions-default | 2 +- .../plugins/profile/OpenSLX/Distro/Ubuntu_10.pm | 66 ++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm (limited to 'os-plugins/plugins') diff --git a/initramfs/distro-specs/ubuntu/functions-default b/initramfs/distro-specs/ubuntu/functions-default index bfd01524..41af807e 100644 --- a/initramfs/distro-specs/ubuntu/functions-default +++ b/initramfs/distro-specs/ubuntu/functions-default @@ -97,7 +97,7 @@ elif [ -e /mnt/etc/init.d/${script} -a -n "$1" -a -n "$2" ] ; then [ "$DEBUGLEVEL" == 5 ] && echo "Linked $script" done else - error echo "Target $(pwd)../${script} does not exist. Skipping links." + error "Target $(pwd)../${script} does not exist. Skipping links." nonfatal fi } diff --git a/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm b/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm new file mode 100644 index 00000000..3b288e97 --- /dev/null +++ b/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm @@ -0,0 +1,66 @@ +# Copyright (c) 2009 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your suggestions, praise, or complaints to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org/ +# ----------------------------------------------------------------------------- +# profile/OpenSLX/Distro/Ubuntu.pm +# - provides Debian-specific overrides of the Distro API for the profile +# plugin. +# ----------------------------------------------------------------------------- +package profile::OpenSLX::Distro::Ubuntu_10; + +use strict; +use warnings; + +use base qw(profile::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +sub _getKdeHomeMap +{ + my $self = shift; + + return; +} + +sub getProfileDPAth +{ + my $self = shift; + + + return "/etc/profile.d/slx-kdehome.sh"; +} + +sub getKdeHome +{ + my $self = shift; + + return ".openslx/ubuntu-lucid.kde"; +} + +sub getGconfPathConfig +{ + my $self = shift; + + return "/etc/gconf/2/path"; +} + + +sub getGconfHome +{ + my $self = shift; + + return ".openslx.ubuntu-lucid.gconf"; +} + +1; -- cgit v1.2.3-55-g7522 From 36b3473d1854d9bc4d9ed5d0bec578ca076f556e Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Thu, 29 Apr 2010 18:34:29 +0200 Subject: bug if statement changed, so it works if only one plugin installed --- .../vmchooser/init-hooks/80-after-plugins/virtualization.sh | 8 ++++---- .../plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'os-plugins/plugins') diff --git a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh index a1da2e63..37576331 100644 --- a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh +++ b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh @@ -25,9 +25,9 @@ PLUGINCONFDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}/plugins/virtualization # check if plugins available active=0 [ -f ${CONFFILEVMCHOOSER} ] && . ${CONFFILEVMCHOOSER} -[ ${vmchooser_active} -ne 0 ] && active=1 +[ "x${vmchooser_active}" = "x1" ] && active=1 [ -f ${CONFFILEVMGRID} ] && . ${CONFFILEVMGRID} -[ ${vmgrid_active} -ne 0 ] && active=1 +[ "x${vmgrid_active}" = "x1" ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ && echo -e "Executing the 'virtualization' plugin ... \c" @@ -46,7 +46,7 @@ if [ ${active} -ne 0 ] ; then | awk '{print $2}') / 1024) echo "totalmem=${totalmem}" >> ${PLUGINCONFDIR}/virtualization.conf - if [ ${vmgrid_active} -ne 0 ]; then + if [ "x${vmgrid_active}" = "x1" ]; then totalmemtest=$(expr $(echo ${vmgrid_memratio} \ | awk -F ',' '{print $1" + "$2" + "$3" + "$4" + "$5" + "$6}')) @@ -63,7 +63,7 @@ if [ ${active} -ne 0 ] ; then fi # main vm mem (vmchooser) - if [ ${vmchooser_active} -ne 0 ]; then + if [ "x${vmchooser_active}" = "x1" ]; then mainvirtratio=$(echo ${vmgrid_memratio} | awk -F ',' '{print $5}') mainvirtmem=$(expr ${totalmem} \* ${mainvirtratio} / 100 2>/dev/null) if [ ${mainvirtmem} -lt 512 2>/dev/null ]; then diff --git a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh index a1da2e63..37576331 100644 --- a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh +++ b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh @@ -25,9 +25,9 @@ PLUGINCONFDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}/plugins/virtualization # check if plugins available active=0 [ -f ${CONFFILEVMCHOOSER} ] && . ${CONFFILEVMCHOOSER} -[ ${vmchooser_active} -ne 0 ] && active=1 +[ "x${vmchooser_active}" = "x1" ] && active=1 [ -f ${CONFFILEVMGRID} ] && . ${CONFFILEVMGRID} -[ ${vmgrid_active} -ne 0 ] && active=1 +[ "x${vmgrid_active}" = "x1" ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ && echo -e "Executing the 'virtualization' plugin ... \c" @@ -46,7 +46,7 @@ if [ ${active} -ne 0 ] ; then | awk '{print $2}') / 1024) echo "totalmem=${totalmem}" >> ${PLUGINCONFDIR}/virtualization.conf - if [ ${vmgrid_active} -ne 0 ]; then + if [ "x${vmgrid_active}" = "x1" ]; then totalmemtest=$(expr $(echo ${vmgrid_memratio} \ | awk -F ',' '{print $1" + "$2" + "$3" + "$4" + "$5" + "$6}')) @@ -63,7 +63,7 @@ if [ ${active} -ne 0 ] ; then fi # main vm mem (vmchooser) - if [ ${vmchooser_active} -ne 0 ]; then + if [ "x${vmchooser_active}" = "x1" ]; then mainvirtratio=$(echo ${vmgrid_memratio} | awk -F ',' '{print $5}') mainvirtmem=$(expr ${totalmem} \* ${mainvirtratio} / 100 2>/dev/null) if [ ${mainvirtmem} -lt 512 2>/dev/null ]; then -- cgit v1.2.3-55-g7522