0

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.

Kris
  • 1
  • 1
  • "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. – larsks Jan 23 '23 at 21:39
  • @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) – Kris Jan 23 '23 at 23:11

0 Answers0