Score:0

Trigger Shell Script when new NFS filesystem is mounted

ru flag

I am looking for a way to trigger a shell script when a new NFS filesystem is mounted. This would be used on Ubuntu 16/20 systems.

The reason behind this is that on occasion, the connection to the NFS server is lost (reboot, network latency) and data is written to the underlying mount. The shell script I have written will modify the underlying mount to prevent this (chmod 400) and force the application to throw an error. I am looking for a way to call this script any time a new NFS mount point is made.

This is going to be deployed across 1000's of systems and I won't know the mount points ahead of time so triggering this script off udev rules is (potentially) out.

pt flag
"The reason behind this is that on occasion, the connection to the NFS server is lost" This shouldn't cause data to be written to the underlying mount; it should cause attempts to access files or directories in this mountpoint to block until the NFS server is available again.
Kris avatar
ru flag
@larsks - One would hope, however this is a real issue that I am facing. Others are as well, seen [here](https://serverfault.com/questions/271665/access-files-located-on-the-underlying-filesystem-of-an-nfs-mountpoint) and [here](https://community.spiceworks.com/topic/1111816-finding-what-data-is-under-an-nfs-mount-point)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.