Skip to contentSkip to conversation

NFS and fuser

DISCUSSION Craig Small 3 participants 7 messages May 28, 2006 – May 29, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello,
I am the current maintainer of the psmisc package, which includes a
program called fuser. fuser lets someone work out which process has opened a "file", using a wide meaning for the word file. I currently have a NFS-related bug which I'm hoping the list can help me with.

The problem is if knfsd exports a directory out, it does not show up in its /proc/<pid>/fd/ directory. I am looking for a nice clean way of determining what directories knfsd has exported. It appears for example that /proc/fs/nfs/exports does not appear in all versions of Linux.

Another way would be to read /var/lib/nfs/xtab, but I do not know if this file location is always going to be there.
My main concern is whatever assumptions I make (eg file X is always located at Y) are reasonable ones.

I'm not on the NFS list so if you could CC me directly that would be great.

- Craig

Signature · 13 lines
Craig Small      GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
Eye-Net Consulting http://www.enc.com.au/   MIEE         Debian developer
csmall at : enc.com.au                      ieee.org           debian.org


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
#1 lore raw
Quoted 11 lines · On Monday May 29, [email protected] wrote:

Hello,
I am the current maintainer of the psmisc package, which includes a
program called fuser. fuser lets someone work out which process has opened a "file", using a wide meaning for the word file. I currently have a NFS-related bug which I'm hoping the list can help me with.

The problem is if knfsd exports a directory out, it does not show up in its /proc/<pid>/fd/ directory. I am looking for a nice clean way of determining what directories knfsd has exported. It appears for example that /proc/fs/nfs/exports does not appear in all versions of Linux.

/proc/fs/nfs/exports should appear in all versions of Linux that server nfs. That would be the best thing to use.

Why leads you to believe that it does not appear in all versions of Linux?

NeilBrown

Quoted 6 lines

Another way would be to read /var/lib/nfs/xtab, but I do not know if this file location is always going to be there.
My main concern is whatever assumptions I make (eg file X is always located at Y) are reasonable ones.

Quoted 18 lines

I'm not on the NFS list so if you could CC me directly that would be great.

- Craig

Signature · 13 lines
Craig Small      GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
Eye-Net Consulting http://www.enc.com.au/   MIEE         Debian developer
csmall at : enc.com.au                      ieee.org           debian.org


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#2 lore raw
Quoted 13 lines · Neil Brown
Quoted 11 lines · On Monday May 29, [email protected] wrote:

Hello,
I am the current maintainer of the psmisc package, which includes a
program called fuser. fuser lets someone work out which process has opened a "file", using a wide meaning for the word file. I currently have a NFS-related bug which I'm hoping the list can help me with.

The problem is if knfsd exports a directory out, it does not show up in its /proc/<pid>/fd/ directory. I am looking for a nice clean way of determining what directories knfsd has exported. It appears for example that /proc/fs/nfs/exports does not appear in all versions of Linux.

Quoted 5 lines

/proc/fs/nfs/exports should appear in all versions of Linux that server nfs. That would be the best thing to use.

Why leads you to believe that it does not appear in all versions of Linux?

At least some people don't have that file.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=356655

On the one nfs server I can see (Debian 2.6.8) it has that file. It may be the way to go, if the file is not there all that happens is that you go back to current behaviour, which is fuser doesn't "see" the exports.

- Craig

Signature · 13 lines
Craig Small      GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
Eye-Net Consulting http://www.enc.com.au/   MIEE         Debian developer
csmall at : enc.com.au                      ieee.org           debian.org


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
#3 lore raw
Quoted 10 lines · On Monday May 29, [email protected] wrote:
Quoted 3 lines

Why leads you to believe that it does not appear in all versions of Linux?

At least some people don't have that file.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=356655

On the one nfs server I can see (Debian 2.6.8) it has that file. It may be the way to go, if the file is not there all that happens is that you go back to current behaviour, which is fuser doesn't "see" the exports.

Any Linux system that is exporting files using the in-kernel NFS server and that has /proc mounted will DEFINITELY have
/proc/fs/nfs/exports
If John is not seeing this on his 2.6.11 system then I can only assume that the 'nfsd' module isn't loaded. Maybe he is using the userspace nfs server, or not using NFS at all.

Using the equivalent of "showmount -e" would not be correct as that just report what directories the nfs server is willing to export. On 2.6 kernels the recommend configuration results in the kernel not knowing about exported filesystems unless they are actually being currently used (though with a fairly generous timeout). Presumably 'fuser' should only report files/directories that are actually 'open' inside the kernel. Thus 'showmount -e' is not appropriate.

I stand by my asserting that examining /proc/fs/nfs/exports is the best thing to do.

NeilBrown

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#4 lore raw
Quoted 3 lines · Neil Brown

Presumably 'fuser' should only report files/directories that are actually 'open' inside the kernel. Thus 'showmount -e' is not appropriate.

Yes, that's right. The typical use for it is when you are trying to unmount a drive and it is in use, you want to know what is using it. You don't really care what might use it, or at least if you do it is not fuser's job to tell you.

Quoted 2 lines

I stand by my asserting that examining /proc/fs/nfs/exports is the best thing to do.

That's good enough for me! Thanks for your time.

- Craig

Signature · 13 lines
Craig Small      GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
Eye-Net Consulting http://www.enc.com.au/   MIEE         Debian developer
csmall at : enc.com.au                      ieee.org           debian.org


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
#5 lore raw
In reply to Neil Brown

Hi, ALL
Who can tell me how to cancel the subscribtion of nfs mail list! best regards and thanks

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#6 lore raw
Quoted 3 lines · On Monday May 29, [email protected] wrote:

Hi, ALL
Who can tell me how to cancel the subscribtion of nfs mail list! best regards and thanks

There is a url at the bottom of every mail item which takes you to a web page where you can manage your subscription.

However I have unsubscribed you so you needn't bother.

NeilBrown

Quoted 10 lines

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs