inotify NFS support?
Looking around the net it would appear that inotify may support NFS but in a very limited fashion.
exhibit #1
The reason is explained in this StackOverflow Q&A titled: inotify with NFS.
excerpt from the accepted answer
inotify requires support from the kernel to work. When an application
tracks a directory, it asks the kernel to inform it when those changes
occur. When the change occurs, in addition to writing those changes to
disk, the kernel also notifies the watching process.
On a remote NFS machine, the change is not visible to the kernel; it
happens entirely remotely. NFS predates inotify and there is no
network level support for it in NFS, or anything equivalent.
exhibit #2
Researching a bit more if you look in the inotify FAQ
Q: Can I watch sysfs (procfs, nfs...)?
Simply spoken: yes, but with
some limitations. These limitations vary between kernel versions and
tend to get smaller. Please read information about particular
filesystems.
So is it supported?
I think ultimately what you're experiencing is that NFS does not provide an apples to apples equivalent of all the same features as the locally mounted filesystems.
For example from a nfs linux thread:
- CIFS has notification capabilities built in (oplocks)
- NFS provides "leases" for notification
The point here is that alternate filesystem such as CIFS and NFS offer very basic, if any support directly to inotify.
NFS v4 state
excerpt from IBM article on NFS v4 state
NFS version 4 provides a protocol for the client to establish or
reestablish state, and associates ownership of subsequent server
stateful operations to previously established states. To resolve the
absent client problem, the NFS version 4 client must routinely refresh
the state within the server-specified lease time. Upon lease time-out,
the server may release resources for the client and make them
available to other applications.
- A client obtains the server-specified lease time-out attribute by issuing a getattr operation. getattr is not a stateful operation, thus it does not require prior state to be established. A getattr operation may precede a setclientid or setclientid_confirm operation.
- Refer to the NFS server's leasetime site attribute for setting and tuning lease time periods.
*