1825766 Members
2213 Online
109687 Solutions
New Discussion

NTP on HP-UX 10.20

 
SOLVED
Go to solution
Michael D'Aulerio
Regular Advisor

NTP on HP-UX 10.20

Does anybody out there know of a way to configure an NTP client so that it will sync to an NTP server whose clock is a few minutes ahead or behind. I've scoured the web and the ITRC. From what I read (and have observed on my system), the NTP daemon (xntpd v3.5) will reject the time reference if it differs by more than 128 msec. If it receives a stable reference from the NTP server over a period of time (about 15 minutes) it will then step its time to match that of the server. NTP does not slew time for differences greater than 128 msec.

I support a remote site and they ran into this problem. I'm still trying to nail down exactly how the client clock got so out of sync with the server (> 5 minutes). The applications on the system cannot handle large time steps. They require a stable time line. I'm hoping there is a way to get NTP to accept the reference faster and to slew to the time rather than step.

Some system info: There are 2 J5600s running HP-UX 10.20 that are NTP clients. There are 2 NTP servers with a Stratum 2 reference clocks. I've attached the ntp.conf files for the 2 clients. I don't have the configuration info on the servers. I'm not sure there is a way to get NTP to behave as I want. On one of our other systems we use ntpdate in a cron job (running every 10 minutes) and its been working very well. But this customer has directed us to use NTP. Any ideas out there?
Email: michael.n.daulerio@lmco.com
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: NTP on HP-UX 10.20

The command you need is date -a sss but unfortunately 10.20's date command does not have the -a option to slew the time. The good news is that it does have the adjtime() system call so that the hooks are there to safely slew the time so that NTP can takeover. It's just about 3 minutes of C.

I intentionally did this in K&R C so that the Bundled compiler will handle it. You can change it to ANSI C if you prefer.

Compile it like this:
cc adjtime.c -o adjtime

Run it like this as super-user:
adjtime -300 # adjust time backwards 300 seconds
OR
adjtime 500 # adjust time forward by 500 seconds

If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: NTP on HP-UX 10.20

Man 2 adjtime so you know what this does. It is equivalent to the date -a command although it will not handle fractional seconds.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: NTP on HP-UX 10.20

Actually, I should have read your posting more closely. Time sources more than 1000 SECONDS out of sync will be rejected. However, you do not want to start xntpd until you fall into the <128ms range so that slewing behavior is used. You can also use the ntpdate -B command to force slewing.

Your other option is to shutdown. Manually set the date and then let xntpd take over.
If it ain't broke, I can fix that.
Michael D'Aulerio
Regular Advisor

Re: NTP on HP-UX 10.20

Clay,

Thank you for all the info. First of all, I didn't know how to score your answers since you sent 3, so I gave you a 6, 7 and 8.

I think adjtime will do what we need. Turns out we already have an application that checks the time delta and uses adjtime() to fix it. However, the call is only made if the delta is less than +/- 5 minutes. It ignored the 8 minute difference.
I also set the NTPDATE_SERVER variable in the netdaemons file so that the system syncs up with the server at bootup. The users rebooted the system and then everything was fine.
Thanks again.
Email: michael.n.daulerio@lmco.com