THe SSHFS filesystem is built on top of the SFTP protocol. SFTP provides only facilities to manipulate files in “classical” ways; the client makes a request to the server (list a directory, upload a file, etc.), and the server responds. There is no facility in this protocol for the server to spontaneously notify the client that something has happened.
This makes it impossible to provide a facility such as inotify inside SSHFS. It would be possible to extend SSHFS with proprietary extensions, or to supplement it with a full-fledged SSH connection; but I don't know of any such extension to SSHFS.
Named pipes can't be implemented on top of SSHFS for the same reason. NFS, the classical networked filesystem, doesn't have any facility to support cross-machines named pipes either. On a networked filesystem, a named pipe creates an independent point of communication on each of the machines where it is mounted (in addition to the server).
FAM (the inotify analogue in SGI IRIX, which has been ported to Linux) provides a daemon which allows notifications to be sent over the network. Linux has rather deprecated FAM since inotify came onto the scene, so I don't know if getting FAM to run would be easier than rolling your own application-specific notification system. You'd need to set up some port forwarding over SSH or establish a VPN in order to secure the network link for FAM and NFS.
If you elect to roll your own, assuming that you're ok with giving the clients shell access, it's fairly easy to run an inotify monitor on behalf of a client: have the client open an SSH connection, and run the inotifywait
command on the server, parsing its output on the client. You can set up a master connection to make it faster to open many connections from the same client to the same server.
inotify
on the local system can detect changes on a remote filesystem. The local kernel is out of the loop in those changes. You need to runinotifywait
on the server, not the client. – Barmar Jul 14 '14 at 16:27