PDA

View Full Version : What is role of ntpdate in F9?


techmum
5th May 2008, 06:38 AM
Particularly for Virtual Machines I have tended to use ntpdate in a cron job rather than ntp in order to have easier control over the update interval.

I notice that F9 has added ntpdate as a service.

Presumably the intention is that it will be configured in the file /etc/sysconfig/ntpdate, however the ntpdate man file seems out-of-date, so not clear what settings to use, for example, to set the update interval.

Any info on this as yet?

markkuk
5th May 2008, 07:43 AM
The purpose of ntpdate is to set the time once at boot, before starting the ntp service. That's what the ntpdate pseudo-service in F9 does. The functionality that used to be in /etc/rc.d/init.d/ntp has been split into a separate init script.
Running ntpdate from cron is a bad idea (http://lists.debian.org/debian-user/2002/12/msg04091.html) . Use ntp instead.

stevea
5th May 2008, 07:56 AM

ntpdate man page is correct and doesn't document the service.

The so-called service started in /etc/init.d/ntpdate just runs the startscript once at startup, creates a lockfile, then at shutdown deletes the lockfile. Not really a service. The startup script *seems* simple.. It scans /etc/ntp/setp-tickers, looking for server names and uses these as args to ntpdate.

It seems to be a boot-time option to set the hwclock. Nothing more. This used to be done in ntpd script I believe. I suppose yo ucould restart the ntpdate service to re-sync clocks.

stevea
5th May 2008, 08:03 AM
Markkuk - what is wrong with running ntpdate from a cron job. I don't see the problem.
Also there is nothing called "ntp" to run so I don't understand your comment.

ntpdate is a simple binary tool that comes w/ the ntp package I think the alternatives are to run ntpd or ntpdate, and for a virtualization (most will use the host clock) I'd just use ntpdate one time unless time was very critical.

markkuk
5th May 2008, 08:24 AM
Markkuk - what is wrong with running ntpdate from a cron job. I don't see the problem.
Follow the link in my previous post or see the NTP FAQ (http://www.ntp.org/ntpfaq/NTP-s-config.htm#AEN2691)
Also there is nothing called "ntp" to run so I don't understand your comment.
Sorry, i meant "ntpd".
I think the alternatives are to run ntpd or ntpdate,
They aren't alternatives, both have specific purposes: ntpdate sets the clock to a good enough initial value at boot time so that ntpd can synchronize quickly, ntpd keeps the clock accurately synchronized while the system is operating.

techmum
5th May 2008, 10:04 AM
Running ntpdate from cron is a bad idea (http://lists.debian.org/debian-user/2002/12/msg04091.html) . Use ntp instead.

Ta to you and stevea for explanation.

However, for Virtual Machines, ntpd can be pretty useless. In my experience ntpd just cannot handle the massive drifts that happen in VMs (VMware Server).

Wherever possible I have been using ntpd on the host, and then use a cron job to run ntpdate against the VM host. I can also appreciate it would be unreasonable to blast the main ntp servers with a gazillion ntpdate requests, so getting the local host right and using the local host is critical.

Perhaps there is something else I am missing?