Get information on a defunct process (AKA zombie)

810 views Asked by At

How do I get all information about a defunct process?

For example, I would like to know: who is the parent process, what command was used to run this defunct process, reason why its dead, log...

When I run ps aux | grep defunct all I get is this:

[admin@a ~]# ps aux | grep defunct
admin    30798  1.3  0.0      0     0 ?        Zs   10:03   0:00 [httpd] <defunct>
admin    30799  1.6  0.0      0     0 ?        Zs   10:03   0:00 [httpd] <defunct>
admin    30800  1.3  0.0      0     0 ?        Zs   10:03   0:00 [httpd] <defunct>
admin    30801  4.0  0.0      0     0 ?        Zs   10:03   0:00 [httpd] <defunct>

Note: I'm using Red Hat / Centos OS.

1

There are 1 answers

0
DavidS On

Following is how I caught the command that was run, it contains the information I needed.

Run: while true; do ps aux | grep httpd; done

Search the output for the defunct PID.

From the output:

admin    26741  0.0  0.0  22024  2444 ?        Rs   11:25   0:00 /opt/XYZ/web/Apache/bin/httpd -DFOREGROUND -k start -f /opt/XYZ/conf/httpd.conf -DFLAG1

admin    26741  0.0  0.0      0     0 ?        Zs   11:25   0:00 [httpd] <defunct>