Bug 977573

Summary: BIOS Clock change by /etc/init.d/halt script becuase /etc/init.d/blk-availability runs and unmounts /usr
Product: Red Hat Enterprise Linux 6 Reporter: Matt Roth <mgroth01>
Component: lvm2Assignee: Peter Rajnoha <prajnoha>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: agk, bmr, dwysocha, heinzm, jbrassow, mgroth01, msnitzer, prajnoha, prockai, thornber, zkabelac
Target Milestone: rcFlags: mgroth01: needinfo?
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-08 14:39:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matt Roth 2013-06-24 23:39:51 UTC
Description of problem:

BIOS clock is changed during shutdown when BIOS clock is set to localtime, and /usr is a separate filesystem and /etc/localtime is a symbolic link.

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

The BIOS clock is only getting changed in RHEL 6.4 that I have seen.  

How reproducible:

Consistently

Steps to Reproduce:

1. Make sure BIOS clock is set to localtime, my TZ is CST6CDT
2. Make /etc/localtime is a symbolic link to /usr/share/zoneinfo/America/Chicago or other correct zoneinfo file for your TZ
3. Make sure /usr is a separate file system.
4. reboot the server

Actual results:

After reboot the hardware clock has been reset and now reports correctly only with --utc option.
# date
Mon Jun 24 18:35:08 CDT 2013
# /sbin/hwclock --show --localtime
Mon 24 Jun 2013 11:35:22 PM CDT  -0.203668 seconds
# /sbin/hwclock --show --utc
Mon 24 Jun 2013 06:35:28 PM CDT  -0.219282 seconds

Expected results:

System clock and hardware clock set to the same before reboot:
# date
Mon Jun 24 18:00:44 CDT 2013
# /sbin/hwclock --show --localtime
Mon 24 Jun 2013 06:00:44 PM CDT  -0.250289 seconds

Additional info:

Added debugging commands in rc scripts to see that on shutdown after leaving blk-availability script the time zone change from CDT to UTC which is to be exected becuase the script force /usr to be unmounted, then in /etc/init.d/halt there is "hwclock --systohc" which becuase there is no access to the /etc/localtime file writes the UTC time to the the hardware clock.

N

Comment 2 Alasdair Kergon 2013-06-25 00:05:00 UTC
So should the hwclock command run earlier now?  (Instead or additionally?)  Should /usr be an exception and not be unmounted till even later?  Should the hwclock command behaviour in these specific circumstances be changed?  Should the localtime information be stored somewhere else instead?  And are there any other commands running after /usr is unmounted that also behave incorrectly?

Comment 7 Bryn M. Reeves 2013-06-25 10:43:31 UTC
Why is /etc/localtime a symlink?

It should be a copy of the relevant TZ data file for the local timezone from /usr/share/zoneinfo.

A long way back in the RHL days this was maintained as a symlink and it caused exactly this type of problem - while /usr is unavailable the host uses UTC.

There was a thread proposing reverting to symlinks about 7 years ago but this was rejected:

http://www.redhat.com/archives/rhl-devel-list/2006-April/msg00017.html

Comment 8 Peter Rajnoha 2013-06-25 10:58:00 UTC
(In reply to Matt Roth from comment #0)
> Description of problem:
> 
> BIOS clock is changed during shutdown when BIOS clock is set to localtime,
> and /usr is a separate filesystem 

Is it the whole /usr or just /usr/share that is on a separate mount? Could you please attach the output of "cat /proc/mounts"? Thanks.

(thing is that /usr should not be unmounted - blkdeactivate avoids that by default)

Comment 9 Matt Roth 2013-06-25 13:55:40 UTC
There seems to be a lot of the confusion internally and on the web as to whether or not the /etc/localtime should be a copy or a symbolic link.  Is there a RHEL document that states this as needing to be a copy not a symbolic link.

Comment 10 Lennart Poettering 2013-06-26 17:41:09 UTC
We do not support /usr as

Comment 11 Peter Rajnoha 2013-08-27 12:30:48 UTC
Matt, please, see comment #8 (blkdeactivate should not unmount /usr) - please, provide the output of cat /proc/mounts. Thanks.

Comment 12 Alasdair Kergon 2013-10-08 14:39:43 UTC
No response - closing for now.