]> git.pld-linux.org Git - packages/VirtualBox.git/commitdiff
vboxsf: stop mounts before removing modules auto/th/VirtualBox-4.2.10-1
authorElan Ruusamäe <glen@delfi.ee>
Sat, 23 Mar 2013 14:13:08 +0000 (16:13 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Sat, 23 Mar 2013 14:13:08 +0000 (16:13 +0200)
VirtualBox-vboxsf.init

index 494ee2363f87be7620eb2bca8506bd797f80968c..0011bf0ec2ea73580d1befebd510baf9878cf950 100755 (executable)
@@ -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
 }
 
This page took 0.060014 seconds and 4 git commands to generate.