Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Network Troublshooting => General Networking Support in Linux => Topic started by: wombat53 on May 30, 2005, 10:34:01 PM

Title: Port numbers already in use: how to identify?
Post by: wombat53 on May 30, 2005, 10:34:01 PM
Hi group
I am trying to run a daemon which uses a port reserved for it in /etc/services, and after several minutes, it fails, with:

/opt/IBM/db2/V8.1/bin$ db2icd start
"Initializing startup.
a few minutes passes ....
Unable to start DB2 Information center daemon."

SYSLOG indicates the following:

May 30 18:26:07 george inetd[5614]: auth/tcp (2): bind: Address already in use
May 30 18:26:07 george inetd[5614]: finger/tcp (2): bind: Address already in use
May 30 18:26:07 george inetd[5614]: ftp/tcp (2): bind: Address already in use
May 30 18:26:07 george inetd[5614]: time/tcp (2): bind: Address already in use

Am running Slackware LINUX with 2.4.22 kernel

I am presuming the message means that the port is in use (by another process). How can I found out who is currently using which ports, please.
Thanks
George Peters
Title: Port numbers already in use: how to identify?
Post by: rohitb on June 02, 2005, 09:14:39 AM
You can try this command

#netstat 1a  

this command gives out put of currently open and connected ports.

Else you can go and search for /etc/services file.This file contains all the information about all the services with the port they are using.
Might be helpfull to you.
Title: Port numbers already in use: how to identify?
Post by: wombat53 on June 02, 2005, 12:18:52 PM
Thanks rohitb
What is so interesting is that the port reserved for this daemon is not in use, as shown by NETSTAT, not is it used by another procees in /etc/services. I am still mystified by the precise meaning of the SYSLOG message.
THanks
George
Title: Port numbers already in use: how to identify?
Post by: rohitb on June 03, 2005, 04:22:50 AM
You didnt got my point, /etc/services files shows you what service uses which port but unless that service is running the port is free.The port will only be in use only when that service is running otherwise it will be used for udp/tcp broadcasts which are randomly generated by tcp/ip stack.
Title: Port numbers already in use: how to identify?
Post by: wombat53 on June 03, 2005, 04:39:12 AM
Rohit
Ok, but how then to interpret  the messgae:
"May 30 18:26:07 george inetd[5614]: auth/tcp (2): bind: Address already in use"
Which address, exactly? The port (51000)? Certainly that port is NOT in use as shown by NETSTAT. Perhaps it is referring to something else? I am at a loss...I am more familiar with the IBM world, where each and every message(for all sub-systems, products, etc.)  has an identifier, and one can go off to the appropriate Error Messages Manual, with suggested remedies. They might vary in usefulness, of course, but this message from inetd directs me nowhere!
Thanks
George
Title: Re: Port numbers already in use: how to identify?
Post by: linuxswan on November 14, 2008, 10:11:50 AM
try to use this command

namp localhost