Bug 977573 - BIOS Clock change by /etc/init.d/halt script becuase /etc/init.d/blk-availability runs and unmounts /usr [NEEDINFO]
BIOS Clock change by /etc/init.d/halt script becuase /etc/init.d/blk-availabi...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
All Linux
unspecified Severity medium
: rc
: ---
Assigned To: Peter Rajnoha
Cluster QE
Depends On:
  Show dependency treegraph
Reported: 2013-06-24 19:39 EDT by Matt Roth
Modified: 2014-10-20 08:01 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-08 10:39:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
matthew.roth: needinfo?

Attachments (Terms of Use)

  None (edit)
Description Matt Roth 2013-06-24 19:39:51 EDT
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:


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.

Comment 2 Alasdair Kergon 2013-06-24 20:05:00 EDT
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 06:43:31 EDT
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:

Comment 8 Peter Rajnoha 2013-06-25 06:58:00 EDT
(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 09:55:40 EDT
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 13:41:09 EDT
We do not support /usr as
Comment 11 Peter Rajnoha 2013-08-27 08:30:48 EDT
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 10:39:43 EDT
No response - closing for now.

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