]> git.pld-linux.org Git - packages/VirtualBox.git/blobdiff - VirtualBox-vboxsf.init
deps for guest initscripts
[packages/VirtualBox.git] / VirtualBox-vboxsf.init
old mode 100644 (file)
new mode 100755 (executable)
index 07c3c8d..0011bf0
@@ -1,13 +1,9 @@
 #!/bin/sh
 #
 # virtualbox   VirtualBox virtualizer for x86 hardware
-#
-# chkconfig:   345 84 25
-#
-# description: InnoTek VirtualBox is a general-purpose full virtualizer for x86 
+# chkconfig:   345 84 16
+# description: Oracle 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
@@ -27,8 +23,23 @@ start() {
 }
 
 stop() {
-       # NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea
+       # umount vboxsf mounts, no retry, just don't stack them :)
+       local mount errors out rc=0
+       show "Unmounting vboxsf file systems"; busy
+       awk '$3 == "vboxsf" {print $2}' /proc/mounts | while read mount; do
+               if ! umount "$mount"; then
+                       rc=$?
+               fi
+       done
+       if [ $rc = 0 ]; then
+               ok
+       else
+               fail
+       fi
+
+       # NOTE: rmmod will say module in use if there are remaining mounts
        /sbin/rmmod $VBOX_MODULE
+
        rm -f /var/lock/subsys/vboxsf
 }
 
This page took 0.085964 seconds and 4 git commands to generate.