Operating System - HP-UX
1833187 Members
2806 Online
110051 Solutions
New Discussion

Re: How can I know what is running on a TCP port

 
SOLVED
Go to solution
Christophe MAILHE
Frequent Advisor

How can I know what is running on a TCP port

Hi everybody,

I have been trying to install XNTPD on one of my server, but the port 123 seems to be already in use by another application. When starting xntpd I got the following error message :

13 Sep 18:57:33 xntpd[1599]: bind() fd 10, family 2, port 123, addr 8264ffff, in_classd=0 flags=0 fails: Address already in use

Does someone can tell me how I could find which application is running on this port ?

Many thanks,

Chris.
11 REPLIES 11
Stefan Farrelly
Honored Contributor

Re: How can I know what is running on a TCP port


lsof will show you what is using a TCP port. You can download from;

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.64/

Once installed you do;

lsof -i | grep

Im from Palmerston North, New Zealand, but somehow ended up in London...
Christophe MAILHE
Frequent Advisor

Re: How can I know what is running on a TCP port

Cannot use lsof on this machine as this is a 64 bits and I can use cc on this production server.

Another idea, or if someone have the 64b version of lsof (HP-UX 11.00) ?

Many thanks,

Chris.
Yogeeraj_1
Honored Contributor

Re: How can I know what is running on a TCP port

hi,

There should not be any problem.

Can you try the attached binary?

Hope this Helps!

Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Bill McNAMARA_1
Honored Contributor

Re: How can I know what is running on a TCP port

have a look at /etc/services
It should be ntp...
perhaps try stopping and restarting it..

Later,
Bill
It works for me (tm)
Stefan Farrelly
Honored Contributor
Solution

Re: How can I know what is running on a TCP port


Send me an email and I will reply with a 64bit version of lsof attached.

There have been tons of questions and replies about this lately but ive just checked most of them and they all point to lsof v4.64 - which is NOT a 64bit version (the .64 is just a subversion number).

Cheers,

Stefan
Stefan_Farrelly@ipcmedia.com
Im from Palmerston North, New Zealand, but somehow ended up in London...
Bill McNAMARA_1
Honored Contributor

Re: How can I know what is running on a TCP port

32 and 64 bit versions here:

ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/binaries/hpux/B.11.00/vxfs/


Later,
Bill
It works for me (tm)
Christophe MAILHE
Frequent Advisor

Re: How can I know what is running on a TCP port

I have found nothing for port 123 neither for address 8264ffff using lsof -i.

Another idea ?

Cheers,

Chris.
Patrick Chim
Trusted Contributor

Re: How can I know what is running on a TCP port

Hi,

I have seen this error before. It's due to the wrong configuration of ntpd environment.

Do you set your server to be a ntp server or a ntp client ?

Regards,
Patrick
Stefan Farrelly
Honored Contributor

Re: How can I know what is running on a TCP port


I seem to recall one of 2 possibilities;

1. you need a later patch for ntp. You can check on itrc.hp.com under individual patches for ntp patches (do a search).

2. Even after you start xntpd (/sbin/init.d/xntpd start) have you checked the ntp daemon didnt start even though it produced an error ? (ps -ef|grep ntp) Does this command work; ntpq -p
Im from Palmerston North, New Zealand, but somehow ended up in London...
Christophe MAILHE
Frequent Advisor

Re: How can I know what is running on a TCP port

Hi Patrick,

This server is a client.

Here is the ntp.conf file for this machine :

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

server 127.127.1.1 # local clock
fudge 127.127.1.1 stratum 3 # Allow local Synchro.
broadcastclient no # Not a Broadcast Client
driftfile /var/adm/syslog/ntp.drift # Drift File
statsdir /var/tmp/ntp/ # Statistics Directory
statistics loopstats # Enable Stats
statistics peerstats # Enable Stats
filegen loopstats file loopstat type week enable # 1 week stat only
filegen peerstats file loopstat type week enable # 1 week stat only
filegen clockstats file clockstats type week enable # 1 week stat only
server pita.housing21.co.uk version 3 # Internal Stratum 2 Server
peer titan.housing21.co.uk version 3 # Internal Stratum 3 Peer


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Many thanks,

Chris.
Steven Sim Kok Leong
Honored Contributor

Re: How can I know what is running on a TCP port

Hi,

Have you checked udp as well?

# lsof -i udp:123

Hope this helps. Regards.

Steven Sim Kok Leong