summaryrefslogtreecommitdiffstats
path: root/resources/config/1/uniontmp/etc/rc3.d
diff options
context:
space:
mode:
authormichael pereira2011-03-10 15:47:10 +0100
committermichael pereira2011-03-10 15:47:10 +0100
commit501f65203cb5e98f6f6c8afcd8e64e3d3a82e672 (patch)
treeef7f37935ae06e335f77e8e492b9446964b0c141 /resources/config/1/uniontmp/etc/rc3.d
parentdefault kcl und config hinzugefuegt (diff)
downloadpbs2-501f65203cb5e98f6f6c8afcd8e64e3d3a82e672.tar.gz
pbs2-501f65203cb5e98f6f6c8afcd8e64e3d3a82e672.tar.xz
pbs2-501f65203cb5e98f6f6c8afcd8e64e3d3a82e672.zip
Resource Controller
Diffstat (limited to 'resources/config/1/uniontmp/etc/rc3.d')
-rwxr-xr-xresources/config/1/uniontmp/etc/rc3.d/K02vbox-slx89
-rwxr-xr-xresources/config/1/uniontmp/etc/rc3.d/K02vmware-env125
-rwxr-xr-xresources/config/1/uniontmp/etc/rc3.d/S20vbox-slx89
-rwxr-xr-xresources/config/1/uniontmp/etc/rc3.d/S20vmware-env125
4 files changed, 428 insertions, 0 deletions
diff --git a/resources/config/1/uniontmp/etc/rc3.d/K02vbox-slx b/resources/config/1/uniontmp/etc/rc3.d/K02vbox-slx
new file mode 100755
index 0000000..093a79c
--- /dev/null
+++ b/resources/config/1/uniontmp/etc/rc3.d/K02vbox-slx
@@ -0,0 +1,89 @@
+#!/bin/sh
+# 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/
+# -----------------------------------------------------------------------------
+# §filename§
+# - §desc§
+# §generated§
+# -----------------------------------------------------------------------------
+
+### BEGIN INIT INFO
+# Provides: vbox-slx
+# Required-Start: $remote_fs
+# Required-Stop: $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: Setup environment for virtualbox. Part of OpenSLX virtualbox plugin.
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+#functions: helper functions
+running () {
+lsmod | grep -q "$1[^_-]"
+}
+
+vmstatus () {
+if running vboxdrv; then
+ if running vboxnetflt; then
+ echo "VirtualBox kernel modules (vboxdrv and vboxnetflt) are loaded."
+ else
+ echo "VirtualBox kernel module is loaded."
+ fi
+ #TODO: check it: ignore user check. handling our own way:
+ for i in /tmp/.vbox-*-ipc; do
+ echo "Running: "
+ $(VBoxManage -q list runningvms | sed -e 's/^".*"//' 2>/dev/null)
+ done
+ else
+ echo "VirtualBox kernel module(s) are not loaded."
+fi
+
+}
+
+start () {
+ echo "SUBSYSTEM==\"usb_device\", GROUP=\"vboxusers\", MODE=\"0666\"" \
+ >/etc/udev/rules.d/90-vboxusb.rules
+ echo "SUBSYSTEM==\"usb\", ENV{DEVTYPE}==\"usb_device\",\
+ GROUP=\"vboxusers\", MODE=\"0666\"" >>/etc/udev/rules.d/90-vboxusb.rules
+ modprobe -qa vboxdrv vboxnetflt vboxnetadp
+}
+
+stop () {
+ rmmod vboxnetadp vboxnetflt vboxdrv
+}
+
+
+case "$1" in
+ start)
+ #start: defines start function for initscript
+ start
+ ;;
+ stop)
+ #stop: defines stop function for initscript
+ stop
+ ;;
+ restart)
+ #restart: defines restart function for initscript
+ stop && start
+ ;;
+ status)
+ #status: defines status function for initscript
+ vmstatus
+ ;;
+ *)
+ #usage: defines usage function for initscript
+ ## print out usage
+ echo "Usage: $0 {start, stop, restart, status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/resources/config/1/uniontmp/etc/rc3.d/K02vmware-env b/resources/config/1/uniontmp/etc/rc3.d/K02vmware-env
new file mode 100755
index 0000000..ddc4f5c
--- /dev/null
+++ b/resources/config/1/uniontmp/etc/rc3.d/K02vmware-env
@@ -0,0 +1,125 @@
+#!/bin/sh
+# 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/
+# -----------------------------------------------------------------------------
+# §filename§
+# - §desc§
+# §generated§
+# -----------------------------------------------------------------------------
+
+### BEGIN INIT INFO
+# Provides: vmware-slx
+# Required-Start: $remote_fs
+# Required-Stop: $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: Setup environment for VMware Workstation or Player (local3X).
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+#functions: helper functions
+load_modules () {
+# VMplayer common stuff
+insmod /lib/modules/$(uname -r)/misc/vmmon.ko || return 1
+insmod /lib/modules/$(uname -r)/misc/vmnet.ko || return 1
+# VMplayer 3.X specific stuff
+insmod /lib/modules/$(uname -r)/misc/vmci.ko
+insmod /lib/modules/$(uname -r)/misc/vmblock.ko
+insmod /lib/modules/$(uname -r)/misc/vsock.ko
+
+}
+
+unload_modules () {
+rmmod vmnet vmmonvsock vmci vmblock 2>/dev/null
+}
+
+vmnetif () {
+# let point the path directly to the directory where the binary lives
+location="/usr/bin"
+if [ -n "$vmnet0" ] ; then
+ # the path might be directly point to the plugin dir
+ $location/vmnet-bridge -d /var/run/vmnet-bridge-0.pid -n 0
+fi
+if [ -n "$vmnet1" ] ; then
+ $location/vmnet-netifup -d /var/run/vmnet-netifup-vmnet1.pid \
+ /dev/vmnet1 vmnet1
+ ip addr add $vmnet1 dev vmnet1
+ ip link set vmnet1 up
+ if [ -n "$vmnet1nat" ] ; then
+ echo "1" >/proc/sys/net/ipv4/conf/vmnet1/forwarding 2>/dev/null
+ echo "1" >/proc/sys/net/ipv4/conf/br0/forwarding 2>/dev/null
+ #iptables -A -s vmnet1 -d br0
+ fi
+ /opt/openslx/uclib-rootfs/usr/sbin/udhcpd \
+ -S /etc/vmware/udhcpd/udhcpd-vmnet1.conf
+fi
+if [ -n "$vmnet8" ] ; then
+ $location/vmnet-netifup -d /var/run/vmnet-netifup-vmnet8.pid \
+ /dev/vmnet8 vmnet8
+ ip addr add $vmnet8 dev vmnet8
+ ip link set vmnet8 up
+ echo "1" >/proc/sys/net/ipv4/conf/vmnet8/forwarding 2>/dev/null
+ echo "1" >/proc/sys/net/ipv4/conf/br0/forwarding 2>/dev/null
+ iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE
+ /opt/openslx/uclib-rootfs/usr/sbin/udhcpd \
+ -S /etc/vmware/udhcpd/udhcpd-vmnet8.conf
+fi
+
+}
+
+vmblock () {
+# let point the path directly to the directory where the binary lives
+ /usr/bin/vmware-usbarbitrator
+
+}
+
+
+case "$1" in
+ start)
+ #start: defines start function for initscript
+ # include default directories
+ . /etc/opt/openslx/openslx.conf
+ # load the configuration file
+ . ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmware/vmware.conf
+ # hack to access the first serial/parallel port
+ chmod a+rw /dev/ttyS0
+ chmod a+rw /dev/parport0
+ load_modules
+ vmnetif
+ vmblock
+
+ ;;
+ stop)
+ #stop: defines stop function for initscript
+ killall vmnet-netifup vmnet-natd vmnet-bridge vmware vmplayer \
+ vmware-tray vmnet-dhcpd 2>/dev/null
+ # might take a while until all services are shut down
+ sleep 1
+ unload_modules
+
+ ;;
+ restart)
+ #restart: defines restart function for initscript
+ $0 stop && $0 start
+ ;;
+ status)
+ #status: defines status function for initscript
+ vmstatus
+ ;;
+ *)
+ #usage: defines usage function for initscript
+ ## print out usage
+ echo "Usage: $0 {start, stop, restart, status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/resources/config/1/uniontmp/etc/rc3.d/S20vbox-slx b/resources/config/1/uniontmp/etc/rc3.d/S20vbox-slx
new file mode 100755
index 0000000..093a79c
--- /dev/null
+++ b/resources/config/1/uniontmp/etc/rc3.d/S20vbox-slx
@@ -0,0 +1,89 @@
+#!/bin/sh
+# 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/
+# -----------------------------------------------------------------------------
+# §filename§
+# - §desc§
+# §generated§
+# -----------------------------------------------------------------------------
+
+### BEGIN INIT INFO
+# Provides: vbox-slx
+# Required-Start: $remote_fs
+# Required-Stop: $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: Setup environment for virtualbox. Part of OpenSLX virtualbox plugin.
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+#functions: helper functions
+running () {
+lsmod | grep -q "$1[^_-]"
+}
+
+vmstatus () {
+if running vboxdrv; then
+ if running vboxnetflt; then
+ echo "VirtualBox kernel modules (vboxdrv and vboxnetflt) are loaded."
+ else
+ echo "VirtualBox kernel module is loaded."
+ fi
+ #TODO: check it: ignore user check. handling our own way:
+ for i in /tmp/.vbox-*-ipc; do
+ echo "Running: "
+ $(VBoxManage -q list runningvms | sed -e 's/^".*"//' 2>/dev/null)
+ done
+ else
+ echo "VirtualBox kernel module(s) are not loaded."
+fi
+
+}
+
+start () {
+ echo "SUBSYSTEM==\"usb_device\", GROUP=\"vboxusers\", MODE=\"0666\"" \
+ >/etc/udev/rules.d/90-vboxusb.rules
+ echo "SUBSYSTEM==\"usb\", ENV{DEVTYPE}==\"usb_device\",\
+ GROUP=\"vboxusers\", MODE=\"0666\"" >>/etc/udev/rules.d/90-vboxusb.rules
+ modprobe -qa vboxdrv vboxnetflt vboxnetadp
+}
+
+stop () {
+ rmmod vboxnetadp vboxnetflt vboxdrv
+}
+
+
+case "$1" in
+ start)
+ #start: defines start function for initscript
+ start
+ ;;
+ stop)
+ #stop: defines stop function for initscript
+ stop
+ ;;
+ restart)
+ #restart: defines restart function for initscript
+ stop && start
+ ;;
+ status)
+ #status: defines status function for initscript
+ vmstatus
+ ;;
+ *)
+ #usage: defines usage function for initscript
+ ## print out usage
+ echo "Usage: $0 {start, stop, restart, status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/resources/config/1/uniontmp/etc/rc3.d/S20vmware-env b/resources/config/1/uniontmp/etc/rc3.d/S20vmware-env
new file mode 100755
index 0000000..ddc4f5c
--- /dev/null
+++ b/resources/config/1/uniontmp/etc/rc3.d/S20vmware-env
@@ -0,0 +1,125 @@
+#!/bin/sh
+# 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/
+# -----------------------------------------------------------------------------
+# §filename§
+# - §desc§
+# §generated§
+# -----------------------------------------------------------------------------
+
+### BEGIN INIT INFO
+# Provides: vmware-slx
+# Required-Start: $remote_fs
+# Required-Stop: $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: Setup environment for VMware Workstation or Player (local3X).
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+#functions: helper functions
+load_modules () {
+# VMplayer common stuff
+insmod /lib/modules/$(uname -r)/misc/vmmon.ko || return 1
+insmod /lib/modules/$(uname -r)/misc/vmnet.ko || return 1
+# VMplayer 3.X specific stuff
+insmod /lib/modules/$(uname -r)/misc/vmci.ko
+insmod /lib/modules/$(uname -r)/misc/vmblock.ko
+insmod /lib/modules/$(uname -r)/misc/vsock.ko
+
+}
+
+unload_modules () {
+rmmod vmnet vmmonvsock vmci vmblock 2>/dev/null
+}
+
+vmnetif () {
+# let point the path directly to the directory where the binary lives
+location="/usr/bin"
+if [ -n "$vmnet0" ] ; then
+ # the path might be directly point to the plugin dir
+ $location/vmnet-bridge -d /var/run/vmnet-bridge-0.pid -n 0
+fi
+if [ -n "$vmnet1" ] ; then
+ $location/vmnet-netifup -d /var/run/vmnet-netifup-vmnet1.pid \
+ /dev/vmnet1 vmnet1
+ ip addr add $vmnet1 dev vmnet1
+ ip link set vmnet1 up
+ if [ -n "$vmnet1nat" ] ; then
+ echo "1" >/proc/sys/net/ipv4/conf/vmnet1/forwarding 2>/dev/null
+ echo "1" >/proc/sys/net/ipv4/conf/br0/forwarding 2>/dev/null
+ #iptables -A -s vmnet1 -d br0
+ fi
+ /opt/openslx/uclib-rootfs/usr/sbin/udhcpd \
+ -S /etc/vmware/udhcpd/udhcpd-vmnet1.conf
+fi
+if [ -n "$vmnet8" ] ; then
+ $location/vmnet-netifup -d /var/run/vmnet-netifup-vmnet8.pid \
+ /dev/vmnet8 vmnet8
+ ip addr add $vmnet8 dev vmnet8
+ ip link set vmnet8 up
+ echo "1" >/proc/sys/net/ipv4/conf/vmnet8/forwarding 2>/dev/null
+ echo "1" >/proc/sys/net/ipv4/conf/br0/forwarding 2>/dev/null
+ iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE
+ /opt/openslx/uclib-rootfs/usr/sbin/udhcpd \
+ -S /etc/vmware/udhcpd/udhcpd-vmnet8.conf
+fi
+
+}
+
+vmblock () {
+# let point the path directly to the directory where the binary lives
+ /usr/bin/vmware-usbarbitrator
+
+}
+
+
+case "$1" in
+ start)
+ #start: defines start function for initscript
+ # include default directories
+ . /etc/opt/openslx/openslx.conf
+ # load the configuration file
+ . ${OPENSLX_DEFAULT_CONFDIR}/plugins/vmware/vmware.conf
+ # hack to access the first serial/parallel port
+ chmod a+rw /dev/ttyS0
+ chmod a+rw /dev/parport0
+ load_modules
+ vmnetif
+ vmblock
+
+ ;;
+ stop)
+ #stop: defines stop function for initscript
+ killall vmnet-netifup vmnet-natd vmnet-bridge vmware vmplayer \
+ vmware-tray vmnet-dhcpd 2>/dev/null
+ # might take a while until all services are shut down
+ sleep 1
+ unload_modules
+
+ ;;
+ restart)
+ #restart: defines restart function for initscript
+ $0 stop && $0 start
+ ;;
+ status)
+ #status: defines status function for initscript
+ vmstatus
+ ;;
+ *)
+ #usage: defines usage function for initscript
+ ## print out usage
+ echo "Usage: $0 {start, stop, restart, status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0