Bug 863676

Summary: /etc/localtime link overwritten with incorrect timezone file during firstboot
Product: [Fedora] Fedora Reporter: Steve Tyler <stephent98>
Component: system-config-dateAssignee: Nils Philippsen <nphilipp>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: awilliam, bcl, kparal, mgracik, msivak, nphilipp, petersen, robatino, stephent98
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AcceptedNTH
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-22 08:25:42 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 752661, 752664    
Description Flags
strace log showing firstboot replacing /etc/localtime none

Description Steve Tyler 2012-10-06 11:18:30 EDT
Description of problem:
During firstboot, the /etc/localtime link that was configured during installation is overwritten with a timezone file. The timezone file is for ET, not the timezone configured during installation.

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

How reproducible:

Steps to Reproduce:
1. Begin a clean install.
2. During installation, select the timezone America/Los_Angeles.
3. Reboot.
4. When the firstboot dialog is first displayed, switch to a console and login.
5. # ls -lF /etc/localtime
   # zdump /etc/localtime
6. Complete firstboot.
7. At the gdm login, switch to a console.
8. # ls -lF /etc/localtime
   # zdump /etc/localtime
Actual results:
/etc/localtime is a timezone file for ET.

Expected results:
/etc/localtime is a link to ../usr/share/zoneinfo/America/Los_Angeles.

Additional info:

$ cat typescript-2
Script started on Sat 06 Oct 2012 08:01:30 AM PDT
[root@localhost xfr]# rpm -q firstboot system-config-date
[root@localhost xfr]# ls -lF /etc/localtime
lrwxrwxrwx. 1 root root 41 Oct  6 07:51 /etc/localtime -> ../usr/share/zoneinfo/America/Los_Angeles
[root@localhost xfr]# zdump /etc/localtime
/etc/localtime  Sat Oct  6 08:02:02 2012 PDT

< firstboot was run here >

[root@localhost xfr]# ls -lF /etc/localtime
-rw-r--r--. 4 root root 3519 Sep 17 08:37 /etc/localtime
[root@localhost xfr]# zdump /etc/localtime
/etc/localtime  Sat Oct  6 11:03:17 2012 EDT
[root@localhost xfr]# exit

Script done on Sat 06 Oct 2012 11:04:04 AM EDT

See also:
Bug 824033 - RFE: Make /etc/localtime a symlink
Comment 1 Steve Tyler 2012-10-09 15:42:20 EDT
Created attachment 624244 [details]
strace log showing firstboot replacing /etc/localtime

By attaching strace to the firstboot process, I was able to catch firstboot replacing /etc/localtime. There is an apparent 4-hour time-reversal after the rename ...

10:46:08.012429 lstat("/etc/localtime.mHiyeD", 0x7fff20f2fe20) = -1 ENOENT (No such file or directory)
10:46:08.012498 link("/usr/share/zoneinfo/US/Eastern", "/etc/localtime.mHiyeD") = 0
10:46:08.012622 rename("/etc/localtime.mHiyeD", "/etc/localtime") = 0
06:46:08.012715 access("/var/spool/postfix/etc/localtime", F_OK) = -1 ENOENT (No such file or directory)

Tested with:
$ sudo strace -f -tt -p 480 2> strace1.log

Comment 2 Steve Tyler 2012-10-10 10:44:47 EDT
Proposing as an F18 Final blocker under: 

16. All known bugs that can cause corruption of user data must be fixed or documented at Common F18 bugs

    This bug overwrites the timezone configured by the user during installation.

18. All elements of the default panel (or equivalent) configuration in all release-blocking desktops must function correctly in common use 

    The user cannot change the timezone from gnome control center:
    Bug 864603 - systemd[1]: SELinux policy denies access.

Fedora 18 Final Release Criteria

Verified with a clean, default install from:

$ qemu-kvm -m 2048 -hda f18-test-1.img -cdrom ~/xfr/fedora/F18/F18-Beta/TC3/Fedora-18-Beta-TC3-x86_64-Live-Desktop.iso -usb -vga qxl -boot menu=on
Comment 3 Martin Sivák 2012-10-10 11:22:23 EDT
The timezone screen in firstboot is directly imported from system-config-date. s-c-date then does all the work. Reassigning.
Comment 4 Steve Tyler 2012-10-10 14:50:56 EDT
See also:
Bug 864603 - systemd[1]: SELinux policy denies access. (cannot change timezone from gnome control center)
Comment 5 Steve Tyler 2012-10-10 15:03:37 EDT
Proposing as an F18 Beta NTH:
1.  Causes loss of user configuration (/etc/localtime is overwritten)
2.  Cannot be fixed with an update (installer and firstboot run once)

1.  Manually create a link to a timezone file:
    $ cd /etc
    $ sudo ln -sf ../usr/share/zoneinfo/America/Los_Angeles localtime

2.  With Bug 864603[1]:
    $ sudo setenforce permissive
    < set timezone from gnome control center >
    $ sudo setenforce enforcing

3.  Without Bug 864603:
    < set timezone from gnome control center >

[1] Bug 864603 - systemd[1]: SELinux policy denies access. (cannot change timezone from gnome control center)
Comment 6 Adam Williamson 2012-10-11 14:32:29 EDT
Discussed at 2012-10-11 NTH review meeting: http://meetbot.fedoraproject.org/fedora-qa/2012-10-11/f18beta-blocker-review-3.1.2012-10-11-16.04.log.txt . Accepted as NTH - this isn't really a hugely important function, but it's very visible, confusing and annoying, and can't be fixed with an update.

In general, it looks like s-c-d needs some serious fixing for the new world order (chrony not ntpd by default, systemd handling of chrony/ntpd starting...)
Comment 7 Jens Petersen 2012-10-22 02:19:56 EDT
I really feel like this should be a blocker - effectively ignoring
timezone configuration is buggy, unprofessional, and quite annoying.
If we are not going to fix this then better to disable the tz spoke
in F18 anaconda IMHO, and let users configure themselves post-install -
at least I am able to do that now from gnome control-center. :)
Comment 8 Jens Petersen 2012-10-22 02:32:15 EDT
Wait, why is firstboot still doing anything related time/date?
Comment 9 Jens Petersen 2012-10-22 03:15:21 EDT
Ah yeah ntp setup.
Comment 10 Jens Petersen 2012-10-22 03:23:06 EDT
Yeah I see if I run system-config-date then the timezone tab canvas
shows New York irrespective of the current timezone.

Maybe s-c-d just ignores symlinks?  I actually prefer /etc/localtime
being a symlink since then it will follow tzdata updates.
Comment 11 Nils Philippsen 2012-10-22 08:25:42 EDT

*** This bug has been marked as a duplicate of bug 824033 ***
Comment 12 Steve Tyler 2012-10-22 08:46:26 EDT
(In reply to comment #11)
> *** This bug has been marked as a duplicate of bug 824033 ***

This bug is F18Beta-accepted, AcceptedNTH[1]. Does that status get transferred to bug 824033?

There is now no bug related to this problem listed at:
Fedora 18 Beta Blocker Bugs

[1] Comment 6
Comment 13 Kamil Páral 2012-10-22 10:30:07 EDT
Thanks Steve, fixed.
Comment 14 Jens Petersen 2012-10-22 21:28:23 EDT
*** Bug 856995 has been marked as a duplicate of this bug. ***