Determine whether a NFS mount is actually reachable
Determine whether a NFS mount is actually reachable
- Subject: Determine whether a NFS mount is actually reachable
- From: Thomas Tempelmann <email@hidden>
- Date: Sat, 21 Feb 2015 23:01:06 +0100
(I realize this isn't really the best place to ask this question as it's rather a user-level API question, not a filesys designer's question, but I give it a try anyway because I didn't have luck finding answers elsewhere so far.)
My question is: How can a user level app determine whether an automounted NFS share is currently accessible or not?
E.g, if using the /etc/auto_master etc. files, to mount NFS file shares from another computer under a private directory such as /mymounts/, how can I tell if the mounts there, such as /mymounts/server1/ are currently accessible? I know that the automount-daemon maintains a state about it because it prints messages into the console when the mount becomes available or vanishes, and often, when trying to access the mount's dir, it would simply return an empty dir and/or some error state. Yet, sometimes, when I blindly attempt to read the mount's dir, this causes an attempt to reach the (off-line) networked computer, leading to a timeout after many seconds - and that's what I like to avoid as it'll stall my app and cause all sorts of usability trouble.
Using lstat or looking at the flags from FSGetVolumeParms doesn't show me any indication about this state.
How is that done, does anyone know?
I also asked the question on SO, if anyone likes to read or comment there:
Thomas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden