Operating System - HP-UX
1821410 Members
2979 Online
109633 Solutions
New Discussion юеВ

Date/time is wrong after reboot

 
Elmar P. Kolkman
Honored Contributor

Date/time is wrong after reboot

I have some HP9000 machines (N4000 running HP-UX 11i f.e.) which have a wrong date/time after reboot. When they are running the date/time is maintained by xntpd, which is synced indirectly to a GPS clock. But after a reboot, the clock is 6 hours behind, too much for ntp to sync to. And ntpdate -B takes about 18 hours to sync.

Putting the NTP server in the netdaemons file is not an option, because the rc file is used to start the ntp daemon if it stopped for some reason, meaning that the clock would be stepped that moment.

I have looked in the forums, and found someone mentioning the system time is copied to the RTC(=real time clock) every 10 minutes, but apparently that is not the case on the N4000.

Does anyone know of a command to set the RTC on 11i? That would solve my problem on the ntp slaves...
Every problem has at least one solution. Only some solutions are harder to find.
8 REPLIES 8
Robert-Jan Goossens
Honored Contributor

Re: Date/time is wrong after reboot

Hi,

Check this doc,

http://www5.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063208021

How to set Real System Clock to GMT on L2000 or N4000? DocId: KBRC00004731 Updated: 11/30/00 3:46:00 AM

Hope it helps,
Robert-Jan

Elmar P. Kolkman
Honored Contributor

Re: Date/time is wrong after reboot

Not the answer I would like. I will check this with our support engineer when I see him. Because if the document is correct, it would mean that HP set the clock wrong... ntp runs in UTC too !
Every problem has at least one solution. Only some solutions are harder to find.
Elmar P. Kolkman
Honored Contributor

Re: Date/time is wrong after reboot

I have contacted our HP Support and they gave me some info on how to request the time from the BCH configuration menu. When we next reboot we are going to look at this. More info will follow.
Every problem has at least one solution. Only some solutions are harder to find.
Elmar P. Kolkman
Honored Contributor

Re: Date/time is wrong after reboot

Ok. As promissed, more info on this...
From the BCH configuration menu, you can set the time for the RTC (TIme). Mind that that time has to be in UTC, not local time which was probably the cause for the problem we had with this server in the first place.
Every problem has at least one solution. Only some solutions are harder to find.
Neil Dixon
Advisor

Re: Date/time is wrong after reboot

Have you got the timezone kernel parameter set correctly?
Elmar P. Kolkman
Honored Contributor

Re: Date/time is wrong after reboot

The kernel is fine. The problem was the RTC of the server itself. It was 6 hours off.
Every problem has at least one solution. Only some solutions are harder to find.
Bruno Ganino
Honored Contributor

Re: Date/time is wrong after reboot

Elmar i remember you:

For setting time and date or time-zone use
/sbin/set_parms

The modification of the clock of the system could provoke unexpected results for jobs programmed from /usr/sbin/cron, Also The program "make" is sensitive to the information on time and date.

If necessary
Connecting like superuser.

Extinguish the system in way unique user (example /etc/shutdown)

Find the PID for cron
ps- ef|grep cron

Stopped cron inserting: kill pid

Setting time and date
(example date 120513002003)

Restart cron inserting: cron

Extinguish and restart the system immediately inserting:
/etc/shutdown- r 0

Regards
Bruno
Torino (Turin) +2H
Elmar P. Kolkman
Honored Contributor

Re: Date/time is wrong after reboot

Bruno,

The problem was that the Real Time Clock was off and setting the clock using anything like date, ntpdate, etc didn't set the Real Time Clock right. After a reboot the clock would be off like it was before... This problem can only be solved from the BCH according to HP. It shouldn't be necessary as HP delivers systems with a correct time, but for some reason this slipped their attention for this particular server.

Since this part of the BCH is only accessible when the system is down, and the RTC is only copied to the system clock when booting, it has no effect on any unix process.
We run the system with a correct system time, though it might take up to 18 hours (with a RTC off 6 hours), by using ntpdate -B to make sure no process sees any timejump. So no schedulers or databases should notice the change of the RTC. But now that the RTC is (almost) set correctly, this problem is over.
Every problem has at least one solution. Only some solutions are harder to find.