socket in use ?

  • Follow


Hi folks,

I've installed ntp on a SuSE-Linux 9.0 system.
Crontab starts the ntp-clinet every hour to check the system-time (needed,
as anyhow my mainboard cannot keep time correctly; after 1 day the clock
goes for approx. 1 hour wrong).
After running for a while without problems, I now get this result;

linux:~ # /usr/sbin/ntpdate -v ntp1.sda.t-online.de
 6 May 01:49:09 ntpdate[28990]: ntpdate 4.1.1@1.786 Tue Sep 23 17:37:40 UTC
2003 (1)
 6 May 01:49:17 ntpdate[28990]: the NTP socket is in use, exiting


I have no idea whats going on here, ps shows no ntp-process running...

Does anyone have a hint what to do to fix the problem ?

Thanks in advance.

Stephan
0
Reply Stephan 5/5/2004 11:54:28 PM

Stephan M. Ott wrote:
> linux:~ # /usr/sbin/ntpdate -v ntp1.sda.t-online.de
>  6 May 01:49:09 ntpdate[28990]: ntpdate 4.1.1@1.786 Tue Sep 23 17:37:40 UTC
> 2003 (1)
>  6 May 01:49:17 ntpdate[28990]: the NTP socket is in use, exiting
> 
> 
> I have no idea whats going on here, ps shows no ntp-process running...

Have you checked, as root, the output of "netstat --inet -lnp" ? If this 
command lists something listening to port 123, then something is tying 
up the NTP socket. The last column of the line should tell what program 
is using the socket.

0
Reply Tapio 5/6/2004 12:38:13 AM


Tapio Sokura wrote:

> Stephan M. Ott wrote:
>> linux:~ # /usr/sbin/ntpdate -v ntp1.sda.t-online.de
>>  6 May 01:49:09 ntpdate[28990]: ntpdate 4.1.1@1.786 Tue Sep 23 17:37:40
>>  UTC
>> 2003 (1)
>>  6 May 01:49:17 ntpdate[28990]: the NTP socket is in use, exiting
>> 
>> 
>> I have no idea whats going on here, ps shows no ntp-process running...
> 
> Have you checked, as root, the output of "netstat --inet -lnp" ? If this
> command lists something listening to port 123, then something is tying
> up the NTP socket. The last column of the line should tell what program
> is using the socket.

Fascinating.
I must have been blind when checking ps. Indeed there is a ntpd running.
As this machine is connected to the internet via another linux-server I had
to leave the -inet out and then got the results.
Thank you !

Now the next irritating thing:
I checked the logfile /var/log/ntp and found there:

6 May 02:15:35 ntpd[865]: can't open /var/lib/ntp/drift/ntp.drift.TEMP: No
such file or directory
 6 May 03:15:34 ntpd[865]: can't open /var/lib/ntp/drift/ntp.drift.TEMP: No
such file or directory
 6 May 04:05:33 ntpd[865]: time reset 2.272811 s
 6 May 04:05:33 ntpd[865]: synchronisation lost
 6 May 04:15:35 ntpd[865]: can't open /var/lib/ntp/drift/ntp.drift.TEMP: No
such file or directory

and so on...

From time to time the synchronisations works (the time-difference between
the working steps is irregular), in the other times ntpd complains about a
non-existing file. I tried to fix it with creating this file - didn't work.

Any idea ?

Thank you in advance.

Stephan
0
Reply Stephan 5/6/2004 7:22:35 AM

Stephan M. Ott wrote:
> Now the next irritating thing:
> I checked the logfile /var/log/ntp and found there:
> 
> 6 May 02:15:35 ntpd[865]: can't open /var/lib/ntp/drift/ntp.drift.TEMP: No
> such file or directory
>  6 May 03:15:34 ntpd[865]: can't open /var/lib/ntp/drift/ntp.drift.TEMP: No
> such file or directory
>  6 May 04:05:33 ntpd[865]: time reset 2.272811 s
>  6 May 04:05:33 ntpd[865]: synchronisation lost
>  6 May 04:15:35 ntpd[865]: can't open /var/lib/ntp/drift/ntp.drift.TEMP: No
> such file or directory

I would guess that there is no directory called /var/lib/ntp/drift or 
the directory exists, but ntpd is run as non-root and has no permissions 
to write to the directory. The location of the drift file is specified 
in /etc/ntp.conf on the line beginning with driftfile.

If you run ntpd, there's no need for you to also run ntpdate. ntpd is 
better at keeping your clock synchronized, at least if the error of the 
clock is under 500 parts per million. 500 ppm amounts to a clock error 
of a bit over 40 seconds per 24 hours, if I calculated correctly.

   Tapio

0
Reply Tapio 5/6/2004 3:06:37 PM

3 Replies
372 Views

(page loaded in 0.313 seconds)

Similiar Articles:













7/23/2012 7:39:34 PM


Reply: