> In a shell script I like to check if a mounted filesystem is still in > use by any other process in the system. If there is no more process > using the filesystem some cleanup actions has to be done and > afterwards the filesystem is unmounted. As the filesystem is only a > temporary filesystem it's contents is lost after the unmount, so the > cleanup action has to be done before the umount.
Sounds strange that you need to perform some cleanup on contents that will disappear after the unmount anyway ^^ A solution that works for me on 2.6.32: * mount --bind your original directory to somewhere else * umount your original directory * if it didn't work, your original directory is still in use, umount the copy * but if it worked, your original directory wasn't in use anymore, perform the cleanup on the copy then umount the copy. If bind mount semantics have changed since 2.6.32, then I have no better idea than fuser -m. -- Laurent _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
