Re: list processes which are currently holding a handle to a specified file

2005-02-25 Thread Lior Kesos
anacdote: fuser -k is the command line equivelent of I'm feeling lucky by google. Lior. On Wed, 23 Feb 2005 15:34:42 +0200, Amir Binyamini [EMAIL PROTECTED] wrote: Hello, First,I rememered that there was some util which can return pid of processes holding handles to open files, but I was not

list processes which are currently holding a handle to a specified file

2005-02-23 Thread Amir Binyamini
Hello, You can get the inode number of of a file quite easliy (for example by ls -i filenam). You can also get information about files opened by a process quite easliy (for example by lsof -p pid). I assume that there are other ways , probably reading some file under /proc/pid. How can you

Re: list processes which are currently holding a handle to a specified file

2005-02-23 Thread Muli Ben-Yehuda
On Wed, Feb 23, 2005 at 09:52:21AM +0200, Amir Binyamini wrote: How can you know list processes which are currently holding a handle of a some specifiesd file (which you know its full path and name and/or inode number)? Doesn't lsof also do this? I routinly use 'lsof | grep whatever'.

Re: list processes which are currently holding a handle to a specified file

2005-02-23 Thread Amir Binyamini
Hello, 'lsof | grep filename' does the job. However, it seems to me a little heavy. For a heavy server (2 processors , AMD64 bits )which run many many threads concurrently , accessing and updating many many little files concurrently (like an IVR system I am dealing with) running lsof as I

Re: list processes which are currently holding a handle to a specified file

2005-02-23 Thread Muli Ben-Yehuda
On Wed, Feb 23, 2005 at 11:51:55AM +0200, Amir Binyamini wrote: For a heavy server (2 processors , AMD64 bits )which run many many threads concurrently , accessing and updating many many little files concurrently (like an IVR system I am dealing with) running lsof as I understand means

Re: list processes which are currently holding a handle to a specified file

2005-02-23 Thread Amir Binyamini
Hello, You said: Scanning their /proc/$PID directories and the files within.. May I ask how did you perform that scan? The /proc contains files in a special format so I could be wrong in what I did: I have a simple test process which opens a file (log.txt ) and does not close it ; this process

Re: list processes which are currently holding a handle to a specified file

2005-02-23 Thread Amir Binyamini
Hello, First,I rememered that there was some util which can return pid of processes holding handles to open files, but I was not sure and did not remember it's name. Now somebody told me it is fuser filename. Second : Mulix, please forget my question ; I should have done (from /proc/pid) : grep

Re: list processes which are currently holding a handle to a specified file

2005-02-23 Thread Muli Ben-Yehuda
On Wed, Feb 23, 2005 at 02:19:11PM +0200, Amir Binyamini wrote: May I ask how did you perform that scan? I didn't; lsof did. I supplied the strace output, which shows us that strace is doing a readlink on /proc/$PID/fd/$NUM. For example: [EMAIL PROTECTED]:~$ cat /tmp/foo [1] 28975 [EMAIL

Re: list processes which are currently holding a handle to a specified file

2005-02-23 Thread Tzafrir Cohen
On Wed, Feb 23, 2005 at 03:34:42PM +0200, Amir Binyamini wrote: Hello, First,I rememered that there was some util which can return pid of processes holding handles to open files, but I was not sure and did not remember it's name. Now somebody told me it is fuser filename. fuser, lsof,