[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: offtopic "general" help with system clock



The debian package "ntpdate" has the purpose of initializing the clock to a sane value on boot (so it is even usable on machines with a broken hardware clock). Once the clock is close, by using this method, the ntp will always be able to keep it on time from then onwards.

If you're concerned about your hardware,
(1) check the correction being applied by ntpdate on boot, to see whether your battery is running low (for example). (2) use the hwclock command to compare the system clock (maintained by ntp) with the hardware clock (without changing either). (3) look at the kernel logs, where NTP states whenever it changes the system clock slewing parameters, to see what settings it has to use.

Ernest ter Kuile wrote:
I think it's best not to install package adjtimex along ntp as they try to do the same thing (keep the system on time). ntp server will indeed no set the time if it's way off. However, Setting the time to a wild approximation (+/- 1 hour) of the current time is usually enough for ntp to start.

Setting the time by hand can be done by running date as root with appropriate params (see date --help) or using ntpdate at startup once system time is set correctly, you can use hwclock to copy system time to Hardware on shutdown, and read it back on boot.
Cheers,

Ernest.

On Friday 29 October 2004 07:07, Stephen Waters wrote:

OK, so if your system clock is way off and NTP doesn't work, try this
before blaming hardware:

1) delete /etc/adjtime
2) run /etc/init.d/hwclock.sh
3) run adjtimexconfig
4) run ntpdate <server>
5) run /etc/init.d/ntp-server start

Turns out my adjtime was way off due to a bad clock on the previous box
this hard drive was in.

Cheers,
-s






Reply to: