We have a unique problem where we have a FD leak... we don't know where
it's coming from, and we are having a hell of time tracking it down...
so I have a few questions:
1) Is it possible to list the current amount of USED file descriptors in
a system? and how?
2) Is it possible to list how many FD's are in use by each process? and
how?
3) Is it possible to list what FD's are being used for (ie, what files
are open, etc...) and how?
`man fuser'
The /proc filesystem has a directory for each process - and within that
there is a directory fd - containing all the fd's and possibly where they
are allocated.
eg. for init (process 1) :
[root:1] caffeine:~# ls -l /proc/1/fd/
total 0
lrwx------ 1 root root 64 Dec 2 21:29 10 -> /dev/initctl|
and for say the current shell:
[root:1] caffeine:~# ls -l /proc/$$/fd/
total 0
lrwx------ 1 root root 64 Dec 2 21:30 0 -> /dev/tty1
lrwx------ 1 root root 64 Dec 2 21:30 1 -> /dev/tty1
lrwx------ 1 root root 64 Dec 2 21:30 2 -> /dev/tty1
lrwx------ 1 root root 64 Dec 2 21:30 255 -> /dev/tty1
The current version of fuser doesn't work with the new VFS. I've sent a
patch to Werner to fix this (Werner, if your reading this can you please ACK
you received it? - it was some time back now...). If you want me to mail you
this let me know.
-Chris