Bug 56438

Summary: clock gets set to the wrong time if you're using localtime instead of UTC
Product: [Retired] Red Hat Linux Reporter: Henning Schmiedehausen <hps>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED WORKSFORME QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-11-28 14:39:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.