LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Free a used port after program crash (https://www.linuxquestions.org/questions/linux-networking-3/free-a-used-port-after-program-crash-57022/)

Dek 04-27-2003 12:25 PM

Free a used port after program crash
 
High,

I'm using lmule on my RedHat.
Sometimes it crashes and then the port tcp 4662 is still used.

I need to free the port in order to avoid reboot and simply reload lmule after a program crash.

Any idea how i can do that ?

Thanks in advance !

Dek

nakkaya 04-27-2003 03:56 PM

type top and locate pid of the lmule
then type kill <pid> as root this should sove your problem

Dek 04-27-2003 07:39 PM

What's the point in killing an already crashed application? It doesn't make sense.
I don't remember "ps -e" or "ps -u root" (or whatever account) showing it after the crash ...

Yet i will try but i doubt it would be an efficient solution ...

Any other suggestion ?

Dek

nakkaya 04-27-2003 08:53 PM

some applocation work in two way core and gui when gui crash es core still runs. next time before judgeing first try it :)

Dek 04-28-2003 11:46 AM

I see ... well i said i will try next time it crashes. Will keep you post in that thread.

Dek

Stijn147 04-28-2003 12:20 PM

Try restarting xinetd:

# /etc/rc.d/initd.d/xinetd restart

Dek 04-30-2003 09:23 AM

Top-killing PID is not working ; restarting xinetd is not working.

Any other idea ?

Dek

tiberius 04-30-2003 10:56 AM

kill -9

Terminate it!

keevitaja 04-30-2003 02:11 PM

the problem is FIN_WAIT connection. you can do nothing about it. use netstat -ta | grep 4662 to determine when all left connections are dead. then run lmule again.

kc8tbe 05-01-2003 06:47 AM

Agreed. My lmule also used to crash on RH9 (although the latest version available via freshrpms.net apt is a lot more stable). The port usually became available again within 90 seconds of the crash.

Dek 05-01-2003 09:20 AM

Ok, that's interesting, very interesting. I will pay attention next time it crashes (of course it did not went you wait it to crash :) lol).

Thanks all of you !

Dek

Addenda :
Well it crash that night. At that moment "netstat" did not report the use of port 4662 (???), "netstat -ta | grep 4662" send nothing.
So i launch again lmule and got the error 4662 unreachable.
I quit. sent the command "netstat -ta | grep 4662" until no one use the port 4662. Then, i block the port 4662 in iptables and restart that one. And just after, reopen the port 4662 and restart iptables. I then go into the lmule directory in my user home and delete the con file (with size 0kb). I also delete the file in /temp/orbit-"myuser" the con file that where changed when i quit lmule.
Consequence, i start lmule again and got a high ID.

Maybe it was something to do with con files (created for each port opened).
I will try to narrow my suspects later. It seems i solve my problem (i'll be sure the next time) and i hope these lines will help others.

Dek


All times are GMT -5. The time now is 05:55 PM.