Operating System - HP-UX
1751709 Members
4588 Online
108781 Solutions
New Discussion юеВ

Re: Show & Set Hardware Clock on HP-UX

 
SOLVED
Go to solution
Catia Lavalle
Occasional Advisor

Show & Set Hardware Clock on HP-UX

Hello,
I fear one of my HP-UX machine has a quite badly set/quite drifting hardware clock.
I already have NTP running with an external server, but in case of NTP fault I have a problem .....

In Linux there is a command "hwclock" which shows (hwclock --show) or sets the hardware clock with a running machine (without the need to boot). I do not find anything of that kind in HP-UX: neither "hwclock" is installed on the machine, nor I find it in the official repositories under this name.

* Does "hwclcok" exist under this name at all?
* If yes where do I find it?
* If no which is the HP-UX equivalent for it?

I would need it for: "HP Release B.11.11", "HP Release B.11.23" and "HP Release B.11.31".

Another question: on boot does HP-UX set the hardware clock=system clock or not? Where do I see/set it?

Thanks.
9 REPLIES 9
Dennis Handly
Acclaimed Contributor

Re: Show & Set Hardware Clock on HP-UX

>I do not find anything of that kind in HP-UX

It's called date(1). This sets the hardware clock too.

>Another question: on boot does HP-UX set the hardware clock=system clock or not? Where do I see/set it?

Something like that. Depending on whether you have a PA or IPF box, there are various MP/GSP commands to show and possibly set the hardware clock.
Catia Lavalle
Occasional Advisor

Re: Show & Set Hardware Clock on HP-UX

To my knowledge, at least the "default" "date" command shows and sets the system time not the hardware time. For example to see in a linux box if the hardware clock is consistent with the system time (which, say is ruled by an external NTP server) set I would execute:

date;hwclock --show

We have Itanium Boxes.

You say "there are various MP/GSP commands to show and possibly set the hardware clock". OK, that's what I am asking: which ones?
Torsten.
Acclaimed Contributor

Re: Show & Set Hardware Clock on HP-UX

It depends.

On some (entry level) servers you can set the time at the boot menu, on others (mid range and high end) you can set time directly from MP.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Bill Hassell
Honored Contributor

Re: Show & Set Hardware Clock on HP-UX

> but in case of NTP fault I have a problem ...

Don't worry about NTP failure. The clock will continue to run without a problem. Once the NTP server is fixed, xntpd will adjust the time to match the server. Your hardware clock will not drift more than a couple of minutes if NTP is down for several days. NTP can adjust automatically if the difference is less than about 10 minutes.

NOTE: this assumes that you are running ntpdate in cron (an old Linux trick). If you setup NTP correctly, ntpdate will be called from the xntpd start script at bootup which sets the clock.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: Show & Set Hardware Clock on HP-UX

>To my knowledge, at least the "default" "date" command shows and sets the system time not the hardware time.

Why don't you try it and see? On some Integrity servers the clocks are synced up.
Catia Lavalle
Occasional Advisor

Re: Show & Set Hardware Clock on HP-UX

It looks to me there is a bit of confusion...

The hardware clock is the BIOS clock, and is not to mix up with the system clock. All the commands/protocols like NTP, ntpdate, date etc set/show/modify ONLY the system clock.

Normally the BIOS clock is set from the system clock at boot down time, and the system clock is set (first at least, before NTP comes in play, if it comes to play) from the BIOS clock at boot up time.

Meanwhile I came to know that the NTP localhost clock (127.127.1.1) is connected to the "system clock" and NOT the BIOS clock, such that my question is less urgent.

Anyway I still have my open question: how do I see/set the BIOS clock in HP-UX?
Bill Hassell
Honored Contributor
Solution

Re: Show & Set Hardware Clock on HP-UX

> The hardware clock is the BIOS clock, and is not to mix up with the system clock. All the commands/protocols like NTP, ntpdate, date etc set/show/modify ONLY the system clock.

Probably true for PCs and other Intel platforms. PA-RISC and Itanium boxes have no BIOS and instead have a separate processor that handles hardware specific tests and features. Additionally, there are special hooks between HP-UX and the processor firmware (referred variously as PDC, SP, GSP, MP) to control specific features. The date command, ntpdate and xntpd all set the hardware and HP-UX system clocks at the same time. You have to go back to (very old) NIO boxes like the 825/835 models and OS versions before 8.0 (before 1990) to find the clock somewhat separate from OS clock commands.


Bill Hassell, sysadmin
Armin Kunaschik
Esteemed Contributor

Re: Show & Set Hardware Clock on HP-UX

Don't mix up your PC hardware knowledge with HP-UX hardware knowledge! This is completely different in many ways. E.g. the system does not have a BIOS at all (ok, it's not called that way, it's EFI etc).
The date command sets the clock. period.
The hardware clock always runs with UTC, TZ will "adjust" the output to your timezone.
This is the normal behavior on any (non-PC) UNIX system I know.

The "concept" hardware clock was necessary to support dual boot configurations on PC's, because Windows always sets the hardware clock to local time and this would break the system time every time you swap between OS's.

Please follow the advice and sync your clock with external ntp sources... this an hardware independant advice.

My 2 cents,
Armin

PS: Please assign points if you find answers useful!
And now for something completely different...
Catia Lavalle
Occasional Advisor

Re: Show & Set Hardware Clock on HP-UX

ok, thanks.