Search code examples
lockingposixshnfs

What is the best way to lock a file through NFS


I'm looking for a way to lock a file through NFS on a Unix operating system. The state of the art does not seem very enjoyable. I tried flock, which does not work properly.

What is the best and most POSIX (or at least Unix) option now ?


Solution

  • lockfile seems to be the best (or less bad) solution. cf man lockfile :

    MISCELLANEOUS
       Lockfile is NFS-resistant and eight-bit clean.