How to find and kill zombie process ?

If you already knows whats zombie process and wanted to identify all zombie process’s in you system, you can directly proceed ahead but if you don’t know, we may suggest you first read the article, “What is Zombie process and How to create zombie process in Linux ?”

Lets consider, now you have created the zombie process purposefully, and want to identify what are its details, type below command,

 $ ps -aux | grep defunct 

This will give you all existing zombie process in your system ( which will also include our purposefully created “our_zombie_child” ) as,

$ ps -aux | grep defunct
root      1303  0.0  0.0      0     0 ?        ZN   14:01   0:00 [bandwidthd] 
myuser    4496  0.0  0.0      0     0 pts/3    Z+   14:37   0:00 [our_zombie_chil] 

Now, you can also check what is the parent process of this child as, [ Note: 4496 is pid of child ]

$ pstree -p -s 4496
systemd(1)───lightdm(1235)───lightdm(1742)───upstart(1978)───gnome-terminal-(4423)───bash(4430)───our_zombie_chil(+

This will give the complete process tree of the defunct child.

Now, if you want to kill the zombie process, we can use the “kill” command along with its pid as,

 kill -9 4496 
Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home JAVA Programs Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply