ntpdate gets reply from server, ntpd doesn't (confused!)
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.