1

When a Linux machine with NTP capabilities will start and it does not find the NTP server, how it will determine the time? A clue I have is that it uses some heuristic method but I don't need what does that mean.

My main question is: How can I track such an event on a monitoring purpose?

1 Answer 1

3

During boot, the Linux kernel will typically retrieve the system time from an on-board RTC chip. This would occur before networking services/daemons like NTP are up and running. When NTP does try to connect to a server and fails, then the system time is simply not changed. So there is no "heuristic method". Some architectures or platforms can vary this scheme; e.g. I've modified U-Boot to try and connect to the SNTP server to update the RTC before the Linux ARM kernel is loaded.

Check the system log (the 'dmesg' command) for system clock settings.

3
  • Tracking when the RTC is used as a server time I have to track when all the NTP calls get failed. Any clue, where this information could be found?
    – mico
    Jun 14, 2011 at 9:53
  • 1
    The NTP daemon writes to the system log by default. The level of reporting detail can be configured. The man page for ntpd has the details.
    – sawdust
    Jun 14, 2011 at 18:48
  • @Mikko: Linux only reads time from the RTC once -- during early kernel startup. After that, the RTC is not read from, unless you manually issue hwclock --hctosys. Jun 14, 2011 at 19:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .