packages: VirtualBox-bin/VirtualBox-vboxnetadp.init (NEW) - new (for kernel...

charles charles at pld-linux.org
Tue Jul 28 01:10:31 CEST 2009


Author: charles                      Date: Mon Jul 27 23:10:31 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- new (for kernel-misc-vboxnetadp)

---- Files affected:
packages/VirtualBox-bin:
   VirtualBox-vboxnetadp.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/VirtualBox-bin/VirtualBox-vboxnetadp.init
diff -u /dev/null packages/VirtualBox-bin/VirtualBox-vboxnetadp.init:1.1
--- /dev/null	Tue Jul 28 01:10:31 2009
+++ packages/VirtualBox-bin/VirtualBox-vboxnetadp.init	Tue Jul 28 01:10:25 2009
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# vboxnetadp	Virtual Network Adapter Driver
+#
+# chkconfig:	345 86 23
+#
+# description:	InnoTek VirtualBox is a general-purpose full virtualizer for x86 
+#		hardware. Targeted at server, desktop and embedded use.
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+VBOX_MODULE="vboxnetadp"
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
+
+start() {
+	if [ ! -f /var/lock/subsys/vboxnetadp ]; then
+		modprobe -s $VBOX_MODULE
+		# set proper /dev/vboxdrv for systems with static dev
+		touch /var/lock/subsys/vboxnetadp
+	fi
+}
+
+stop() {
+	# NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea
+	/sbin/rmmod $VBOX_MODULE
+	rm -f /var/lock/subsys/vboxnetadp
+}
+
+condrestart() {
+	if [ -f /var/lock/subsys/vboxnetadp ]; then
+		stop
+		start
+	else
+		RETVAL=$1
+	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  force-reload)
+	condrestart 7
+	;;
+  status)
+	if ! is_module $VBOX_MODULE; then
+		echo "$VBOX_MODULE module is loaded"
+	else
+		echo "$VBOX_MODULE module is not loaded"
+		RETVAL=3
+	fi
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL
================================================================


More information about the pld-cvs-commit mailing list