简体   繁体   English

如何强制CLOSE_WAIT停止

[英]How to force CLOSE_WAIT to stop

I can't turn the server off and back on. 我无法关闭服务器然后再打开。 I've tried killing it with a multitude of commands but I seem to end up with loads of CLOSE_WAITS still: 我尝试使用多种命令将其杀死,但最终似乎仍然加载CLOSE_WAITS:

 netstat -a | grep 8043
tcp        1      0 localhost:60667         localhost:8043          CLOSE_WAIT
tcp        1      0 localhost:60830         localhost:8043          CLOSE_WAIT
tcp        1      0 localhost:60828         localhost:8043          CLOSE_WAIT
tcp        1      0 localhost:60820         localhost:8043          CLOSE_WAIT
tcp        1      0 localhost:60821         localhost:8043          CLOSE_WAIT
tcp        1      0 localhost:60818         localhost:8043          CLOSE_WAIT
tcp        1      0 localhost:60802         localhost:8043          CLOSE_WAIT
tcp        1      0 localhost:60819         localhost:8043          CLOSE_WAIT

I know what that the cause is due to some code crashing as I'm developing it. 我知道原因是由于我在开发过程中某些代码崩溃而导致的。 Whats the way to kill it? 杀死它的方法是什么? Its GNU/Linux server. 它的GNU / Linux服务器。

Though it is too late to solve your problem, I am answering this for future. 尽管解决您的问题为时已晚,但我日后会回答此问题。

NB This is for apache server. 注意:这是针对apache服务器的。 The same may apply to tomcat or others. 这可能适用于tomcat或其他。 I didn't try on others. 我没有尝试其他人。

I faced same problem. 我遇到了同样的问题。 I closed server at a port, but got it is hanging at CLOSE_WAIT state. 我在某个端口关闭了服务器,但是却挂在CLOSE_WAIT状态。 The following command solved for me. 以下命令为我解决了。

sudo /etc/init.d/apache2 restart

This is nothing but restarting apache. 这只是重启apache。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM