Detecting NFS Clients Redux

I never have been fully satisfied with detecting connected NFS clients. I accept that NFS servers are presumed to seldom be down and expected to be online 24/7. That’s fine for the enterprise but not for home users.

Every blue moon or so my original detection method fails. The computer running the NFS server would be allowed to reboot or halt despite active client connections.

NFS is painful with respect to losing the server connection.

To monitor NFS clients the common copypasta click-bait all over the web is to use netstat and showmount. There is one obvious problem. Both methods are unreliable. The showmount man page is clear about that point.

The lsof command is good only for internal files and does not show remote connections. Running lsof -N will show NFS related connections, but that information is local.

I modified my safe-shutdown script to use SSH to check remote systems with lsof -N. That seems to help.

On all client systems I added a cron job to execute every 5 minutes to run the df and mount commands. That helps continually refresh the connection status at both the client and server.

I hope this problem is finally resolved.

Posted: Category: Usability Tagged: General

Next: Windows 11

Previous: Windows 10 P2V