What is utilizing this network outlet?

I'm attempting to make use of NTP to upgrade the moment on my equipment. Nonetheless, it offers me a mistake:

host # ntpdate ntp1.example.org
10 Aug 12:38:50 ntpdate[7696]: the NTP socket is in use, exiting

What does the mistake "outlet remains in usage" suggest? Just how can I see what is utilizing this outlet?

This takes place on my CentOS 4.x system, yet I additionally see it on FreeBSD 7.x, Ubuntu 10.04 and also Solaris 10.

2019-05-04 22:55:55
Source Share
Answers: 4

You can additionally make use of netstat to seek open outlets - - it's much cleaner than making use of lsof as the various other posters have actually recommended. Attempt this command line as origin

netstat -lp -u -t

to watch all paying attention links, including their linked pid's and also programs. The - l parameter is what defines paying attention links, - p defines that you intend to see the PID/name and also - t and also - u inform netstat that you desire just TCP and also UDP links (IPv4 and also IPv6).

If you intend to see numerical port and also host names (ie. not settled when it comes to hosts, and also not changed to solution names when it comes to ports), you can add -n to the command line over.

EDIT : This works with Linux - - I do not recognize just how well it works with BSD, as I do not have any kind of BSD - based boxes around.

2019-05-08 07:16:42

You can do

lsof -n | grep -i "TCP\|UDP" | grep -v "ESTABLISHED\|CLOSE_WAIT"

to see every one of your paying attention ports, yet bucks to donuts that ntpd is running :

service ntpd status

And also when it comes to "What does outlet in operation" suggest? If I can be forgiven for smoothing over some creases (and also for the really standard description, apologies of a lot of this is therapeutic for you) ... TCP/IP (the language of the net) defines that each computer system has an IP address, which distinctly recognizes that computer system on the net. On top of that, there are 65,000 phoned number ports on each IP address that can be attached to.

When you intend to connect to an internet server, you open the website in your internet browser, yet the equipment below is in fact attaching you to port 80 on the internet server's IP. The internet server's daemon (the program paying attention for links to port 80) makes use of a "outlet" to hold open that port, booking it for itself. Just one program can make use of the very same port at once.

Given that you had ntpd operating, it was making use of that port. 'ntpdate' attempted to accessibility that port, yet given that it was currently held open, you obtained the 'outlet currently in operation' mistake.

Changed to make up UDP too

2019-05-08 06:01:13

As origin, do this :

lsof | grep IPv4 | grep LISTEN

This will certainly show you all procedures that are paying attention on IPv4 outlets. You might intend to add -b to stop lsof from doing some points that could obstruct it. If you do that you'll possibly additionally intend to reroute stderr to /dev/null.

2019-05-08 05:02:24

You can make use of lsof to locate which application is utilizing this outlet.

2019-05-08 05:01:15