Bug 845530

Summary: UTC displayed rather than local time in OS13.1 RC1
Product: [openSUSE] openSUSE 13.1 Reporter: Forgotten User 5bOUleMVRM <forgotten_5bOUleMVRM>
Component: YaST2Assignee: Dr. Werner Fink <werner>
Status: VERIFIED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Critical    
Priority: P5 - None CC: arie.de.jonge, asn, crrodriguez, dmueller, forgotten_dk0E18_Mkw, forgotten_Si7ddX0wxG, jdelvare, nwr10cst-oslnx, ohering, pilotgi, suse-beta, werner
Version: RC 1Flags: werner: SHIP_STOPPER+
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard: maint:released:sle11-sp1:55135 maint:released:sle11-sp3:55137 maint:released:sle10-sp3:55138
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Deadline: 2013-11-26   

Description Forgotten User 5bOUleMVRM 2013-10-11 14:06:50 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0

After installation from KDE live DVD 32 bit, the date command and the clock in the system tray always show UTC rather than local time.

This is caused by a broken link created by the Date and Time module of YaST2. /etc/localtime points to ../../Europe/Berlin, which can't work. After setting the link manually to /usr/share/zoneinfo/Europe/Berlin, local time is displayed as expected.

Reproducible: Always
Comment 1 kevin vandeventer 2013-10-11 18:28:05 UTC
Same here. I installed from KDE Live 64-bit. I tried to use the KDE Control Module to change from UTC to local but changes weren't saved. 

YaST date and time settings show local time.
Comment 2 Neil Rickert 2013-10-11 20:06:02 UTC
I also had that problem.  After setting the "/etc/localtime" link correctly, it began to work.
Comment 3 arie de jonge 2013-10-12 23:21:21 UTC
Me to. GNOME 32 bit. Fixing the link was enough
Comment 4 Jiří Suchomel 2013-10-14 07:27:07 UTC
YaST does not create nor modify /etc/localtime.

Maybe zic command or timedated service went wrong?
Comment 5 Dr. Werner Fink 2013-10-14 07:42:49 UTC
Instead of using `ln -s' the command

   zic -l Europe/Berlin

should produce the symbolic link. Does this work?
Comment 6 Neil Rickert 2013-10-14 12:18:20 UTC
I tried:

 zic -l America/Chicago

That produces the bad symlink ( --> ../../America/Chicago )

While checking that, I notice that the man page for "zic" gives the
location of the timezone database as

/usr/local/etc/zoneinfo

I'm not sure if it has ever been there in linux.  So there's a documentation
bug, too.

Checking on my 12.3 system, I see that "/etc/localtime" is a file, and
not a symlink.  I seem to recall that also in earlier opensuse releases.

As a test, I tried "zic -l" on opensuse 12.3.  It produced:

 localtime -> ..//usr/share/zoneinfo/America/Chicago


That works, but the "//" should really be a "/", though fortunately
linux/unix has been tolerant of additional "/" in paths.

In any case, my point is that "zic -l" does not seem to have been used
when installing 12.3.
Comment 7 Dr. Werner Fink 2013-10-14 12:41:05 UTC
this is a bug in zic, indeed.  Since 12.3 zic should use symbolic links (systemd depends on this) and the target should be located below /usr/share/zoneinfo/
Comment 8 Leonardo Chiquitto 2013-10-14 12:43:42 UTC
This is a regression from the update to 2013g
Comment 9 Dr. Werner Fink 2013-10-14 14:30:07 UTC
Just checked in a new version of timezone:

- Add patch tzcode-fromname.patch to correct path expansion for
  local time link (bnc#845530) 
- Modify tzcode-link.diff to fit with tzcode-fromname.patch
- Modify tzcode-symlink.patch to fit with tzcode-fromname.patch
  and to avoid broken posixrules if /etc/localtime is a symlink

... this should be tested and submitted afterwards

the problem with posixrules is that a hard link with a symbolic link as target leads to broken symlinks like

   ls -l /usr/share/zoneinfo/posixrules
   lrwxrwxrwx 2 root root 35 Oct 14 16:19 /usr/share/zoneinfo/posixrules -> ../usr/share/zoneinfo/Europe/Berlin

which is not what we want I guess.  Therefore if the target is a symbolic link I add an override of defaultsymlink to TRUE
Comment 11 Forgotten User 5bOUleMVRM 2013-10-15 10:38:10 UTC
This was a little bit complicated for me, but also a challenge  ;-)

I extracted the original source code from http://download.opensuse.org/source/factory/repo/oss/suse/src/timezone-2013g-2.1.src.rpm, then applied tzcode-fromname.patch from https://build.opensuse.org/package/show/Base:System/timezone to zic.c, then tzcode-symlink.patch and ran make. 

I got a new zic binary which invoked as `zic -l Europe/Berlin` issues warning '"command line", line 1: hard link failed, symbolic link used' and creates symbolic link /usr/local/etc/zoneinfo/localtime pointing to /usr/local/etc/zoneinfo/Europe/Berlin.

I think if also the correct directories are specified in the Makefile, this could work. Is this what you meant?
Comment 12 Dr. Werner Fink 2013-10-15 10:46:12 UTC
(In reply to comment #11)

Ouch ... please use the configuration you found in the spec file, that is e.g. the variable TZDIR used on the command line of make ... or simply install the package for openSUSE_Factory

http://download.opensuse.org/repositories/Base:/System/openSUSE_Factory/x86_64/timezone-2013g-126.1.x86_64.rpm
Comment 13 Forgotten User 5bOUleMVRM 2013-10-15 13:56:41 UTC
I just installed the binary rpm (i586) and now valid links are created for /etc/localtime by using `zic -l Europe/Berlin` as well as from the Date and Time module of YaST.

Installing a binary rpm is indeed much easier if one knows that it exists and where to find it, but I think it does not hurt to dig into source packages from time to time when using open source software.

Many thanks!
Comment 14 Jiří Suchomel 2013-10-17 14:28:22 UTC
*** Bug 846411 has been marked as a duplicate of this bug. ***
Comment 15 Dr. Werner Fink 2013-10-18 07:36:12 UTC
Submit Request #203695
Comment 16 Olaf Hering 2013-10-22 10:44:18 UTC
*** Bug 846829 has been marked as a duplicate of this bug. ***
Comment 17 Dr. Werner Fink 2013-10-23 07:30:23 UTC
It seems that timezone-java does not build
Comment 18 Dr. Werner Fink 2013-10-23 08:48:47 UTC
Now it seems to work ... IMHO it would be perfect if the pre_checkin.sh script could be executed automatically at `osc checkin'
Comment 19 Dominique Leuenberger 2013-10-23 18:53:13 UTC
*** Bug 844199 has been marked as a duplicate of this bug. ***
Comment 20 Forgotten User dk0E18_Mkw 2013-10-24 02:43:20 UTC
openSUSE 13.1 RC x86_64 GNOME 3.10.1 updated. It's still showing the UTC time on system clock If NTP Server synchronization is activated by default. If you switch to Manually it will come back again messing Internet Time and Localtime. you will need to deactivate it by going to "Configure" - General Setting tab - Start NTP Daemon switch to "Only Manually", press OK and go to Date and Time in YaST again. Uncheck "Run NTP as Daemon" and "Save NTP Configuration" Please be aware "This is not a solution just a workaround waiting for a final fix".
Comment 21 Forgotten User dk0E18_Mkw 2013-10-24 02:50:02 UTC
Replicated alwayswhenever Synchronize without Daemon is activated
Comment 22 Cristian Rodríguez 2013-10-24 03:22:30 UTC
(In reply to comment #21)
> Replicated alwayswhenever Synchronize without Daemon is activated

This bug has absolutely nothing to do with what you are experincing, please file a separate bug report after installing the relevant "timezone" package updates.

This is report is about a regression in the zic command line tool, nothing else.
Comment 23 Christian Boltz 2013-10-24 11:11:00 UTC
*** Bug 845610 has been marked as a duplicate of this bug. ***
Comment 24 Swamp Workflow Management 2013-10-30 11:04:24 UTC
openSUSE-RU-2013:1612-1: An update that has one recommended fix can now be installed.

Category: recommended (low)
Bug References: 845530
CVE References: 
Sources used:
openSUSE 12.3 (src):    timezone-2013h-2.33.1, timezone-java-2013h-2.33.1
openSUSE 12.2 (src):    timezone-2013h-1.40.1, timezone-java-2013h-1.40.1
Comment 26 Swamp Workflow Management 2013-11-17 01:37:31 UTC
The SWAMPID for this issue is 55134.
This issue was rated as important.
Please submit fixed packages until 2013-11-26.
Also create a patchinfo file using this link:
https://swamp.suse.de/webswamp/wf/55134
Comment 27 Swamp Workflow Management 2013-11-30 00:04:36 UTC
Update released for: timezone, timezone-debuginfo, timezone-debugsource, timezone-java
Products:
SLE-SERVER 11-SP1-TERADATA (x86_64)
Comment 28 Swamp Workflow Management 2013-11-30 00:52:12 UTC
Update released for: timezone, timezone-debuginfo, timezone-debugsource, timezone-java
Products:
SLE-DEBUGINFO 11-SP2 (i386, ia64, ppc64, s390x, x86_64)
SLE-DESKTOP 11-SP2 (i386, x86_64)
SLE-SDK 11-SP2 (i386, x86_64)
SLE-SERVER 11-SP2 (i386, ia64, ppc64, s390x, x86_64)
SLES4VMWARE 11-SP2 (i386, x86_64)
Comment 29 Swamp Workflow Management 2013-11-30 00:54:35 UTC
Update released for: timezone, timezone-debuginfo, timezone-debugsource, timezone-java
Products:
SLE-SERVER 11-SP1-LTSS (i386, s390x, x86_64)
SLES4VMWARE 11-SP1-LTSS (i386, x86_64)
Comment 30 Swamp Workflow Management 2013-11-30 01:03:23 UTC
Update released for: timezone, timezone-debuginfo, timezone-debugsource, timezone-java
Products:
SLE-DEBUGINFO 11-SP3 (i386, ia64, ppc64, s390x, x86_64)
SLE-DESKTOP 11-SP3 (i386, x86_64)
SLE-SDK 11-SP3 (i386, ia64, ppc64, s390x, x86_64)
SLE-SERVER 11-SP3 (i386, ia64, ppc64, s390x, x86_64)
SLES4VMWARE 11-SP3 (i386, x86_64)
Comment 31 Swamp Workflow Management 2013-12-02 12:53:12 UTC
Update released for: timezone, timezone-debuginfo
Products:
SLE-SERVER 10-SP4-LTSS (i386, s390x, x86_64)
Comment 32 Swamp Workflow Management 2013-12-02 13:04:41 UTC
Update released for: timezone, timezone-debuginfo
Products:
SLE-SERVER 10-SP3-TERADATA (x86_64)
Comment 33 Bernhard Wiedemann 2014-03-20 09:02:01 UTC
This is an autogenerated message for OBS integration:
This bug (845530) was mentioned in
https://build.opensuse.org/request/show/226830 Factory / timezone
Comment 34 Swamp Workflow Management 2015-04-01 14:05:08 UTC
openSUSE-RU-2015:0642-1: An update that has 16 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 807624,845530,870375,877535,879073,879512,879680,882684,890921,892843,894862,898747,902276,904824,914676,923493
CVE References: 
Sources used:
openSUSE Evergreen 11.4 (src):    timezone-2015b-33.1, timezone-java-2015b-33.1