Re: [SLE] Can I close all connection for a specified port ?
Crosby
Exist a program to close all connection for a given port number ? It's possible to make this think ?
You might look for `fuser' and `lsof'. Both are able to list which processes are waiting or using a given TCP port. Once you know the processes, you may look at them with `ps' and kill them with `kill', effectively freeing the port (after some delay, depending on the originator of the connection). By the way, if you happen to discover at random, with `ps' say, that `sh' is running over a WWW port or a POP port, consider yourself in trouble :-) :-). I did not check the `man' pages for these (you'll surely do that :-), but I think I remember that `fuser' has an option to directly kill the processes. `lsof' might not have such an option, but overall, it looks more versatile to me. So, if you decide to install and learn only one of these two tools, I would suggest you pay more attention to `lsof', even if a bit of extra work is needed for your precise case. Presuming I well understood your question, of course :-). -- François Pinard http://www.iro.umontreal.ca/~pinard -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Thanks Francois , your's advice it was very helpful for me . Thanks again ! Best regards , Crosby. mail to : crosby@sec.sibnet.ro c_crosby@email.com On Wed, 19 Apr 2000, you wrote:
Crosby
writes: Exist a program to close all connection for a given port number ? It's possible to make this think ?
You might look for `fuser' and `lsof'. Both are able to list which processes are waiting or using a given TCP port. Once you know the processes, you may look at them with `ps' and kill them with `kill', effectively freeing the port (after some delay, depending on the originator of the connection).
By the way, if you happen to discover at random, with `ps' say, that `sh' is running over a WWW port or a POP port, consider yourself in trouble :-) :-).
I did not check the `man' pages for these (you'll surely do that :-), but I think I remember that `fuser' has an option to directly kill the processes. `lsof' might not have such an option, but overall, it looks more versatile to me. So, if you decide to install and learn only one of these two tools, I would suggest you pay more attention to `lsof', even if a bit of extra work is needed for your precise case.
Presuming I well understood your question, of course :-).
-- François Pinard http://www.iro.umontreal.ca/~pinard
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
-- -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (2)
-
crosby@sec.sibnet.ro
-
pinard@iro.umontreal.ca