Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 56438 - clock gets set to the wrong time if you're using localtime instead of UTC
clock gets set to the wrong time if you're using localtime instead of UTC
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2001-11-18 08:36 EST by Henning Schmiedehausen
Modified: 2014-03-16 22:24 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-11-28 09:39:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Henning Schmiedehausen 2001-11-18 08:36:38 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.5) Gecko/20011014

Description of problem:
I'm running my system dual booting Windows and RH Linux 7.2
So I must run my HW clock at local time to get correct dates in Windows.

Using RH Linux 7.2, the clock is set wrongly when booting. 

The reason for this is the not yet mounted /usr filesystem when
setting the clock.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Set the HW clock to local time
2. Install RH Linux with / and /usr on different partitions
2. Select a NON-UTC timezone (e.g. MEZ)
3. Reboot

Notice that the system talks about (localtime) xxxxx UTC when setting
the clock


Actual Results:  The clock is wrong (except you're in GB)

Expected Results:  The clock should be set correctly. 

Additional info:

The reason for this is simple: The /etc/localtime is (AGAIN!) a 
soft link into /usr/share/zoneinfo. But the /usr filesystem is not
yet mounted when the clock is set. So it can't find the time zone
file and the clock gets set wrong because hwclock cannot open the
"/etc/localtime" file.

Your QA really suck. This is a so primitive error, you've should have
caught it long long ago.It was present in some older versions of RH
Linux, too.

Possible solutions:

- Force / and /usr on the same FS (bad idea)
- Mount the tree containing /usr/share/zoneinfo before setting the
  clock (bad idea)
- finally abandon the symlink idea and copy the time zone file into
  the /etc filesystem at install time. Unfortunately this is not
  easy fixable on existing systems.
Comment 1 Bill Nottingham 2001-11-28 01:03:06 EST
What did you use to change the timezone?
Comment 2 Henning Schmiedehausen 2001-11-28 05:05:46 EST
I didn't change the time zone at all. I just installed the system with the RH
installer from CD and selecte "MET" at the timezone selector in the install

The installer creates a symlink which cannot be resolved unless /usr is mounted.

I worked around this bug by removing the symlink and copying the file directly
into /etc/localtime
Comment 3 Bill Nottingham 2001-11-28 09:39:06 EST
I'm looking at the installer code here, it does:

            iutil.copyFile(fromFile, instPath + "/etc/localtime")
  except OSError, (errno, msg):
            log ("Error copying timezone (from %s): %s" % (fromFile, msg))

It copies the file. I'm not sure how you'd get a symlink there.

Note You need to log in before you can comment on or make changes to this bug.