Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
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 '11 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 '11 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. –  grawity Jun 14 '11 at 19:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.