Hi,

I have got a solution for removing zombie process on servers(linux servers). We neither
need to restart the server nor run script to do this all we have to do is
just run the following command.

ps -el | grep 'Z'

The output of the above command will be something like this

F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
4 Z     0   668  4243  0  78   0 -     0 exit   ?        00:09:39 VV
4 Z     0  1403  4243  0  78   0 -     0 exit   ?        00:08:11 VV
4 Z     0  1613  4243  0  78   0 -     0 exit   ?        00:09:43 VV
4 Z     0  2202  4243  0  78   0 -     0 exit   ?        00:09:25 VV
4 Z     0  2382  4243  0  82   0 -     0 exit   ?        00:08:07 VV
4 Z     0  2618  4243  0  78   0 -     0 exit   ?        00:09:52 VV
4 Z     0  2714  4243  0  77   0 -     0 exit   ?        00:09:51 VV
4 Z     0  2741  4243  0  78   0 -     0 exit   ?        00:09:18 VV
4 Z     0  2956  4243  0  76   0 -     0 exit   ?        00:07:41 VV
4 Z     0  3030  4243  0  75   0 -     0 exit   ?        00:00:06 VV
4 Z     0  3125  4243  0  83   0 -     0 exit   ?        00:08:09 VV
4 Z     0  3260  4243  0  83   0 -     0 exit   ?        00:09:02 VV
4 Z     0  3480  4243  0  77   0 -     0 exit   ?        00:09:37 VV
4 Z     0  4151  4243  0  76   0 -     0 exit   ?        00:08:49 VV
4 Z     0  4899  4243  0  76   0 -     0 exit   ?        00:00:04 VV
4 Z     0  5099  4243  0  81   0 -     0 exit   ?        00:09:32 VV
4 Z     0  5667  4243  0  76   0 -     0 exit   ?        00:07:58 VV
4 Z     0  5778  4243  0  78   0 -     0 exit   ?        00:09:40 VV
4 Z     0  5956  4243  0  82   0 -     0 exit   ?        00:10:19 VV
4 Z     0  7035  4243  0  80   0 -     0 exit   ?        00:10:04 VV
4 Z     0  7448  4243  0  83   0 -     0 exit   ?        00:08:23 VV
4 Z     0  7757  4243  0  83   0 -     0 exit   ?        00:10:06 VV
4 Z     0  8219  4243  0  82   0 -     0 exit   ?        00:10:11 VV
4 Z     0  8262  4243  0  76   0 -     0 exit   ?        00:07:55 VV
4 Z     0  8631  4243  0  76   0 -     0 exit   ?        00:05:57 VV
4 Z     0  8728  4243  0  76   0 -     0 exit   ?        00:00:04 VV
4 Z     0  8944  4243  0  76   0 -     0 exit   ?        00:00:04 VV
4 Z     0  9431  4243  0  80   0 -     0 exit   ?        00:09:57 VV
4 Z     0  9577  4243  0  83   0 -     0 exit   ?        00:09:00 VV
4 Z     0  9762  4243  0  76   0 -     0 exit   ?        00:00:04 VV
4 Z     0 10263  4243  0  76   0 -     0 exit   ?        00:07:57 VV
4 Z     0 10960  4243  0  83   0 -     0 exit   ?        00:08:13 VV
4 Z     0 11526  4243  0  78   0 -     0 exit   ?        00:10:08 VV
4 Z     0 11952  4243  0  78   0 -     0 exit   ?        00:08:05 VV
4 Z     0 13339  4243  0  78   0 -     0 exit   ?        00:08:12 VV
4 Z     0 14776  4243  0  76   0 -     0 exit   ?        00:00:04 VV
4 Z     0 15016  4243  0  83   0 -     0 exit   ?        00:08:09 VV
4 Z     0 15163  4243  0  76   0 -     0 exit   ?        00:07:44 VV
4 Z     0 16673  4243  0  76   0 -     0 exit   ?        00:00:04 VV
4 Z     0 17057  4243  0  79   0 -     0 exit   ?        00:09:33 VV
4 Z     0 17095  4243  0  75   0 -     0 exit   ?        00:00:04 VV
4 Z     0 17155  4243  0  81   0 -     0 exit   ?        00:09:44 VV
4 Z     0 17760  4243  0  81   0 -     0 exit   ?        00:09:42 VV
4 Z     0 18088  4243  0  83   0 -     0 exit   ?        00:10:00 VV
4 Z     0 18274  4243  0  76   0 -     0 exit   ?        00:07:45 VV
4 Z     0 18744  4243  0  83   0 -     0 exit   ?        00:09:18 VV
4 Z     0 19227  4243  0  82   0 -     0 exit   ?        00:10:10 VV
4 Z     0 19288  4243  0  79   0 -     0 exit   ?        00:09:23 VV
4 Z     0 19316  4243  0  78   0 -     0 exit   ?        00:09:51 VV
4 Z     0 19654  4243  0  78   0 -     0 exit   ?        00:09:32 VV
4 Z     0 19695  4243  0  77   0 -     0 exit   ?        00:09:51 VV
4 Z     0 20190  4243  0  78   0 -     0 exit   ?        00:08:55 VV
4 Z     0 20602  4243  0  76   0 -     0 exit   ?        00:07:56 VV
4 Z     0 21455  4243  0  76   0 -     0 exit   ?        00:07:54 VV
4 Z     0 21687  4243  0  83   0 -     0 exit   ?        00:09:16 VV
4 Z     0 22785  4243  0  84   0 -     0 exit   ?        00:08:08 VV
4 Z     0 22855  4243  0  78   0 -     0 exit   ?        00:09:39 VV
4 Z     0 23330  4243  0  78   0 -     0 exit   ?        00:09:37 VV
4 Z     0 23405  4243  0  82   0 -     0 exit   ?        00:10:24 VV
4 Z     0 23600  4243  0  83   0 -     0 exit   ?        00:08:45 VV
4 Z     0 24578  4243  0  76   0 -     0 exit   ?        00:07:40 VV
4 Z     0 24846  4243  0  75   0 -     0 exit   ?        00:00:04 VV
4 Z     0 25661  4243  0  78   0 -     0 exit   ?        00:08:04 VV
4 Z     0 26718  4243  0  76   0 -     0 exit   ?        00:07:56 VV
4 Z     0 26908  4243  0  82   0 -     0 exit   ?        00:09:45 VV
4 Z     0 27554  4243  0  77   0 -     0 exit   ?        00:09:27 VV
4 Z     0 28478  4243  0  82   0 -     0 exit   ?        00:08:10 VV
4 Z     0 28553  4243  0  78   0 -     0 exit   ?        00:10:21 VV
4 Z     0 29034  4243  0  76   0 -     0 exit   ?        00:09:24 VV
4 Z     0 29173  4243  0  82   0 -     0 exit   ?        00:09:54 VV
4 Z     0 29193  4243  0  82   0 -     0 exit   ?        00:09:04 VV
4 Z     0 29722  4243  0  78   0 -     0 exit   ?        00:09:34 VV
4 Z     0 30856  4243  0  78   0 -     0 exit   ?        00:09:11 VV
4 Z     0 30999  4243  0  83   0 -     0 exit   ?        00:09:04 VV
4 Z     0 31057  4243  0  78   0 -     0 exit   ?        00:09:51 VV
4 Z     0 31274  4243  0  76   0 -     0 exit   ?        00:07:51 VV
4 Z     0 31735  4243  0  76   0 -     0 exit   ?        00:00:04 VV
4 Z     0 31924  4243  0  81   0 -     0 exit   ?        00:08:01 VV
4 Z     0 32121  4243  9  78   0 -     0 exit   ?        00:10:11 VV 

then we have to look into PPID(parent process i’d) and kill that process,

here the PPID is 4243

so the command to be executed will be

 kill -9 4243

Reference: Me

Thank you for viewing helpinlinux.com