I have a script to call syscall Kill the process that holds a certain TCP port in Linux (ubuntu). But even if I do that, sometimes the port still remains in /proc/[0-9]/net
directory binding the port.
Is there any easy way to force to free the tcp port? I know which proc/X
directory holds the port that I want to kill. Can I just delete the /proc/XXX/
directory and consider the port is free to use after this deletion?
Some postings say I can use fuser
, but I want to know what's going on in OS level.
Thanks!