Killing a Zombie Process

0 votes

How to kill a zombie process?

If the zombie is a dead process (already killed), how I remove it from the output of ps aux?

root@OpenWrt:~# anyprogramd &
root@OpenWrt:~# ps aux | grep anyprogram
 1163 root      2552 S    anyprogramd
 1167 root      2552 S    anyprogramd
 1169 root      2552 S    anyprogramd
 1170 root      2552 S    anyprogramd
10101 root       944 S    grep anyprogram
root@OpenWrt:~# pidof anyprogramd
1170 1169 1167 1163
root@OpenWrt:~# kill -9 1170 1169 1167 1163
root@OpenWrt:~# ps aux |grep anyprogram
 1163 root         0 Z    [cwmpd]
root@OpenWrt:~# kill -9 1163
root@OpenWrt:~# ps aux |grep anyprogram
 1163 root         0 Z    [cwmpd]
Jun 20, 2019 in Linux Administration by Shubham
• 13,490 points
409 views

1 answer to this question.

0 votes

You can clean up a zombie process by killing its parent process. Try this;

kill -HUP $(ps -A -ostat,ppid | grep -e '[zZ]'| awk '{ print $2 }')
answered Jun 20, 2019 by Upasana
• 8,620 points

Related Questions In Linux Administration

0 votes
1 answer

Linux: Killing a process occupying a particular port

Use the port command to find the ...READ MORE

answered Apr 3, 2019 in Linux Administration by DareDev
• 6,890 points
610 views
0 votes
1 answer

How to find the process ID of a program?

Hi@akhtar, You can find one program named pgrep ...READ MORE

answered Oct 12, 2020 in Linux Administration by MD
• 95,360 points
259 views
0 votes
1 answer

How to find Resident Set Size of a process in Linux?

Hi@akhtar, RSS is a memory currently used by ...READ MORE

answered Oct 12, 2020 in Linux Administration by MD
• 95,360 points
697 views
0 votes
0 answers

How can I kill a process by name instead of PID, on Linux?

Sometimes when I try to start Firefox ...READ MORE

Apr 13 in Linux Administration by Rahul
• 9,000 points
26 views
0 votes
1 answer
0 votes
0 answers

Merge multiple jpg into single pdf in Linux

I used the following command to convert ...READ MORE

Apr 13 in Linux Administration by Soham
• 8,740 points
49 views
0 votes
1 answer

How do I set variable if a specific package version is installed in CFEngine?

Here is what you can do.Just use packagesmatching to ...READ MORE

answered Jul 12, 2018 in Other DevOps Questions by Atul
• 10,230 points
524 views
0 votes
2 answers

Install postgreSQL on Ubuntu

Follow the below commands to install PostgreSQL (PSQL) ...READ MORE

answered Nov 12, 2020 in Database by Prachi
• 140 points
405 views
0 votes
1 answer

generating a list of files with their absolute path in Linux

If you find an absolute path to start with, ...READ MORE

answered May 16, 2019 in Linux Administration by Upasana
• 8,620 points
489 views
0 votes
1 answer

To run a shell script on a Unix console or Mac terminal

To run a non-executable sh script, use: sh myscript To run ...READ MORE

answered May 16, 2019 in Linux Administration by Upasana
• 8,620 points
336 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP