commit 96d53cf60fce6b45fd32988bab70b059428fe99c
Author: Elan Ruusamäe <[email protected]>
Date:   Sat Mar 23 16:13:08 2013 +0200

    vboxsf: stop mounts before removing modules

 VirtualBox-vboxsf.init | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/VirtualBox-vboxsf.init b/VirtualBox-vboxsf.init
index 494ee23..0011bf0 100755
--- a/VirtualBox-vboxsf.init
+++ b/VirtualBox-vboxsf.init
@@ -23,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
 }
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/VirtualBox.git/commitdiff/96d53cf60fce6b45fd32988bab70b059428fe99c

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to