Operating System - HP-UX
1834512 Members
2193 Online
110068 Solutions
New Discussion

NTP Jump Forward/Backwards Prevention

 
SOLVED
Go to solution
Justin Willoughby
Regular Advisor

NTP Jump Forward/Backwards Prevention


On our HP boxes, we have them get their time from our NetWare servers once a day. This was setup by the previous sys admin here. The following cron job/line does this:

0 4 * * * ntpdate ipaddress1 ipaddress2

One morning the NetWare servers screwed up and sent out a time that was one hour a head of what is should have been, as a result our time was off by an hour on our HP box once the ntpdate was run at 4am. This is a problem for us because we run an application that needs to have the correct time.

How are others updating their time but also preventing the time from being changed in the case it is way different then it should be?

This problem was not with time zones, the NetWare NTP servers just sent out at time that was one hour more then it should have been.

Thanks,

- Justin
6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: NTP Jump Forward/Backwards Prevention

Justin,

You should consider syncing to a reliable, external NTP source rather than something so arbitrary as your netware server sounds. You can use SAM to set up NTP, do a man on xntpd for more help, and search the forums on NTP for even more guidance.

Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: NTP Jump Forward/Backwards Prevention

Hi Justin:

You need to implement the cousin of 'ntpdate'; viz. 'xntpd'.

The Network Time Protocol (NTP) has been discussed many, many times here. For a decent reading on the subject see chapter-7 of the "Installing and Administering Internet Services" guide:

http://docs.hp.com/hpux/onlinedocs/B2355-90685/B2355-90685.html

Regards!

...JRF...



Justin Willoughby
Regular Advisor

Re: NTP Jump Forward/Backwards Prevention

JRF,

Will xntpd prevent huge time changes from taking effect?

- Justin
Kellogg Unix Team
Trusted Contributor

Re: NTP Jump Forward/Backwards Prevention

Justin,

What you can do is to run ntpdate only during system boot-ups and run xntpd when its up and running to avoid sudden time jump. The document mentioned above explains that.

Rgds
...Manjeet
work is fun ! (my manager is standing behind me!!)
Pete Randall
Outstanding Contributor

Re: NTP Jump Forward/Backwards Prevention

Justin,

The xntpd is designed to adjust the time gradually so as to prevent problems with sudden changes.

Pete

Pete
Bill Hassell
Honored Contributor
Solution

Re: NTP Jump Forward/Backwards Prevention

ntpdate should be used in only ONE location: the startup script for xntpd so that the date is set at bootup. The previous admin did not understand NTP at all. Using ntpdate in this way is no better than an operator typing in the new time every day.

NTP is run primarily by the xntpd daemon and it is very paranoid about changing the time. xntpd will allow every second during the day to exist. If the time is off, it will slowly adjust the time (5 min adjustment may take 2-3 hours to complete) and will NEVER step the time like ntpdate. xntpd will look at the server with great skepticism and if it sudenly jumps 20 mins or am hour, that server is dropped from the list and will be ignored (which is why you want multiple time sources).

xntpd accounts for all network and application delays and works best with 3 or more time sources. But to answer your question, xntpd will never step the time. I would do this:

- remove the cron entry immediately
- test ntp using: ntpq -p NetWare_server_name
- replace the /etc/ntp.conf line with:

server netware_server_name

Then edit /etc/rc.config.d/netdaemons and set:

export NTPDATE_SERVER="Netware_server"
export XNTPD=1

Check the current time. If it is within a few
seconds (less than 5-6 mins off), then start NTP with:

/sbin/inti.d/xntpd start

Then watch syslog to see that synchronization has begun and use:

ntpq -p

to monitor the connection. The "reach" value will move towards 377 as the connection is verified as reliable.


Bill Hassell, sysadmin