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 STDSYS 2001/07/27 15:29:58 STD RTC-SYS=1562RTC 2001/07/27 15:56:20 STDSYS 2001/07/27 15:30:13 STD RTC-SYS=1567RTC 2001/07/27 15:56:40 STDSYS 2001/07/27 15:30:28 STD RTC-SYS=1572RTC 2001/07/27 15:57:00 STDSYS 2001/07/27 15:30:43 STD RTC-SYS=1577RTC 2001/07/27 15:57:20 STDSYS 2001/07/27 15:30:58 STD RTC-SYS=1582RTC 2001/07/27 15:57:40 STDSYS 2001/07/27 15:31:13 STD RTC-SYS=1587RTC 2001/07/27 15:58:00 STDSYS 2001/07/27 15:31:28 STD RTC-SYS=1592RTC 2001/07/27 15:58:20 STDSYS 2001/07/27 15:31:43 STD RTC-SYS=1597RTC 2001/07/27 15:58:40 STDSYS 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/syslogIf 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/134720903HzIt 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.