Kill the Zombie process

Source: Internet
Author: User

Recently, wrote a pcap aspect of the program, when the program started, there is a daemon monitoring, will restart;

The program itself will be multi-threaded monitoring of all active network cards, while using two threads, one to do time-out check, a connection status display;

Today in the replacement, found that there is a zombie process this situation occurs, because the internal use of a lot of sleep, maybe you kill the main thread, the child thread is still dormant, causing this phenomenon;

Now describe how to kill the zombie process to replace the program;

1, first replace the execution program, with MV, can not use CP,CP will prompt said: cp:cannot create regular file './dev_list_server ': Text file Busy

2, determining the zombie process related information: PS-E-O stat,ppid,pid,cmd | Egrep ' ^[zz] '

3, you may need to use this command: PS-EF | grep "Defunct"

4, kill all the displayed sub-processes;

5, so that when the daemon restarts, it will start and you have replaced the execution program.

Online said that my situation is ideal, described as follows:

By ending the parent process to end the zombie process, this can only be considered an ideal situation, many times the zombie process we can not end the parent process, such as the parent process is the INIT process, the end of the parent process, the entire system is dead, this time can consider the hanging screwdriver process, which is equivalent to "curve salvation." Once a process is suspended, it is tantamount to "doing nothing". You can suspend a process by executing the following command.

Kill-hup process PID to the specified ID process, send suspend condition;

Describes the record end.

Kill the Zombie process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.