1855938 Members
6641 Online
104107 Solutions
New Discussion

ntp - drifting time

 
SOLVED
Go to solution
Konrad Hegner
Frequent Advisor

ntp - drifting time

Hello

We would start a ntp-client on a running unix-server. 'Time moving' is very difficult (because the connected ADM-Machines). If there any restriction about the 'drifting'-time? (e.g. what's happen by synchronizing, when the server goes 2 hours next to the real-time?)
And the last question: It is a problem, when you have e.g MET, but the 'synchronize-server' have GMT. I don't think so, because you had declared it.

Best regards Konrad
3 REPLIES 3
Elmar P. Kolkman
Honored Contributor

Re: ntp - drifting time

NTP will, by default, only adjust the system time if it is not more then a half hour off. If you want it to drift to the real time when the clock is off more, you'll have to use 'date -a ' (man date) or 'ntpdate -B ' (man ntpdate).

NTP (and unix in general) always works with a system clock in UTC (or GMT, which is the same). When displaying the time, it gets converted to the local time using the timezone, in your case apparently MET, so the user can understand it and compare to his own watch. So no, it is not a problem.
Every problem has at least one solution. Only some solutions are harder to find.
Bernhard Mueller
Honored Contributor

Re: ntp - drifting time

Konrad,

smooth adjustment is only made if the offset is below 128 milliseconds,

if more than 128 millliseconds, NTP does a step adjustment (you see that in syslog.log)

if more than 1000 milliseconds (appr. 15 minutes) the daemon exits, you need to fix it, since NTP assumes something went wrong.

Regards,
Bernhard
Bill Hassell
Honored Contributor
Solution

Re: ntp - drifting time

Oops, a bit of clarification here. NTP has two commands for setting the time: xntpd (the daemon) which never steps the time, and ntpdate which can step the date. Never use ntpdate to maintain date/time except during startup (as is the case for /sbin/init.d/xntpd). The xntpd daemon will allow adjustments where the time differs up to about 10 minutes but will NEVER lose or add a single second of time. During the adjustment, the clock will be slightly slowed or sped up but every second (86,400 per day) will still exist. This will be very slow...10 minutes will require several hours to adjust the time.

If the time is hours out of adjustment, NOTHING will be done and an error message is recorded in syslog. If the time is way out of sync, you must shutdown and reboot to allow ntpdate to set the time correctly.

NOTE: NTP maintains the system clock in GMT (UTC or Zulu) time. The concept of a timezone is defined by a login. If you set TZ=MET then the date command will translate the internal time into MET format. Try these:

TZ=MET date
TZ=EST5EDT date
TZ=DMT date

Be sure to setup NTP correctly by editing /etc/rc.config.d/netdaemons and using ntpq -p to verify that the NTP sources are indeed reachable.


Bill Hassell, sysadmin