summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdata/openslx-install2
-rwxr-xr-xdata/openslx-update23
-rwxr-xr-xremote/modules/dnbd3/data/opt/openslx/scripts/systemd-setup_dnbd36
-rw-r--r--remote/modules/dnbd3/dnbd3.conf2
-rwxr-xr-xremote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt109
5 files changed, 78 insertions, 64 deletions
diff --git a/data/openslx-install b/data/openslx-install
index d511e88d..1c943efa 100755
--- a/data/openslx-install
+++ b/data/openslx-install
@@ -300,7 +300,7 @@ print "Dienste konfiguriert."
#
print ""
print "Schreibe Bootzeit-Konfiguration für MiniLinux"
-cat > "/srv/openslx/www/config" << HEREEND
+cat > "/opt/openslx/client-config" << HEREEND
SLX_VM_NFS='$SLX_VM_NFS'
SLX_HTTP_ADDR='http://$SLX_LOCAL_ADDR'
SLX_NTP_SERVER='$SLX_NTP_SERVER'
diff --git a/data/openslx-update b/data/openslx-update
index 10ee3d7e..9a0c06a7 100755
--- a/data/openslx-update
+++ b/data/openslx-update
@@ -32,13 +32,14 @@ function download ()
else
print "Prüfsummencheck Datei $1 ok."
fi
+ DLFLAG=1
return 0
}
### Constants ###################################
# Web
MIRROR="http://mltk.boot.openslx.org"
-MIRRORDIR="files"
+MIRRORDIR="files2"
# Files/Dirs
PXEDIR="/srv/openslx/tftp/pxelinux.cfg"
PXECONFIG="$PXEDIR/default"
@@ -50,6 +51,7 @@ SCRIPTBACKUPDIR="/root/backup"
SERVERDEFAULTS="/opt/openslx/server-defaults"
LOCALINDEX="/opt/openslx/local_version"
WWWTEMP="/srv/openslx/www-temp"
+CLIENTCONFIG="/opt/openslx/client-config"
# Other
SLXSCRIPTS="openslx-install openslx-update"
NOW=$(date +%Y%m%d)
@@ -126,7 +128,7 @@ fi
print ""
print "Lade Liste aktuell verfügbarer Versionen..."
-wget -nv -O "$REMOTEINDEX" "$MIRROR/index" || error "Konnte Liste verfügbarer Releases nicht herunterladen."
+wget -nv -O "$REMOTEINDEX" "$MIRROR/index2" || error "Konnte Liste verfügbarer Releases nicht herunterladen."
. "$REMOTEINDEX" || error "Liste verfügbarer Releases Fehlerhaft (konnte $REMOTEINDEX nicht sourcen)"
# Regenerate pxemenu
@@ -141,6 +143,7 @@ for REL in ${!AVAILABLE_*}; do
print "Remote has branch $BRANCH"
PXELINE=""
KERNEL=""
+ ADDONS=""
for FILE in ${!REL}; do
# Handle pxelinux.cfg
if [[ "$FILE" == kernel* ]]; then
@@ -154,6 +157,7 @@ for REL in ${!AVAILABLE_*}; do
PXELINE+="http://$SLX_LOCAL_ADDR/$FILEPREFIX$FILE"
fi
# If file is available locally, don't download again
+ [ -s "$WWWDIR/$FILEPREFIX$FILE" ] && continue
if [ -s "$WWWTEMP/$FILEPREFIX$FILE" ]; then
mv "$WWWTEMP/$FILEPREFIX$FILE" "$WWWDIR/" && continue
warning "Konnte bestehende Datei $WWWTEMP/$FILEPREFIX$FILE nicht nach $WWWDIR/ verschieben, lade erneut herunter..."
@@ -172,11 +176,19 @@ for REL in ${!AVAILABLE_*}; do
echo " $KERNEL" >> "$PXECONFIG"
echo " $PXELINE" >> "$PXECONFIG"
echo " IPAPPEND 3" >> "$PXECONFIG"
- echo " APPEND slxsrv=$SLX_LOCAL_ADDR slxbase=/" >> "$PXECONFIG"
+ echo " APPEND slxsrv=$SLX_LOCAL_ADDR slxbase=$BRANCH" >> "$PXECONFIG"
# Extra files (e.g. vmplayer in its own sqfs that gets downloaded later)
EXTRA="${BRANCH}_EXTRA"
+ mkdir -p "$WWWDIR/$BRANCH"
for FILE in ${!EXTRA}; do
+ if [[ "$FILE" == *stage32* ]]; then
+ ln -sf "../$FILEPREFIX$FILE" "$WWWDIR/$BRANCH/stage32.sqfs"
+ else
+ ADDONS+=" $FILE"
+ ln -sf "../$FILEPREFIX$FILE" "$WWWDIR/$BRANCH/$FILE.sqfs"
+ fi
# If file is available locally, don't download again
+ [ -s "$WWWDIR/$FILEPREFIX$FILE" ] && continue
if [ -s "$WWWTEMP/$FILEPREFIX$FILE" ]; then
mv "$WWWTEMP/$FILEPREFIX$FILE" "$WWWDIR/" && continue
warning "Konnte bestehende Datei $WWWTEMP/$FILEPREFIX$FILE nicht nach $WWWDIR/ verschieben, lade erneut herunter..."
@@ -184,6 +196,9 @@ for REL in ${!AVAILABLE_*}; do
# Download
download "$FILEPREFIX$FILE" "$MIRROR/$MIRRORDIR/$FILE"
done
+ cp "$CLIENTCONFIG" "$WWWDIR/$BRANCH/config"
+ echo "SLX_ADDONS='$ADDONS'" >> "$WWWDIR/BRANCH/config"
+ ln -sf "$CLIENTCONFIG.tgz" "$WWWDIR/$BRANCH/config.tgz"
done
# If we are here, then we can assume everything went either right, or at least no fatal error happened.
@@ -193,7 +208,7 @@ if [ "$DLFLAG" -ne 0 ]; then
else
print "Keine neuen Abbilder heruntergeladen."
fi
-rm -f "$WWWTEMP/"*
+rm -rf "$WWWTEMP"
exit 0
diff --git a/remote/modules/dnbd3/data/opt/openslx/scripts/systemd-setup_dnbd3 b/remote/modules/dnbd3/data/opt/openslx/scripts/systemd-setup_dnbd3
index 9c76bfa6..f424e3b9 100755
--- a/remote/modules/dnbd3/data/opt/openslx/scripts/systemd-setup_dnbd3
+++ b/remote/modules/dnbd3/data/opt/openslx/scripts/systemd-setup_dnbd3
@@ -1,9 +1,9 @@
#!/bin/sh
-insmod /lib/modules/dnbd3/dnbd3.ko
+insmod /lib/modules/dnbd3/dnbd3.ko || exit 1
[ -e "/dev/dnbd0" ] || exit 1
-for i in 0 1 2 3 4 5 6 7; do
- echo 8192 > "/sys/block/dnbd${i}/queue/nr_requests"
+for i in /dev/dnbd*; do
+ echo 8192 > "/sys/block/dnbd${i#/dev/dnbd}/queue/nr_requests"
done
exec -- dnbd3-client --daemon
diff --git a/remote/modules/dnbd3/dnbd3.conf b/remote/modules/dnbd3/dnbd3.conf
index fdf56b8d..31966cea 100644
--- a/remote/modules/dnbd3/dnbd3.conf
+++ b/remote/modules/dnbd3/dnbd3.conf
@@ -2,7 +2,7 @@
#REQUIRED_CONTENT_PACKAGES="libgconf-2-4 fontconfig-config"
REQUIRED_MODULES="kernel"
REQUIRED_GIT="git://git.openslx.org/dnbd3.git"
-REQUIRED_COMMIT="afa2df64219e6d59d76b11d70c3e98279e12f494"
+REQUIRED_COMMIT="ed82742933b694e8732fe01fc7c1c2542c027c26"
REQUIRED_BINARIES="
dnbd3-client
"
diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
index 01456c0f..2c48218c 100755
--- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
+++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
@@ -34,7 +34,7 @@
################################################################################
# function to write to stdout and logfile
-LOGFILE=/var/log/openslx/run-virt.${USER}.$$.log
+LOGFILE="/var/log/openslx/run-virt.${USER}.$$.log"
writelog () {
# write to stdout
echo -e "$1"
@@ -42,17 +42,32 @@ writelog () {
echo -e "$1" >> ${LOGFILE}
}
-# remove config dirs when exit
+# Clean exit will be called at the end of this script
cleanexit () {
- if echo "${RMDIRS}" 2>/dev/null | grep -q ${xmlvirt}; then
+ sleep 1
+ # remove config dirs when exit
+ if echo "${RMDIRS}" 2>/dev/null | grep -q "${xmlvirt}"; then
writelog "${xmlvirt} exited. Cleanning up... \c"
- rm -rf ${RMDIRS} >/dev/null 2>&1
+ rm -rf -- ${RMDIRS} >/dev/null 2>&1
writelog "done"
fi
+ # Disconnect dnbd3 device
+ if [ -n "$dnbd3" ]; then
+ for timeout in 1 1 2; do
+ dnbd3-client -d "$dnbd3" -c && break
+ writelog "dnbd3 still busy...."
+ sleep "$timeout"
+ done
+ fi
+ # Kill LPD
+ kill "$PID_LPD"
- exit "$1"
+ [ $# -gt 0 ] && exit "$1"
+ exit 129 # No exit code was given :/
}
+trap cleanexit SIGINT SIGTERM
+
# check for important files used
filecheck ()
{
@@ -480,60 +495,44 @@ fi
writelog "Used diskfile: $vm_diskfile"
# Get all virtual machine specific stuff from the respective include file
-if [ -e /opt/openslx/etc/"${xmlvirt}"/run-virt.include ] ; then
- self="${xmlvirt}"
- . /opt/openslx/etc/"${xmlvirt}"/run-virt.include
- # start a windowmanager for easier handling
- # (expect problems /w windows opening in background /w vmware without wm)
- for dm in twm xfwm4 metacity openbox blackbox kwin fvwm2 ; do
- if which $dm >/dev/null 2>&1 ; then
- if [ "$dm" = "fvwm2" ] ; then
- echo "EdgeScroll 0 0" > ${redodir}/fvwm
- fvwm2 -f ${redodir}/fvwm >/dev/null 2>&1 &
- else
- $dm >/dev/null 2>&1 &
- fi
- break
- fi
- done
- # Start poolvideoswitch if we find the autostarter file
- #if [ -e /etc/xdg/autostart/pvsgui.desktop ]; then
- # /usr/local/bin/pvsgui -p 2 -b >/dev/null 2>&1 &
- #fi
- if [[ "$DO_PROFILE" -ge "1" ]]; then
- wget "http://132.230.8.113/profile/do.php?action=start"
- fi
- eval ${VIRTCMD} ${VIRTCMDOPTS}
- writelog "Bye."
-
- # Postrun for commands after virtualization finishes
- if [ -n "${POSTRUN}" ]; then
- eval ${POSTRUN} >/dev/null 2>&1
- fi
-
- # Disconnect dnbd3 device
- if [ -n "$dnbd3" ]; then
- for timeout in 1 1 2; do
- dnbd3-client -c "$dnbd3" && break
- writelog "dnbd3 still busy...."
- sleep "$timeout"
- done
- fi
- # Postrun for commands after virtualization finishes
- if [ -n "${POSTRUN}" ]; then
- eval ${POSTRUN} >/dev/null 2>&1
- fi
-
- # Kill LPD
- kill $PID_LPD
-
- cleanexit 0
-else
+if [ ! -e "/opt/openslx/etc/${xmlvirt}/run-virt.include" ] ; then
writelog "Failed because of missing ${xmlvirt} plugin."
cleanexit 1
fi
+self="${xmlvirt}"
+. "/opt/openslx/etc/${xmlvirt}/run-virt.include" || writelog "Erroneous run-virt.include for $xmlvirt"
+# start a windowmanager for easier handling
+# (expect problems /w windows opening in background /w vmware without wm)
+for dm in twm xfwm4 metacity openbox blackbox kwin fvwm2 ; do
+ if which $dm >/dev/null 2>&1 ; then
+ if [ "$dm" = "fvwm2" ] ; then
+ echo "EdgeScroll 0 0" > ${redodir}/fvwm
+ fvwm2 -f ${redodir}/fvwm >/dev/null 2>&1 &
+ else
+ $dm >/dev/null 2>&1 &
+ fi
+ break
+ fi
+done
+# Start poolvideoswitch if we find the autostarter file
+#if [ -e /etc/xdg/autostart/pvsgui.desktop ]; then
+# /usr/local/bin/pvsgui -p 2 -b >/dev/null 2>&1 &
+#fi
+if [[ "$DO_PROFILE" -ge "1" ]]; then
+ wget "http://132.230.8.113/profile/do.php?action=start"
+fi
+# This will start the VM
+eval ${VIRTCMD} ${VIRTCMDOPTS}
+#
+writelog "Bye."
+
+# Postrun for commands after virtualization finishes
+if [ -n "${POSTRUN}" ]; then
+ eval ${POSTRUN} >/dev/null 2>&1
+fi
cleanexit 0
-exit 0
+
+