The process deadlock occurs when you use the routeadd command. Please give me some advice!

Source: Internet
Author: User
The process deadlock occurs when you use the routeadd command. Please give me some advice! -- Linux general technology-Linux programming and kernel information. The following is a detailed description. My C program executes system ("route del default; route add default gw 2.11.2.1 dev eth3"); after several processes are started, the parent process is killed, the executed shell process becomes an orphan process. As a result, the process is deadlocked and you can see it in ps-ef:
Root 1192 1 0 00:00:00 pts/1 sh-c route del default; route add default gw 2.11.2.1 dev eth3
Root 1193 1 0 00:00:00 pts/1 sh-c route del default; route add default gw 2.11.2.1 dev eth3
Root 1194 1 0 00:00:00 pts/1 sh-c route del default; route add default gw 2.11.2.1 dev eth3
Root 11127 1192 0 00:00:00 pts/1 sh-c route add default gw 2.11.2.1 dev eth3
Root 11134 1193 0 00:00:00 pts/1 sh-c route add default gw 2.11.2.1 dev eth3
Root 11141 1194 0 00:00:00 pts/1 sh-c route add default gw 2.11.2.1 dev eth3
Is there any way to prevent process deadlocks after killing the parent process? Thank you!
Related Article

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.