简体   繁体   中英

trigger inotify event over NFS on Linux?

Can I trigger a filesystem event on Linux, without an actual file change? Is there some system call that acts like the file was written? Is that even possible?

I have a NFS share mounted and want to get inotify events in the virtual machine, when a file changes on the server site.

It seems inotify doesn't work with NFS. Is there any network filesystem that supports inotify ?

It's easy to monitor the events on the server site, but how can I trigger the events on the client? At that moment I do a simple touch , but that's not ideal.

(the use case is for local development with docker (boot2docker, OS X.)

Sorry, it's just not a feature.

You could implement some sort of semaphore thing by using incrond to monitor the local filesystem, then do something (touch a file, trigger a script, etc.) on the remote machine to tell it there's been an update, but there's no native functionality in NFS.

Now I'm using Docker for Mac. I still use NFS because of the bad file sharing performence with osxfs. I have written a sublime text 3 plugin, to do the touch automatically, this solves my use case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM