0

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

Shlomo
  • 103
  • 4

2 Answers2

1

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

Example:

me@home ~ % lsof /home/me                                    
COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
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
Kdecherf
  • 466
  • 3
  • 9
0

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.

Shlomo
  • 103
  • 4