Bug 835962 - systemd not setting system time correctly
systemd not setting system time correctly
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-06-27 12:49 EDT by Bob Hockney
Modified: 2012-06-28 05:19 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-27 14:49:46 EDT
Type: Bug
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 Bob Hockney 2012-06-27 12:49:06 EDT
Description of problem:

Filing this against F16, but also experienced this with F15 after upgrading the system from F14.  This is not the hwclock-load.service bug in the F15 installer.

My hw clock is using local time, which for me is -0600 from UTC.  After booting, the system time is set to 6 hours _earlier_ than local time, as though the system time was being set to UTC with the hw clock using my local time.

# ls -l /etc/localtime
lrwxrwxrwx 1 root root 34 Mar 17 17:03 /etc/localtime -> /usr/share/zoneinfo/America/Denver

# cat /etc/adjtime
0.000000 1340812145 0.000000

# cat /etc/sysconfig/clock
# The time zone of the system is defined by the contents of /etc/localtime.
# This file is only for evaluation by system-config-date, do not rely on its
# contents elsewhere.

For example, I booted earlier when my local time was 9:11 AM, and date gave:

Wed Jun 27 03:11:11 MDT 2012

I have verified that the hw clock is correct local time.

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

F16 upgraded from F15 (which had been update from previous releases)

How reproducible:
Always, after reboot

Steps to Reproduce:
Actual results:
System time off by UTC offset, but in the wrong direction 

Expected results:
System time correct after boot.

Additional info:
Comment 1 Michal Schmidt 2012-06-27 13:02:57 EDT
Do you have /usr on the root filesystem, or as a separate mount?
Comment 2 Bob Hockney 2012-06-27 13:57:45 EDT
(In reply to comment #1)
> Do you have /usr on the root filesystem, or as a separate mount?

/usr is separate filesystem
Comment 3 Bill Nottingham 2012-06-27 13:58:48 EDT
Time is set before /usr is mounted... in that case, you need /etc/localtime to be a copy, not a symlink.
Comment 4 Bob Hockney 2012-06-27 14:40:35 EDT
Thanks, I copied the file to /etc/localtime and it works as expected.

Having /usr on a separate filesystem used to be a recomended layout, but apparently no longer is.  Can you point me to a discussion of issues I may encounter if I keep this layout?
Comment 5 Michal Schmidt 2012-06-27 14:49:46 EDT
A split /usr layout is fine, provided that the initramfs mounts both / and /usr.
See this Fedora 17 feature page:
Comment 6 Bob Hockney 2012-06-27 16:52:51 EDT
Not sure if there is a more direct way to do this, but I forced initramfs to mount /usr by setting a symlink in /usr/sbin/init to /sbin/init, and then passing init=/usr/sbin/init to the kernel at boot time.

I can then use a symlink for /etc/localtime, and this also eliminated a few other error messages I was seeing.
Comment 7 Michal Schmidt 2012-06-27 17:50:33 EDT
An initramfs created using the version of dracut that's currently in F16 updates-testing should be able to mount /usr. The "usrmount" dracut module does it.
Comment 8 Bob Hockney 2012-06-27 19:01:02 EDT
The dracut in F16 updates-testing works for me!

Perhaps when this is pushed to updates the resolution on this should be changed to ERRATA from NOTABUG.  Once I looked into it, more that just the system time was broken by /usr not being mounted in initramfs.  I consider this a bug.
Comment 9 Michal Schmidt 2012-06-28 05:19:09 EDT
Out of curiosity - what where the other problems that you saw?

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