Solutions to view and occupy Linux system ports

Source: Internet
Author: User

Reprint please indicate the source: The Curtain Roll westerly column (Http://blog.csdn.net/ljxfblog)

All along, in the process of processing a Linux server, often encountered a problem, sometimes after the kill process, the port is occupied, the new process has not come, wait a few 10 seconds to start normally. So there has been no special treatment for this problem.

In the recent week, this is a frequent occurrence, waiting for a long time can not start a new process, always prompt port is occupied, only restart the machine to return to normal, this is a disaster, so determined to solve the problem.

Looked up some information and learned how to view port occupancy and how to handle it.

1. Use the netstat command to view port usage.

2. We also need to know what the program occupies, plus the-p parameter

3, if more time we can also use grep filter

4. Then kill the process that takes up the port, and under normal circumstances you can start a new process.

Okay, so we've solved the annoying problem of port occupancy.

But I encountered another problem, my code used a parent-child process, kill the parent process, the fork out of the child process is occupied by the parent process to listen to the port, you must kill the processing process to start, temporarily do not know how to solve, and so on later time to check.



Solutions to view and occupy Linux system ports

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.