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.