Search code examples
linuxubuntuprocessgraylog2

How to kill/stop a process that continuously refreshes its PID?


I recently installed Graylog2 onto my Ubuntu server for log monitoring. I soon after get an alert stating that my CPUs are reaching capacity. I then log into my server over SSH and run top. What I see confuses me and makes it difficult to kill the process.

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                   
 2462 graylog2  20   0 2103292  42684  16424 S  19.3  1.1   0:00.58 java                                                      
 2470 graylog+  20   0 2295612  46368  16032 S  13.0  1.1   0:00.39 java                                                      
 1971 www-data  20   0  354808  36140  19392 S  10.0  0.9   0:00.61 php5

Everytime top refreshes, I see that the PIDs of graylog have increased so I'm unable to kill it by PID.

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                   
16937 www-data  20   0  357988  52140  34244 S  45.3  1.3   0:07.45 php5-fpm                                                  
24588 graylog2  20   0 2079236  35464  15576 S   9.7  0.9   0:00.29 java                                                      
24547 graylog+  20   0 2295612  37148  15640 S   8.0  0.9   0:00.24 java

What is the proper way to kill/stop a process that continuously re-instantiates itself like that?


Solution

  • I don't now graylog. But perhaps 'killall' can help you. It handles processes by name.

    http://linux.die.net/man/1/killall

    Please read the man pages before use it. i don't use it often. so i don't know the disadvantages. (if there are any)