Technical article 115103

The hardware Real Time Clock (RTC) is accurate, but the OpenServer system clock consistently gains or loses time.

OpenServer 5.0.6OpenServer 5.0.7

Written · Last revised

Problem

The hardware RTC is always accurate, but the OpenServer system clock gains or loses time. For example, /etc/setclk -pv shows output that is similar to:

RTC 2001/07/27 15:56:00 STD
SYS 2001/07/27 15:29:58 STD  RTC-SYS=1562
RTC 2001/07/27 15:56:20 STD
SYS 2001/07/27 15:30:13 STD  RTC-SYS=1567
RTC 2001/07/27 15:56:40 STD
SYS 2001/07/27 15:30:28 STD  RTC-SYS=1572
RTC 2001/07/27 15:57:00 STD
SYS 2001/07/27 15:30:43 STD  RTC-SYS=1577
RTC 2001/07/27 15:57:20 STD
SYS 2001/07/27 15:30:58 STD  RTC-SYS=1582
RTC 2001/07/27 15:57:40 STD
SYS 2001/07/27 15:31:13 STD  RTC-SYS=1587
RTC 2001/07/27 15:58:00 STD
SYS 2001/07/27 15:31:28 STD  RTC-SYS=1592
RTC 2001/07/27 15:58:20 STD
SYS 2001/07/27 15:31:43 STD  RTC-SYS=1597
RTC 2001/07/27 15:58:40 STD
SYS 2001/07/27 15:31:58 STD  RTC-SYS=1602

Solution

Please check the following:

1. Are you using a non-standard time zone or a half hour time zone, such as IST?

There is a known problem with half hour and non-standard time zones, which has been reported to SCO Engineering. A workaround for this problem is to disable RTC tracking. To do this, edit /etc/conf/pack.d/clock/space.c and change:

FROM:
int     track_rtc              = 1;
TO:
int     track_rtc              = 0;

then, relink the kernel with the following:

/etc/conf/cf.d/link_unix -y and reboot.

2. If you are using a standard time zone, such as GMT or EST, but the problem is still occurring, it may be that the clock driver's measurements of the CPU clock frequency are inconsistent. To check if this is the case, please run:

grep clock /usr/adm/syslog

If the output is similar to that below, then this is the problem. In this case, the system had a 180 Mhz CPU, but as you can see the clock driver's measurement of the frequency was inconsistent.

%clock    -               -   -  type=TSC/67360126Hz
%clock    -               -   -  type=TSC/101040742Hz
%clock    -               -   -  type=TSC/134720983Hz
%clock    -               -   -  type=TSC/112267613Hz
%clock    -               -   -  type=TSC/134720903Hz

It is possible to work around this problem by forcing the clock driver to use a specified frequency. For instance, if you know that you have a 133 Mhz CPU, try booting the system with the following bootstring:

unix  clock.tsc_clock_hz=133000000

(that is the Mhz value followed by six zeros). If the system clock still runs slowly, you can try a slightly lower value. If the system clock runs a bit fast, you can try a slightly higher value.

If this fixes the problem, then you can 'hard wire' the clock
driver to use this value all the time. Edit
/etc/conf/pack.d/clock/space.c  and change:
unsigned long   tsc_clock_hz    = 0;

to equal the Mhz value that fixes the problem. Then, relink the kernel with /etc/conf/cf.d/link_unix -y and reboot.

NOTE:     If you are having this problem with a version of OpenServer prior to
          5.0.6, then the solution is to upgrade to 5.0.6 and then apply the
          workarounds detailed above.

From the Xinuos technical article database, record 115103. Reproduced with permission. The original is at www.sco.com/ta/115103, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.