Bug 56438 - clock gets set to the wrong time if you're using localtime instead of UTC
Summary: clock gets set to the wrong time if you're using localtime instead of UTC
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-18 13:36 UTC by Henning Schmiedehausen
Modified: 2014-03-17 02:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-11-28 14:39:13 UTC
Embargoed:


Attachments (Terms of Use)

Description Henning Schmiedehausen 2001-11-18 13:36:38 UTC
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:
Always

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 06:03:06 UTC
What did you use to change the timezone?

Comment 2 Henning Schmiedehausen 2001-11-28 10:05:46 UTC
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
script.

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 14:39:06 UTC
I'm looking at the installer code here, it does:

  try:
            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.