Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I have started a PHP script via browser and due to a loop error the script continues to be executed even after closing the browser. I am noticing it since the script is logging error messages to my logfile (path known).

We have a Apache server where many developers work together and the user is nmdev. So how can I find out what process it the one running and logging to my logfile?

ps -afe | grep php53 gives me many processes of today like:

nmdev 26518 24151 0 11:51 ? 00:00:00 /opt/xxx/yyy/apache-php5/bin/httpd -k start

share|improve this question

marked as duplicate by Iain, Ward, mdpc, dawud, Tom O'Connor Aug 27 '13 at 20:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

The tool lsof with the complete path of your file will give you a list of all processes which are accessing to it.


me@home ~ % lsof /home/me                                    
i3bar      1894 me  cwd    DIR    8,3    32768 4718593 /home/me
j4status   1895 me  cwd    DIR    8,3    32768 4718593 /home/me
germinal   1899 me  cwd    DIR    8,3    32768 4718593 /home/me
share|improve this answer
Yes I know lsof but it is not available -bash: lsof: command not found and I am not root. – Shlomo Goldstein Aug 27 '13 at 11:01
Perhaps you should install it in this case... – etagenklo Aug 27 '13 at 11:32
Ok, just saw you're NOT root. You'll have to be root (or at least be allowed to use sudo) in order to use lsof... – etagenklo Aug 27 '13 at 11:33
up vote 0 down vote accepted

The solution for my problem was to use:

/sbin/fuser /path/to/logfile

That gave me all the processes writing to the file. I killed them all without mercy. Problem solved.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.