Alternative way to kill a zombie process

killprocess

I just noticed some zombie processes on CentOS 6.8(Final), tried to kill them but they are still there:

[root@host user]# ps -ef | grep git
tomcat     746     1  0 Jul18 ?        00:00:00 git clone https://github.com/angular/bower-angular.git -b v1.3.20 --progress . --depth 1
tomcat     747   746  0 Jul18 ?        00:00:00 [git-remote-http] <defunct>
root     20776 20669  0 09:03 pts/3    00:00:00 grep git
tomcat   29970     1  0 Jul18 ?        00:00:00 git clone https://github.com/components/jqueryui.git -b 1.12.0 --progress . --depth 1
tomcat   29971 29970  0 Jul18 ?        00:00:00 [git-remote-http] <defunct>

[root@host user]# kill 746 747 29970 29971

[root@host user]# ps -ef | grep git
tomcat     746     1  0 Jul18 ?        00:00:00 git clone https://github.com/angular/bower-angular.git -b v1.3.20 --progress . --depth 1
tomcat     747   746  0 Jul18 ?        00:00:00 [git-remote-http] <defunct>
root     21525 20669  0 09:26 pts/3    00:00:00 grep git
tomcat   29970     1  0 Jul18 ?        00:00:00 git clone https://github.com/components/jqueryui.git -b 1.12.0 --progress . --depth 1
tomcat   29971 29970  0 Jul18 ?        00:00:00 [git-remote-http] <defunct>

As you can see they are running for two months, and too if they are not harmful I would get rid of them, any alternative way to kill a Zombie?

Best Answer

As mentioned by Heemayl, you cannot actually kill a zombie. It's already [un]dead...

However, the problem you are facing looks like a problem with the git clone command. It gets stuck somehow. Probably times out or fails in some other way? It is often because of some I/O that a process gets stuck to the point where a SIGTERM and SIGINT won't work.

To kill it, in this case, you want to use the -9 command line option. This means send the SIGKILL signal. You can actually use -KILL too.

[root@host user]# kill -KILL 746 29970

To get a list of available signals, use the list command line option.

[root@host user]# kill -l

This shows you the numbers and names (and you'll see that #9 says SIGKILL.)

Related Question