LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-15-2006, 02:51 PM   #1
Lindahl
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Rep: Reputation: 0
ntpdate gets reply from server, ntpd doesn't (confused!)


For some reason, I'm not getting a reply from the ntp server using ntpd, but ntpdate works just fine.

using ntpdate:

-bash-2.05b# date
Tue Feb 1 00:57:53 UTC 2000
-bash-2.05b# ntpdate 192.168.0.2
Looking for host 192.168.0.2 and service ntp
host found : 192.168.0.2
15 Jun 19:34:19 ntpdate[2482]: step time server 192.168.0.2 offset 201033381.467427 sec
-bash-2.05b# date
Thu Jun 15 19:34:22 UTC 2006

using ntpd (after reboot):

-bash-2.05b# date
Tue Feb 1 01:10:47 UTC 2000
-bash-2.05b# ntpd -A -dd -q -g -c /etc/ntp.conf > ntpdebug.log
-bash-2.05b# date
Tue Feb 1 01:11:41 UTC 2000
-bash-2.05b# cat /var/log/ntp.log
1 Feb 01:11:18 ntpd[1863]: frequency initialized 0.000 PPM from /var/lib/ntp/drift
1 Feb 01:11:35 ntpd[1863]: no reply; clock not set

The options specified for ntpd are: don't worry about sanity check (g), act like ntpdate - update once, then exit (q), level 2 debugging (dd), and don't bother authenticating (A). I can provide "ntpdebug.log", if necessary, but it's long, so I'm leaving it out for now.

-bash-2.05b# cat /etc/ntp.conf
restrict default ignore

restrict 192.168.0.2 mask 255.255.255.255 nomodify notrap noquery
server 192.168.0.2

# restrict 127.0.0.1
# server 127.127.1.0 # local clock
# fudge 127.127.1.0 stratum 10

logfile /var/log/ntp.log

driftfile /var/lib/ntp/drift
broadcastdelay 0.008
 
Old 06-15-2006, 02:56 PM   #2
Okie
Senior Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 1,154

Rep: Reputation: 187Reputation: 187
i never use ntpdate, i just enable ntpd to run in the background, with only the three lines in the /etc/ntp.conf

server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
 
Old 06-15-2006, 03:06 PM   #3
Lindahl
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Okie
i never use ntpdate, i just enable ntpd to run in the background, with only the three lines in the /etc/ntp.conf
I'm not sure how that helps . It's ntpd that doesn't work - I don't want to use ntpdate either. I'm only using those options to show the issue, as I will be running ntpd in the background, once it works.
 
Old 06-15-2006, 03:22 PM   #4
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
For reasons I don't really understand, ntp servers give people problems. Here's the solution. Purge ntpdate, ntpd, /etc/ntp.conf, everything you've got related to it. Then install ntp-simple, and you're done.
 
Old 06-15-2006, 06:32 PM   #5
Lindahl
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rickh
For reasons I don't really understand, ntp servers give people problems. Here's the solution. Purge ntpdate, ntpd, /etc/ntp.conf, everything you've got related to it. Then install ntp-simple, and you're done.
Unfortunately, that isn't an option. Thanks for the suggestion, though.

To frustrate me even further, ntpdate refuses to work within a script (says that the network is unreachable - sounds like the same problem that ntpd is having?). The environment variables aren't any different in the script, other than the SHLVL, obviously (verified with diff). The only user is root (embedded platform), so permissions can't be getting in the way. Ugh.

Last edited by Lindahl; 06-15-2006 at 06:39 PM.
 
Old 06-20-2006, 06:26 PM   #6
Lindahl
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Tracked down this post, which explains the behavior I'm seeing (no reply; clock not set). The clock won't be set by ntpd for large offsets even when you specify the -g flag which is supposed to always fix the clock, even for such offsets. Has anyone else run into this problem too? Basically, it looks like the '-g' option for ntpd is broken and a horrible error message is given - there is a reply. Consensus?

I suppose the fix for this is to run ntpdate at boot time. Any 'better' ways, or is this kludge the only way to work around the currently broken ntpd? At this point, it seems obvious that a cron job with ntpdate is more robust than ntpd. :roll eyes:

EDIT: After further investigation, fixing the offset with ntpdate and using ntpd for a single update (-q), did not fix the problem, I still get the "no reply; clock not set" error message. Anyone?

Last edited by Lindahl; 06-20-2006 at 06:35 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot reply to mail server cylarz Linux - Networking 1 05-08-2006 10:07 AM
ntpd time server problem MGrosskopf Linux - Networking 0 02-06-2005 08:57 AM
How to setup a NTPD server hanava Linux - General 0 05-05-2004 12:02 PM
Set up server as a NTPD server hanava Linux - Newbie 1 05-04-2004 02:34 PM
NTPD on a Linux server with SCO Unix client. hanava Linux - Newbie 3 05-03-2004 06:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration