Mauro wrote: > I think ntpd crashes are because my server lost time. > I have ntpd in two server, now I've seen that in one of these ntp > crashes and the time of the server is 1 hour forward. > That's why ntp crashes: server time goes 1 hour forward and ntp can't > resynchronize so it crashes.
Is it really crashing or is this intended behavior. The ntpd is documented with: -g Normally, ntpd exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, ntpd will exit with a message to the system log. This option can be used with the -q and -x options. Therefore if the time is one hour forward that will be greater than the threshold 1000 seconds and ntp will exit. As described this is so that the admin may adjust the time manually to some specific value (for whatever reason, testing, whatever) and ntpd will get out of the way. It also says that ntpd will log a message to the system log when this condition occurs. I think it is possible that you have some additional process that is setting the clock and this is jumping the time forward one hour and because the time is jumped forward one hour that exceeds the ntpd panic threshold and therefore ntpd decides that it should get out of the way and it intentionally exits. This intentional behavior is quite a bit different from a crash. > Now I don't know why my server time goes 1 hour forward. I have in past experience run into a case where someone had set up a date setting cron task that is running exactly on the hour. Due to small race condition differences the cron task would sometimes set the time incorrectly and would cause an hour jump as you describe. In my case removing the date setting cron task solved the problem I described. But I do not know if that is your problem or not. > Hwclock --debug says that the time is correct, it is set on UTC, so > why sometimes it goes forward? > Perhaps a problem in the cmos battery? The hardware clock is normally only used at two different places. One is at boot when the operating system time is loaded from the hardware clock time. The other is at system shutdown when the hardware clock time is set from the current operating system time. The hardware clock is not otherwised used by the operating system. The operating system always uses the operating system time. Bob
signature.asc
Description: Digital signature