On 2013-03-29, Harald Becker <ra...@gmx.de> wrote:
> Hi,
>
> as here are several experts, and not so much traffic at the moment, I
> throw in an off-topic question (which may still be of interest for
> other system managers):
>
> 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.

How are you going to prevent a race condition?

  1) you check to see if the filesystem is in use and find that it isn't.

  2) another process opens/creates a file in the filesystem.

  3) you do your cleanup.

  4) you do a umount and it fails.

-- 
Grant Edwards               grant.b.edwards        Yow! Why is it that when
                                  at               you DIE, you can't take
                              gmail.com            your HOME ENTERTAINMENT
                                                   CENTER with you??

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to