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 Application Stack / User Interface Bash / Shell Scripts Commands and Packages Compilation Content Management System - CMS Core Kernel C Programs Development & Build Development Environment Setup Errors & Failures Flutter git Go Language Programs Hardware Platforms HTML JAVA Programs Kernel & Device Drivers Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Monetization / Google AdSense NDK / Middleware / HAL OS Concepts PHP Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized User Interface Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply / Ask Question