简体   繁体   中英

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:

 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.

Though it is too late to solve your problem, I am answering this for future.

NB This is for apache server. The same may apply to tomcat or others. 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. The following command solved for me.

sudo /etc/init.d/apache2 restart

This is nothing but restarting apache.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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